Skip to content

Conversation

@drammock
Copy link
Member

@drammock drammock commented Apr 9, 2021

this is item 4 from #8761

@jasmainak
Copy link
Member

Thanks @drammock for giving a stab at this. When I tried to make a green vertical line by left clicking, this happened:

image

here's how I got to epochs:

import os
import mne

sample_data_folder = mne.datasets.sample.data_path()
sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample',
                                    'sample_audvis_raw.fif')
raw = mne.io.read_raw_fif(sample_data_raw_file, verbose=False).crop(tmax=120)

events = mne.find_events(raw, stim_channel='STI 014')
event_dict = {'auditory/left': 1, 'auditory/right': 2, 'visual/left': 3,
              'visual/right': 4, 'face': 5, 'button': 32}
epochs = mne.Epochs(raw, events, tmin=-0.2, tmax=0.5, event_id=event_dict,
                    preload=True)

@drammock
Copy link
Member Author

drammock commented Apr 10, 2021 via email

@jasmainak
Copy link
Member

so I had started using

$ ipython --matplotlib

what I thought was the recommendation but I just checked and it seems the recommendation is:

$ ipython --matplotlib=qt

and with this, it works!

@jasmainak
Copy link
Member

Actually no, it doesn't work on that backend either. I spoke too soon. It depends where you click. Should I try another backend?

@agramfort
Copy link
Member

I replicate the problem on my machine.

@drammock drammock mentioned this pull request Apr 20, 2021
@larsoner
Copy link
Member

larsoner commented Apr 21, 2021

I cannot replicate on my macOS machine, but I do get this:

(base) $ MPLBACKEND=MacOSX python -ui rep.py 
Traceback (most recent call last):
  File "/Users/larsoner/opt/miniconda3/lib/python3.8/site-packages/matplotlib/cbook/__init__.py", line 224, in process
    func(*args, **kwargs)
  File "/Users/larsoner/python/mne-python/mne/viz/_figure.py", line 563, in _resize
    old_width, old_height = self.mne.fig_size_px

And interaction with this backend is pretty bad. I recommend people use Qt5Agg on macOS, the experience will probably be better.

We should still fix this, but I wish the default backend on macOS was Qt5Agg so we didn't have to keep working around the MacOSX backend flaws in our code :(

@drammock
Copy link
Member Author

I wish the default backend on macOS was Qt5Agg so we didn't have to keep working around the MacOSX backend flaws in our code :(

Another alternative is that one of you folks who has a mac laptop can do all the 2D viz work (or ship a mac laptop to me) :)

@drammock drammock deleted the fix-epochs-green-lines branch April 22, 2021 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants