# Saving EEG plot of rawarray not working

**URL:** <https://mne.discourse.group/t/saving-eeg-plot-of-rawarray-not-working/5756>\
**Category:** Support & Discussions\
**Tags:** eeg, visualization\
**Created:** [October 18, 2022, 11:55am UTC](https://mne.discourse.group/t/saving-eeg-plot-of-rawarray-not-working/5756 "2022-10-18T11:55:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![annejooyun](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@annejooyun](https://mne.discourse.group/u/annejooyun)\
**Post date:** [October 18, 2022, 11:55am UTC](https://mne.discourse.group/t/saving-eeg-plot-of-rawarray-not-working/5756/1 "2022-10-18T11:55:26Z")

</div>

- Not sure which version of MNE, but using Windows 10 and Jupyter Notebook

I can’t seem to save my figures of RawArray plots of EEG data.

```python
raw_A_S1T1 = scipy.io.loadmat(path_A_S1T1)
raw_data_A_S1T1 = raw_A_S1T1['Data']
info = mne.create_info(ch_names = channel_names, sfreq = Fs, ch_types = ch_type)
raw_A_S1T1.plot(title='Raw data A_S1T1', n_channels=n_channels, scalings='auto', show=False)
plt.savefig('Raw_EEG_data_S1T1.png')

```

Without the “show = False”, this MNE figure pops up correctly.  
However, I want it in a better format as this is going to be presented in my master’s thesis

 ![eeg data raw](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/5/53028ffeebac672e4d93c0cbfd61e67e3bea2acc.png)

The png figure is saved in folder, but when I open it it is just blank.  
(This method, however, works for topomaps, maybe because they are shown directly in jupyter ide, and not via mne?)  
Can anybody help me?

---

<div class="post-metadata">

**Author:** ![mscheltienne](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mscheltienne/32/827_2.png) [@mscheltienne](https://mne.discourse.group/u/mscheltienne)\
**Post date:** [October 18, 2022, 1:25pm UTC](https://mne.discourse.group/t/saving-eeg-plot-of-rawarray-not-working/5756/2 "2022-10-18T13:25:11Z")

</div>

It’s going to be difficult to help you here. This is not what the data browser is designed to do. It’s an **interactive** browser, and based on the screenshot you provided, you are using the latest `mne-qt-browser` which provides a smoother experience. However, this browser is a `Qt` application, it’s not a `matplotlib` plot, thus `plt.savefig` will not work.

I think screenshots or a screen-capture might be your best bet.

EDIT: `plt.savefig` works for topomap because MNE returns a `matplotlib` Figure.

---

<div class="post-metadata">

**Author:** ![annejooyun](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@annejooyun](https://mne.discourse.group/u/annejooyun)\
**Post date:** [October 18, 2022, 1:29pm UTC](https://mne.discourse.group/t/saving-eeg-plot-of-rawarray-not-working/5756/3 "2022-10-18T13:29:30Z")

</div>

I see…  
Do you know any way other way to plot the EEG data channel-wise, so that the figure is save-able?

---

<div class="post-metadata">

**Author:** ![drammock](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/drammock/32/4_2.png) [@drammock](https://mne.discourse.group/u/drammock)\
**Post date:** [October 18, 2022, 1:30pm UTC](https://mne.discourse.group/t/saving-eeg-plot-of-rawarray-not-working/5756/4 "2022-10-18T13:30:11Z")

</div>

if you want a raw browser plot that is suitable for inclusion in a paper, I suggest this:

```python
with mne.viz.use_browser_backend('matplotlib'):
    fig = raw.plot()
    fig.savefig('filename.png') # or PDF, JPEG, whatever matplotlib supports

```

consider the option `show_scrollbars=False` to make it look a little nicer.

---

<div class="post-metadata">

**Author:** ![annejooyun](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@annejooyun](https://mne.discourse.group/u/annejooyun)\
**Post date:** [October 18, 2022, 1:35pm UTC](https://mne.discourse.group/t/saving-eeg-plot-of-rawarray-not-working/5756/5 "2022-10-18T13:35:32Z")

</div>

> [@drammock](#):
>
> show\_scrollbars=False

Thank you! This I can work with!
