I wrote a small command line eeg viewer / eeg plot saver

I have been doing a lot of plots with mne and/or mnelab, then scrolling to interesting times and doing screenshots, saving under so-and-so filename. Today it got old, so I sharpened the saw, and wrote a small command line program that will view eeg plots or create images of plots. You can specify several options, including the starting time and duration, height and width for the image, etc. It will name the file based on the eeg filename and start time, or you can specify your own name. There are a few more options as well.

It currently only supports continuous files.

I thought it might be useful to others, so you can find it here.

1 Like

Now supports continuous (raw) and epoched files.
I also added a few more command line options.

Release 0.2

Glad that you found a way to streamline your process! I’m curious why you find this easier than passing the relevant arguments into raw.plot() within Python β€” since it has parameters start and duration, the default window size of raw.plot() is managed by the MNE_BROWSE_RAW_SIZE config variable, and you can save figures at any size like this:

fig = raw.plot(...)
fig.set_size_inches(...)
fig.savefig(filename, dpi, ...)

Is there some more complicated aspect to your workflow that makes the Python API not suitable?

Yeah, it’s just easier from the command line.
Like now, I’m in VSCode, and in the terminal window I’m running ploteeg to display some eeg files.
I’ve also written a plotpsd to plot power spectral density.
Rather than having to tinker around in a Python source file, then run, then edit, then run, … I just change arguments on the command line.
Also, I can just up-arrow to repeat a previous command.