Repository: mne-tools/mne-python

Issue:
eliminate hardcoded tight layout
#### Reference issue
Candidate implementation for #8583  

#### Limitations
- I have just sticked to `plot_epochs` and didn't look for other occurrences of this behaviour. 
- I haven't added a `.. versionadded:: 0.XX ` entry

@drammock 


Discussion:
sorry to be slow on this.  I've been pondering, and I'm hesitating to merge this right away because we're about to release a new stable version in a couple weeks.  I'd rather not add a new `set_tight_layout` parameter to these plotting methods, and then turn around and deprecate it in the next version (because I think the right fix is to *never* call `tight_layout`).

What I'd like to do is get the more permanent fix in place before we release. I've just added #8583 to our release milestone, to motivate me to get around to it very soon.  I'd like to leave this PR open, and merge it *after* the next release if we don't get around to implementing a proper fix before release time...  that way we could introduce the new (temporary) `set_tight_layout` parameter at the beginning of a cycle and then remove it before the next release, saving ourself the pain of having to deprecate it for six months before removing it.

Resolving patch:
diff --git a/mne/viz/evoked.py b/mne/viz/evoked.py
--- a/mne/viz/evoked.py
+++ b/mne/viz/evoked.py
@@ -192,7 +192,7 @@ def _plot_legend(pos, colors, axis, bads, outlines, loc, size=30):
 def _plot_evoked(evoked, picks, exclude, unit, show, ylim, proj, xlim, hline,
                  units, scalings, titles, axes, plot_type, cmap=None,
                  gfp=False, window_title=None, spatial_colors=False,
-                 set_tight_layout=True, selectable=True, zorder='unsorted',
+                 selectable=True, zorder='unsorted',
                  noise_cov=None, colorbar=True, mask=None, mask_style=None,
                  mask_cmap=None, mask_alpha=.25, time_unit='s',
                  show_names=False, group_by=None, sphere=None):
@@ -237,7 +237,6 @@ def _plot_evoked(evoked, picks, exclude, unit, show, ylim, proj, xlim, hline,
                          proj, xlim, hline, units, scalings, titles,
                          ax, plot_type, cmap=cmap, gfp=gfp,
                          window_title=window_title,
-                         set_tight_layout=set_tight_layout,
                          selectable=selectable, noise_cov=noise_cov,
                          colorbar=colorbar, mask=mask,
                          mask_style=mask_style, mask_cmap=mask_cmap,
@@ -301,7 +300,8 @@ def _plot_evoked(evoked, picks, exclude, unit, show, ylim, proj, xlim, hline,
     fig = None
     if axes is None:
         fig, axes = plt.subplots(len(ch_types_used), 1)
-        plt.subplots_adjust(0.175, 0.08, 0.94, 0.94, 0.2, 0.63)
+        fig.subplots_adjust(left=0.125, bottom=0.1, right=0.975, top=0.92,
+                            hspace=0.63)
         if isinstance(axes, plt.Axes):
             axes = [axes]
         fig.set_size_inches(6.4, 2 + len(axes))
@@ -364,8 +364,6 @@ def _plot_evoked(evoked, picks, exclude, unit, show, ylim, proj, xlim, hline,
 
     plt.setp(fig.axes[:len(ch_types_used) - 1], xlabel='')
     fig.canvas.draw()  # for axes plots update axes.
-    if set_tight_layout:
-        tight_layout(fig=fig)
     plt_show(show)
     return fig
 
@@ -1425,7 +1423,7 @@ def plot_evoked_joint(evoked, times="peaks", title='', picks=None,
                        sphere=None)
     ts_args_def.update(ts_args)
     _plot_evoked(evoked, axes=ts_ax, show=False, plot_type='butterfly',
-                 exclude=[], set_tight_layout=False, **ts_args_def)
+                 exclude=[], **ts_args_def)
 
     # handle title
     # we use a new axis for the title to handle scaling of plots


Test patch: