Skip to content

Commit afce272

Browse files
Fix BUG: epochs.plot_image(evoked=False) doesn't show time in seconds #88… (#9115)
* BUG: epochs.plot_image(evoked=False) doesn't show time in seconds #8887. Additionally adapted the overly_times. * Update latest.inc and names.inc * fix underscore * Update latest.inc Added the replacement. Co-authored-by: Stefan Appelhoff <[email protected]>
1 parent 88cbfa8 commit afce272

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

doc/changes/latest.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ Current (0.23.dev0)
3737

3838
.. |Valerii Chirkov| replace:: **Valerii Chirkov**
3939

40+
.. |Matteo Anelli| replace:: **Matteo Anelli**
41+
4042
Enhancements
4143
~~~~~~~~~~~~
4244
- Add :meth:`mne.Dipole.to_mni` for more convenient dipole.pos to MNI conversion (:gh:`9043` **by new contributor** |Valerii Chirkov|_)
@@ -117,6 +119,8 @@ Enhancements
117119

118120
Bugs
119121
~~~~
122+
- Fix bug with :func:`mne.Epochs.plot_image` where the ``x_label`` was different depending on the evoked parameter (:gh:`9115` **by new contributor** |Matteo Anelli|_)
123+
120124
- Fix bug with restricting :func:`mne.io.Raw.save` saving options to .fif and .fif.gz extensions (:gh:`9062` by |Valerii Chirkov|_)
121125

122126
- Fix bug with :func:`mne.io.read_raw_kit` where missing marker coils were not handled (:gh:`8989` **by new contributor** |Judy D Zhu|_)

doc/changes/names.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,3 +367,5 @@
367367
.. _Judy D Zhu: https://github.com/JD-Zhu
368368
369369
.. _Valerii Chirkov: https://github.com/vagechirkov
370+
371+
.. _Matteo Anelli: https://github.com/matteoanelli

mne/viz/epochs.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,22 +513,24 @@ def _plot_epochs_image(image, style_axes=True, epochs=None, picks=None,
513513
# draw the image
514514
cmap = _setup_cmap(cmap, norm=norm)
515515
n_epochs = len(image)
516-
extent = [1e3 * tmin, 1e3 * tmax, 0, n_epochs]
516+
extent = [tmin, tmax, 0, n_epochs]
517517
im = ax_im.imshow(image, vmin=vmin, vmax=vmax, cmap=cmap[0], aspect='auto',
518518
origin='lower', interpolation='nearest', extent=extent)
519519

520520
# optional things
521521
if style_axes:
522522
ax_im.set_title(title)
523523
ax_im.set_ylabel('Epochs')
524+
if not evoked:
525+
ax_im.set_xlabel('Time (s)')
524526
ax_im.axis('auto')
525527
ax_im.axis('tight')
526528
ax_im.axvline(0, color='k', linewidth=1, linestyle='--')
527529

528530
if overlay_times is not None:
529-
ax_im.plot(1e3 * overlay_times, 0.5 + np.arange(n_epochs), 'k',
531+
ax_im.plot(overlay_times, 0.5 + np.arange(n_epochs), 'k',
530532
linewidth=2)
531-
ax_im.set_xlim(1e3 * tmin, 1e3 * tmax)
533+
ax_im.set_xlim(tmin, tmax)
532534

533535
# draw the evoked
534536
if evoked:

0 commit comments

Comments
 (0)