Hi, I’m trying to use viz.plot_compare_evokeds to obtain an ERP plot per channel in the same figure. What I get is a figure that in which axes are not aligned, ticks are not in the correct axes, among others, see below:
axes='topo' is the reason. It’s creating the axes in a spatial layout corresponding to the layout of the sensors. Try changing ch_include to include other or different sensors and you’ll see.
Thanks. I see, the thing is that I want exactly Fz, Pz, and P8. Even if say that the layout (XY placement of 3 ERP plots in the figure plane) is correct, the axes ticks and titles are still messed up. I wanted to double check before filling a bug report in GitHub.
you can pre-generate 3 axes with matplotlib, then plot to each one in turn using one of your 3 channels. something like
fig, axs = plt.subplots(1, 3)
for ch_name, ax in zip(ch_include, axs):
plot_compare_evokeds(evoked, picks=ch_name, axes=ax)
If you don’t want them all in a row as subplots, then you have all of matplotlib’s power at your disposal to place the axes wherever you want (fig = plt.figure() followed by 3 calls to fig.add_axes(...), placing them wherever you want within the figure).
Yes, thanks, that would be a way to rearrange the plots. But please read my previous message and see the figure from the original post. I’m mostly concerned about how ticks (numbers in the axis) seem to appear in the wrong locations.
A call with the argument “axis=‘topo’” would give a subplot arrangement that I may like or not, but it should produce correct axes ticks and titles.
feel free to just open the issue with a link to this thread, since I’m pretty sure I realize now what the problem is (and sorry for not reading your reply carefully enough). plot_compare_evokeds(..., axes='topo') tries to create an extra axis that shows only the axis spines, ticklabels, and axis labels. It looks like that “legend axis” is getting plotted on top of the axis for P8