# mne.viz.plot\_raw\_psd(raw) not work

**URL:** <https://mne.discourse.group/t/mne-viz-plot-raw-psd-raw-not-work/7213>\
**Category:** Support & Discussions\
**Tags:** eeg, visualization\
**Created:** [July 10, 2023, 10:56pm UTC](https://mne.discourse.group/t/mne-viz-plot-raw-psd-raw-not-work/7213 "2023-07-10T22:56:05Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![jack\_hu](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@jack\_hu](https://mne.discourse.group/u/jack_hu)\
**Post date:** [July 10, 2023, 10:56pm UTC](https://mne.discourse.group/t/mne-viz-plot-raw-psd-raw-not-work/7213/1 "2023-07-10T22:56:05Z")

</div>

mne.viz.plot\_raw\_psd(raw) work diffrent in different mne version  
in MNE version: 0.22  
`mne.viz.plot_raw_psd(raw_data, fmin = 4, fmax= 45)`  
show the **correct image** that i want:

 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/2/218ffe3e849f99f85898fd38bbba0f76a90320c9.jpeg)

in MNE 1.4.2 it gets problem  
`mne.viz.plot_raw_psd(raw_data, fmin = 4, fmax= 45)`  
show the following **error: ‘NoneType’ object has no attribute ‘\_get\_renderer’**

 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/4/429abbdc25caa0f24437f608f8e6d556ef7e386f.png)

if i change the code a bit:  
`mne.viz.plot_raw_psd(raw_data, fmin = 4, fmax= 45,average=True);`

i get a plot ,but i want color plot for each sensor seperately as the first plot

 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/2/23665f06f8eac64242565d14eeec89fed5b33958.jpeg)

the info for raw\_data is code as:

```python
info = mne.create_info(eeg_channels.tolist(), ch_types=32*['eeg'], sfreq=128)
info.set_montage('standard_1020')

```

 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/0/0cfa23107d12d3097c444e461f769ddcc2c083d6.png)

---

<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:** [July 11, 2023, 8:22am UTC](https://mne.discourse.group/t/mne-viz-plot-raw-psd-raw-not-work/7213/2 "2023-07-11T08:22:17Z")

</div>

Hello,

Could you try using the Spectrum API from the `raw` methods?

```python
raw = ...
spectrum = raw.compute_psd(fmin=4, fnax=45)
spectrum.plot()

```

That said, I think I saw that error once yesterday and did not dig in. I’ll have a look when able.

Mathieu

---

<div class="post-metadata">

**Author:** ![agramfort](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@agramfort](https://mne.discourse.group/u/agramfort)\
**Post date:** [July 11, 2023, 9:37am UTC](https://mne.discourse.group/t/mne-viz-plot-raw-psd-raw-not-work/7213/3 "2023-07-11T09:37:02Z")

</div>

can you try

mne.viz.plot\_raw\_psd(raw\_data, fmin = 4, fmax= 45,average=False)

?

Alex

---

<div class="post-metadata">

**Author:** ![jack\_hu](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@jack\_hu](https://mne.discourse.group/u/jack_hu)\
**Post date:** [July 11, 2023, 10:19am UTC](https://mne.discourse.group/t/mne-viz-plot-raw-psd-raw-not-work/7213/6 "2023-07-11T10:19:35Z")

</div>

Thank for your kind reply, it still not work. It seems that it plot only when `average=True`

```python
raw = raw_data
spectrum = raw.compute_psd(fmin=4, fmax=45)
spectrum.plot(average=True);

```

 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/b/bcd17fafff5e6e64967f5a368b4ea6eb28579a8f.jpeg)

when set `average=False`  
still get the error:  
**AttributeError: ‘NoneType’ object has no attribute ‘\_get\_renderer’**

---

<div class="post-metadata">

**Author:** ![jack\_hu](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@jack\_hu](https://mne.discourse.group/u/jack_hu)\
**Post date:** [July 11, 2023, 10:24am UTC](https://mne.discourse.group/t/mne-viz-plot-raw-psd-raw-not-work/7213/7 "2023-07-11T10:24:41Z")

</div>

still not work,get the same error as before  
**AttributeError: ‘NoneType’ object has no attribute ‘\_get\_renderer’**

---

<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:** [July 11, 2023, 11:07am UTC](https://mne.discourse.group/t/mne-viz-plot-raw-psd-raw-not-work/7213/8 "2023-07-11T11:07:16Z")

</div>

I can’t reproduce on `main` or on `maint/1.4`. Can you run this code snippet and let me know if that works?

```python
from mne.datasets import sample
from mne.io import read_raw_fif

fname = sample.data_path() / "MEG" / "sample" / "sample_audvis_raw.fif"
raw = read_raw_fif(fname, preload=False)
raw.crop(0, 60).pick("eeg")
raw.load_data()
raw.filter(1., 40.)
raw.set_eeg_reference("average")
spectrum = raw.compute_psd(fmin=1, fmax=30)
spectrum.plot(average=False)

```

If it does work, can you share the `raw` file you use which fails?  
If it doesn’t work, can you update your MNE version/make sure you are using the latest one? e.g. `pip install --upgrade mne`.

Mathieu

---

<div class="post-metadata">

**Author:** ![jack\_hu](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@jack\_hu](https://mne.discourse.group/u/jack_hu)\
**Post date:** [July 11, 2023, 1:04pm UTC](https://mne.discourse.group/t/mne-viz-plot-raw-psd-raw-not-work/7213/9 "2023-07-11T13:04:41Z")

</div>

Thank you Mathieu for your kind reply. @mscheltienne  
The version i am using already updated, no change.

When i run the code you offer, the same error happen again  
**AttributeError: ‘NoneType’ object has no attribute ‘\_get\_renderer’**

For the error message, all is related to **matplotlib** and **Ipython** as below.  
I am using `%matplotlib inline` as the backend.

 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/8/8ee201f95a6e9b99d8b0d266a3bd50fc8aa2c4f1.png)

I don’t know if this related to the case that i am running jupylab remotely through port forwarding.

I installed Jupyterlab on a remote server from my university cluster, i connect to the Jupyter lab interface using SSH tunneling.  
But if I run in the mne0.22 environment, it can show the plot correctly.

My mne.info() as follows:

 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/a/aff8d149fa5fadcfc410ebbdcea3d5d1ac5ecf3c.png)

I also try this code block in colab, it can run and show the plot.

---

<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:** [July 11, 2023, 1:30pm UTC](https://mne.discourse.group/t/mne-viz-plot-raw-psd-raw-not-work/7213/10 "2023-07-11T13:30:46Z")

</div>

Let’s try to install the additional dependencies and to update ipython, matplotlib and so on.

```python
pip install --upgrade ipython ipykernel ipympl matplotlib

```

Mathieu

---

<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:** [July 11, 2023, 2:48pm UTC](https://mne.discourse.group/t/mne-viz-plot-raw-psd-raw-not-work/7213/11 "2023-07-11T14:48:35Z")

</div>

> [@jack\_hu](#):
>
> I don’t know if this related to the case that i am running jupylab remotely through port forwarding. I installed Jupyterlab on a remote server from my university cluster, i connect to the Jupyter lab interface using SSH tunneling. But if I run in the mne0.22 environment, it can show the plot correctly.

> [@jack\_hu](#):
>
> I also try this code block in colab, it can run and show the plot.

The traceback you show is entirely withing the ipython/matplotlib namespaces. This means that the error does not originate within MNE-Python code. That makes it harder for us to debug it.

I think @mscheltienne is correct to suggest that you try upgrading ipython, matplotlib, etc, but it may be that the reason it works with MNE 0.22 is that the MNE 0.22 environment ends up with _older_ versions of ipython/matplotlib/etc and that is why it works (i.e., there might be a bug in _newer_ versions of those packages).

---

<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:** [July 11, 2023, 2:55pm UTC](https://mne.discourse.group/t/mne-viz-plot-raw-psd-raw-not-work/7213/12 "2023-07-11T14:55:48Z")

</div>

I had a look at my environment using `main`, created when MNE-main was in version `1.4.0.dev106+gbfc8a3c47` (editable install, only pulling main without re-install thus not updating the metadata). Everything is fairly recent, only one or 2 minor version behind at most.

```python
matplotlib 3.7.1 (backend=module://ipympl.backend_nbagg)
ipympl 0.9.3
ipykernel: 6.22
ipython: 8.12

```

The code snippet I shared works in a jupyter-lab cell:

```python
%matplotlib inline

from mne.datasets import sample
from mne.io import read_raw_fif

fname = sample.data_path() / "MEG" / "sample" / "sample_audvis_raw.fif"
raw = read_raw_fif(fname, preload=False)
raw.crop(0, 60).pick("eeg")
raw.load_data()
raw.filter(1., 40.)
raw.set_eeg_reference("average")
spectrum = raw.compute_psd(fmin=1, fmax=30)
spectrum.plot(average=False)

```

Note the different backend, maybe installing `ipympl` will solve your issue.

Mathieu

---

<div class="post-metadata">

**Author:** ![jack\_hu](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@jack\_hu](https://mne.discourse.group/u/jack_hu)\
**Post date:** [July 11, 2023, 6:50pm UTC](https://mne.discourse.group/t/mne-viz-plot-raw-psd-raw-not-work/7213/13 "2023-07-11T18:50:03Z")

</div>

Thank you Mathieu!  
It can print the graph now! Thank you!  
Just a bit messy thing i still don’t understand, it print the same error message between the same graph.

 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/f/fe457720f69dda7ced2f0cbdcc216e897aa8b896.jpeg)

if I add the **semicolon** at the end of the plot code as:  
`spectrum.plot(average=False);`  
It will show two same plot without the error messages:

 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/b/bfd2fe754c95b1110a5154eb971f81ca2444b0aa.jpeg)

Thank you @drammock @mscheltienne for your advice, finally work

---

<div class="post-metadata">

**Author:** ![DaniG](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/danig/32/2809_2.png) [@DaniG](https://mne.discourse.group/u/DaniG)\
**Post date:** [July 18, 2023, 2:33pm UTC](https://mne.discourse.group/t/mne-viz-plot-raw-psd-raw-not-work/7213/14 "2023-07-18T14:33:51Z")

</div>

Hello!

I get exactly the same error when trying to run `raw.compute_psd()`.  
When using `%matplotlib qt` it works fine, but I get the following error when using `%matplotlib inline`

```python
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
File ~/anaconda3/envs/mne-env/lib/python3.10/site-packages/IPython/core/formatters.py:340, in BaseFormatter. __call__ (self, obj)
    338 pass
    339 else:
--> 340 return printer(obj)
    341 # Finally look for special method names
    342 method = get_real_method(obj, self.print_method)

File ~/anaconda3/envs/mne-env/lib/python3.10/site-packages/IPython/core/pylabtools.py:152, in print_figure(fig, fmt, bbox_inches, base64, **kwargs)
    149 from matplotlib.backend_bases import FigureCanvasBase
    150 FigureCanvasBase(fig)
--> 152 fig.canvas.print_figure(bytes_io, **kw)
    153 data = bytes_io.getvalue()
    154 if fmt == 'svg':

File ~/anaconda3/envs/mne-env/lib/python3.10/site-packages/matplotlib/backend_bases.py:2353, in FigureCanvasBase.print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, bbox_inches, pad_inches, bbox_extra_artists, backend, **kwargs)
   2350 bbox_inches = bbox_inches.padded(pad_inches)
   2352 # call adjust_bbox to save only the given area
-> 2353 restore_bbox = _tight_bbox.adjust_bbox(
   2354 self.figure, bbox_inches, self.figure.canvas.fixed_dpi)
   2356 _bbox_inches_restore = (bbox_inches, restore_bbox)
   2357 else:

File ~/anaconda3/envs/mne-env/lib/python3.10/site-packages/matplotlib/_tight_bbox.py:28, in adjust_bbox(fig, bbox_inches, fixed_dpi)
     26 locator = ax.get_axes_locator()
     27 if locator is not None:
---> 28 ax.apply_aspect(locator(ax, None))
     29 locator_list.append(locator)
     30 current_pos = ax.get_position(original=False).frozen()

File ~/anaconda3/envs/mne-env/lib/python3.10/site-packages/mpl_toolkits/axes_grid1/inset_locator.py:73, in AnchoredLocatorBase. __call__ (self, ax, renderer)
     71 def __call__ (self, ax, renderer):
     72 self.axes = ax
---> 73 bbox = self.get_window_extent(renderer)
     74 px, py = self.get_offset(bbox.width, bbox.height, 0, 0, renderer)
     75 bbox_canvas = Bbox.from_bounds(px, py, bbox.width, bbox.height)

File ~/anaconda3/envs/mne-env/lib/python3.10/site-packages/matplotlib/offsetbox.py:399, in OffsetBox.get_window_extent(self, renderer)
    396 def get_window_extent(self, renderer=None):
    397 # docstring inherited
    398 if renderer is None:
--> 399 renderer = self.figure._get_renderer()
    400 bbox = self.get_bbox(renderer)
    401 try: # Some subclasses redefine get_offset to take no args.

AttributeError: 'NoneType' object has no attribute '_get_renderer'

```

I’m using the following version of MNE:

```python
Platform macOS-13.4.1-arm64-arm-64bit
Python 3.10.12 | packaged by conda-forge | (main, Jun 23 2023, 22:41:52) [Clang 15.0.7]
Executable /Users/dani/anaconda3/envs/mne-env/bin/python
CPU arm (12 cores)
Memory 32.0 GB

Core
├☑ mne 1.4.2
├☑ numpy 1.24.4 (OpenBLAS 0.3.23 with 12 threads)
├☑ scipy 1.11.1
├☑ matplotlib 3.7.2 (backend=module://matplotlib_inline.backend_inline)
├☑ pooch 1.7.0
└☑ jinja2 3.1.2

Numerical (optional)
├☑ sklearn 1.3.0
├☑ numba 0.57.1
├☑ nibabel 5.1.0
├☑ nilearn 0.10.1
├☑ dipy 1.7.0
├☑ openmeeg 2.5.6
├☑ pandas 2.0.3
└☐ unavailable cupy

Visualization (optional)
├☑ pyvista 0.40.1 (OpenGL 4.1 Metal - 83.1 via Apple M2 Max)
├☑ pyvistaqt 0.0.0
├☑ ipyvtklink 0.2.2
├☑ vtk 9.2.6
├☑ qtpy 2.3.1 (PyQt5=5.15.6)
├☑ ipympl 0.8.7
├☑ pyqtgraph 0.13.3
└☑ mne-qt-browser 0.5.1

Ecosystem (optional)
└☐ unavailable mne-bids, mne-nirs, mne-features, mne-connectivity, mne-icalabel, mne-bids-pipeline

```

And these are the packages in my conda environment:

```python
(mne-env) dani@Danielas-MBP-2 ~ % conda list                                             
# packages in environment at /Users/dani/anaconda3/envs/mne-env:
#
# Name Version Build Channel
aiohttp 3.8.4 py310h2aa6e3c_1 conda-forge
aiosignal 1.3.1 pyhd8ed1ab_0 conda-forge
anyio 3.7.1 pyhd8ed1ab_0 conda-forge
aom 3.5.0 h7ea286d_0 conda-forge
appnope 0.1.3 pyhd8ed1ab_0 conda-forge
argon2-cffi 21.3.0 pyhd8ed1ab_0 conda-forge
argon2-cffi-bindings 21.2.0 py310h8e9501a_3 conda-forge
arrow 1.2.3 pypi_0 pypi
asttokens 2.2.1 pyhd8ed1ab_0 conda-forge
async-timeout 4.0.2 pyhd8ed1ab_0 conda-forge
attrs 23.1.0 pyh71513ae_1 conda-forge
aws-c-auth 0.7.0 hf4e22b4_2 conda-forge
aws-c-cal 0.6.0 h43a37b4_0 conda-forge
aws-c-common 0.8.23 hb547adb_0 conda-forge
aws-c-compression 0.2.17 h31a6291_1 conda-forge
aws-c-event-stream 0.3.1 h1e1aaf7_1 conda-forge
aws-c-http 0.7.11 h3107daf_0 conda-forge
aws-c-io 0.13.28 hf096fb3_0 conda-forge
aws-c-mqtt 0.8.14 h9418dbe_2 conda-forge
aws-c-s3 0.3.13 h79b0d72_2 conda-forge
aws-c-sdkutils 0.1.11 h31a6291_1 conda-forge
aws-checksums 0.1.16 h31a6291_1 conda-forge
aws-crt-cpp 0.20.3 h0918d87_4 conda-forge
aws-sdk-cpp 1.10.57 h6f3a27c_17 conda-forge
backcall 0.2.0 pyh9f0ad1d_0 conda-forge
backports 1.0 pyhd8ed1ab_3 conda-forge
backports.functools_lru_cache 1.6.5 pyhd8ed1ab_0 conda-forge
beautifulsoup4 4.12.2 pyha770c72_0 conda-forge
bleach 6.0.0 pyhd8ed1ab_0 conda-forge
blosc 1.21.4 hc338f07_0 conda-forge
brotli 1.0.9 h1a8c8d9_9 conda-forge
brotli-bin 1.0.9 h1a8c8d9_9 conda-forge
brotli-python 1.0.9 py310h0f1eb42_9 conda-forge
brunsli 0.1 h9f76cd9_0 conda-forge
bzip2 1.0.8 h3422bc3_4 conda-forge
c-ares 1.19.1 hb547adb_0 conda-forge
c-blosc2 2.10.0 h068da5f_0 conda-forge
ca-certificates 2023.05.30 hca03da5_0  
cached-property 1.5.2 hd8ed1ab_1 conda-forge
cached_property 1.5.2 pyha770c72_1 conda-forge
cairo 1.16.0 h1e71087_1016 conda-forge
certifi 2023.5.7 py310hca03da5_0  
cffi 1.15.1 py310h2399d43_3 conda-forge
cfitsio 4.2.0 h2f961c4_0 conda-forge
charls 2.4.2 h13dd4ca_0 conda-forge
charset-normalizer 3.2.0 pyhd8ed1ab_0 conda-forge
colorama 0.4.6 pyhd8ed1ab_0 conda-forge
colorspacious 1.1.2 pyh24bf2e0_0 conda-forge
comm 0.1.3 pyhd8ed1ab_0 conda-forge
contourpy 1.1.0 py310h38f39d4_0 conda-forge
cycler 0.11.0 pyhd8ed1ab_0 conda-forge
darkdetect 0.8.0 pyhd8ed1ab_0 conda-forge
dav1d 1.2.1 hb547adb_0 conda-forge
debugpy 1.6.7 py310h0f1eb42_0 conda-forge
decorator 5.1.1 pyhd8ed1ab_0 conda-forge
defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge
deprecated 1.2.14 pyh1a96a4e_0 conda-forge
dipy 1.7.0 py310ha11ecec_0 conda-forge
double-conversion 3.3.0 h13dd4ca_0 conda-forge
edflib-python 1.0.7 pyhd8ed1ab_0 conda-forge
eeglabio 0.0.2.post4 pyhd8ed1ab_0 conda-forge
eigen 3.4.0 hc021e02_0 conda-forge
entrypoints 0.4 pyhd8ed1ab_0 conda-forge
exceptiongroup 1.1.2 pyhd8ed1ab_0 conda-forge
executing 1.2.0 pyhd8ed1ab_0 conda-forge
expat 2.5.0 hb7217d7_1 conda-forge
ffmpeg 5.1.2 gpl_he347a24_111 conda-forge
flit-core 3.9.0 pyhd8ed1ab_0 conda-forge
font-ttf-dejavu-sans-mono 2.37 hab24e00_0 conda-forge
font-ttf-inconsolata 3.000 h77eed37_0 conda-forge
font-ttf-source-code-pro 2.038 h77eed37_0 conda-forge
font-ttf-ubuntu 0.83 hab24e00_0 conda-forge
fontconfig 2.14.2 h82840c6_0 conda-forge
fonts-conda-ecosystem 1 0 conda-forge
fonts-conda-forge 1 0 conda-forge
fonttools 4.41.0 py310h2aa6e3c_0 conda-forge
fqdn 1.5.1 pypi_0 pypi
freetype 2.12.1 hd633e50_1 conda-forge
fribidi 1.0.10 h27ca646_0 conda-forge
frozenlist 1.4.0 py310h2aa6e3c_0 conda-forge
future 0.18.3 pyhd8ed1ab_0 conda-forge
gettext 0.21.1 h0186832_0 conda-forge
giflib 5.2.1 h1a8c8d9_3 conda-forge
gl2ps 1.4.2 h17b34a0_0 conda-forge
glew 2.1.0 h9f76cd9_2 conda-forge
glib 2.76.4 ha614eb4_0 conda-forge
glib-tools 2.76.4 ha614eb4_0 conda-forge
gmp 6.2.1 h9f76cd9_0 conda-forge
gnutls 3.7.8 h9f1a10d_0 conda-forge
graphite2 1.3.13 h9f76cd9_1001 conda-forge
gst-plugins-base 1.22.4 h27255cc_1 conda-forge
gstreamer 1.22.4 h8c52bba_1 conda-forge
h5io 0.1.8 pyha21a80b_0 conda-forge
h5py 3.9.0 nompi_py310h7fd3376_101 conda-forge
harfbuzz 7.3.0 h46e5fef_0 conda-forge
hdf4 4.2.15 h8111dcc_6 conda-forge
hdf5 1.14.1 nompi_h3aba7b3_100 conda-forge
icu 72.1 he12128b_0 conda-forge
idna 3.4 pyhd8ed1ab_0 conda-forge
imagecodecs 2023.1.23 py310hcb660b6_2 conda-forge
imageio 2.31.1 pyh24c5eb1_0 conda-forge
imageio-ffmpeg 0.4.8 pyhd8ed1ab_0 conda-forge
importlib-metadata 6.8.0 pyha770c72_0 conda-forge
importlib_metadata 6.8.0 hd8ed1ab_0 conda-forge
importlib_resources 6.0.0 pyhd8ed1ab_1 conda-forge
ipycanvas 0.13.1 pyhd8ed1ab_0 conda-forge
ipyevents 2.0.1 pyhd8ed1ab_0 conda-forge
ipykernel 6.24.0 pyh5fb750a_0 conda-forge
ipympl 0.9.3 pypi_0 pypi
ipython 8.14.0 pypi_0 pypi
ipython_genutils 0.2.0 py_1 conda-forge
ipyvtklink 0.2.2 pyhd8ed1ab_0 conda-forge
ipywidgets 7.6.5 pyhd3eb1b0_1  
isoduration 20.11.0 pypi_0 pypi
jedi 0.18.2 pyhd8ed1ab_0 conda-forge
jinja2 3.1.2 pyhd8ed1ab_1 conda-forge
joblib 1.3.0 pyhd8ed1ab_1 conda-forge
jsoncpp 1.9.5 hc021e02_1 conda-forge
jsonpointer 2.4 pypi_0 pypi
jsonschema 4.18.3 pyhd8ed1ab_0 conda-forge
jsonschema-specifications 2023.6.1 pyhd8ed1ab_0 conda-forge
jupyter 1.0.0 py310hbe9552e_8 conda-forge
jupyter_client 8.3.0 pyhd8ed1ab_0 conda-forge
jupyter_console 6.6.3 pyhd8ed1ab_0 conda-forge
jupyter_core 5.3.1 py310hbe9552e_0 conda-forge
jupyter_events 0.6.3 pyhd8ed1ab_0 conda-forge
jupyter_server 2.7.0 pyhd8ed1ab_0 conda-forge
jupyter_server_terminals 0.4.4 pyhd8ed1ab_1 conda-forge
jupyterlab_pygments 0.2.2 pyhd8ed1ab_0 conda-forge
jupyterlab_widgets 3.0.8 pyhd8ed1ab_0 conda-forge
jxrlib 1.1 h27ca646_2 conda-forge
kiwisolver 1.4.4 py310h2887b22_1 conda-forge
krb5 1.20.1 h69eda48_0 conda-forge
lame 3.100 h1a8c8d9_1003 conda-forge
lazy_loader 0.2 pyhd8ed1ab_0 conda-forge
lcms2 2.15 hd835a16_1 conda-forge
lerc 4.0.0 h9a09cb3_0 conda-forge
libaec 1.0.6 hb7217d7_1 conda-forge
libass 0.17.1 h4da34ad_0 conda-forge
libavif 0.11.1 h9f83d30_2 conda-forge
libblas 3.9.0 17_osxarm64_openblas conda-forge
libbrotlicommon 1.0.9 h1a8c8d9_9 conda-forge
libbrotlidec 1.0.9 h1a8c8d9_9 conda-forge
libbrotlienc 1.0.9 h1a8c8d9_9 conda-forge
libcblas 3.9.0 17_osxarm64_openblas conda-forge
libclang 15.0.7 default_h5dc8d65_2 conda-forge
libclang13 15.0.7 default_hc7183e1_2 conda-forge
libcurl 8.1.2 h912dcd9_0 conda-forge
libcxx 16.0.6 h4653b0c_0 conda-forge
libdeflate 1.18 h1a8c8d9_0 conda-forge
libedit 3.1.20191231 hc8eb9b7_2 conda-forge
libev 4.33 h642e427_1 conda-forge
libexpat 2.5.0 hb7217d7_1 conda-forge
libffi 3.4.2 h3422bc3_5 conda-forge
libgfortran 5.0.0 12_2_0_hd922786_31 conda-forge
libgfortran5 12.2.0 h0eea778_31 conda-forge
libglib 2.76.4 h24e9cb9_0 conda-forge
libiconv 1.17 he4db4b2_0 conda-forge
libidn2 2.3.4 h1a8c8d9_0 conda-forge
libjpeg-turbo 2.1.5.1 h1a8c8d9_0 conda-forge
liblapack 3.9.0 17_osxarm64_openblas conda-forge
libllvm14 14.0.6 hd1a9a77_3 conda-forge
libllvm15 15.0.7 h504e6bf_2 conda-forge
libmatio 1.5.23 hc41f82a_3 conda-forge
libnetcdf 4.9.2 nompi_h9fa6108_109 conda-forge
libnghttp2 1.52.0 hae82a92_0 conda-forge
libogg 1.3.4 h27ca646_1 conda-forge
libopenblas 0.3.23 openmp_hc731615_0 conda-forge
libopus 1.3.1 h27ca646_1 conda-forge
libpng 1.6.39 h76d750c_0 conda-forge
libpq 15.3 h7126958_1 conda-forge
libsodium 1.0.18 h27ca646_1 conda-forge
libsqlite 3.42.0 hb31c410_0 conda-forge
libssh2 1.11.0 h7a5bd25_0 conda-forge
libtasn1 4.19.0 h1a8c8d9_0 conda-forge
libtheora 1.1.1 h3422bc3_1005 conda-forge
libtiff 4.5.1 h23a1a89_0 conda-forge
libunistring 0.9.10 h3422bc3_0 conda-forge
libvorbis 1.3.7 h9f76cd9_0 conda-forge
libvpx 1.13.0 h7ea286d_0 conda-forge
libwebp-base 1.3.1 hb547adb_0 conda-forge
libxcb 1.15 hf346824_0 conda-forge
libxml2 2.11.4 he3bdae6_0 conda-forge
libxslt 1.1.37 h1728932_1 conda-forge
libzip 1.9.2 h76ab92c_1 conda-forge
libzlib 1.2.13 h53f4e23_5 conda-forge
libzopfli 1.0.3 h9f76cd9_0 conda-forge
llvm-openmp 16.0.6 h1c12783_0 conda-forge
llvmlite 0.40.1 py310h95b248a_0 conda-forge
loguru 0.7.0 py310hbe9552e_0 conda-forge
lxml 4.9.3 py310h78afa71_0 conda-forge
lz4-c 1.9.4 hb7217d7_0 conda-forge
markupsafe 2.1.3 py310h2aa6e3c_0 conda-forge
matplotlib 3.7.2 py310hb6292c7_0 conda-forge
matplotlib-base 3.7.2 py310h49faba3_0 conda-forge
matplotlib-inline 0.1.6 pyhd8ed1ab_0 conda-forge
mffpy 0.8.0 pyhd8ed1ab_0 conda-forge
mistune 3.0.0 pyhd8ed1ab_0 conda-forge
mne 1.4.2 hce30654_0 conda-forge
mne-base 1.4.2 pyh57928b3_0 conda-forge
mne-qt-browser 0.5.1 pyha770c72_0 conda-forge
multidict 6.0.4 py310h8e9501a_0 conda-forge
munkres 1.1.4 pyh9f0ad1d_0 conda-forge
mysql-common 8.0.33 h7b5afe1_2 conda-forge
mysql-libs 8.0.33 hb292caa_2 conda-forge
nbclassic 1.0.0 pyhb4ecaf3_1 conda-forge
nbclient 0.8.0 pyhd8ed1ab_0 conda-forge
nbconvert 7.7.1 pyhd8ed1ab_0 conda-forge
nbconvert-core 7.7.1 pyhd8ed1ab_0 conda-forge
nbconvert-pandoc 7.7.1 pyhd8ed1ab_0 conda-forge
nbformat 5.9.1 pyhd8ed1ab_0 conda-forge
ncurses 6.4 h7ea286d_0 conda-forge
nest-asyncio 1.5.6 pyhd8ed1ab_0 conda-forge
nettle 3.8.1 h63371fa_1 conda-forge
networkx 3.1 pyhd8ed1ab_0 conda-forge
nibabel 5.1.0 py310hbe9552e_2 conda-forge
nilearn 0.10.1 pyhd8ed1ab_0 conda-forge
nlohmann_json 3.11.2 h2e04ded_0 conda-forge
notebook 6.5.4 pyha770c72_0 conda-forge
notebook-shim 0.2.3 pyhd8ed1ab_0 conda-forge
nspr 4.35 hb7217d7_0 conda-forge
nss 3.89 h789eff7_0 conda-forge
numba 0.57.1 py310hb9b3264_0 conda-forge
numexpr 2.8.4 py310h2b830bf_0 conda-forge
numpy 1.24.4 py310haa1e00c_0 conda-forge
openh264 2.3.1 hb7217d7_2 conda-forge
openjpeg 2.5.0 hbc2ba62_2 conda-forge
openmeeg 2.5.6 py310h2d2325a_1 conda-forge
openssl 3.1.1 h53f4e23_1 conda-forge
overrides 7.3.1 pyhd8ed1ab_0 conda-forge
p11-kit 0.24.1 h29577a5_0 conda-forge
packaging 23.1 pyhd8ed1ab_0 conda-forge
pandas 2.0.3 py310h1cdf563_1 conda-forge
pandoc 3.1.3 hce30654_0 conda-forge
pandocfilters 1.5.0 pyhd8ed1ab_0 conda-forge
parso 0.8.3 pyhd8ed1ab_0 conda-forge
patsy 0.5.3 pyhd8ed1ab_0 conda-forge
pcre2 10.40 hb34f9b4_0 conda-forge
pexpect 4.8.0 pyh1a96a4e_2 conda-forge
pickleshare 0.7.5 py_1003 conda-forge
pillow 10.0.0 py310h60ecbdf_0 conda-forge
pip 23.2 pyhd8ed1ab_0 conda-forge
pixman 0.40.0 h27ca646_0 conda-forge
pkgutil-resolve-name 1.3.10 pyhd8ed1ab_0 conda-forge
platformdirs 3.9.1 pyhd8ed1ab_0 conda-forge
ply 3.11 py_1 conda-forge
pooch 1.7.0 pyha770c72_3 conda-forge
proj 9.2.1 h8fdea58_0 conda-forge
prometheus_client 0.17.1 pyhd8ed1ab_0 conda-forge
prompt-toolkit 3.0.39 pyha770c72_0 conda-forge
prompt_toolkit 3.0.39 hd8ed1ab_0 conda-forge
psutil 5.9.5 py310h8e9501a_0 conda-forge
pthread-stubs 0.4 h27ca646_1001 conda-forge
ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge
pugixml 1.13 h13dd4ca_1 conda-forge
pure_eval 0.2.2 pyhd8ed1ab_0 conda-forge
py-cpuinfo 9.0.0 pyhd8ed1ab_0 conda-forge
pycparser 2.21 pyhd8ed1ab_0 conda-forge
pygments 2.15.1 pyhd8ed1ab_0 conda-forge
pymatreader 0.0.32 pyhd8ed1ab_0 conda-forge
pyobjc-core 9.2 py310hd07e440_0 conda-forge
pyobjc-framework-cocoa 9.2 py310hd07e440_0 conda-forge
pyopengl 3.1.6 pyhd8ed1ab_1 conda-forge
pyparsing 3.0.9 pyhd8ed1ab_0 conda-forge
pyqt 5.15.7 py310h7aaa74b_3 conda-forge
pyqt5-sip 12.11.0 py310h0f1eb42_3 conda-forge
pyqtgraph 0.13.3 pyhd8ed1ab_0 conda-forge
pysocks 1.7.1 pyha2e5f31_6 conda-forge
pytables 3.8.0 py310hc9e091c_2 conda-forge
python 3.10.12 h01493a6_0_cpython conda-forge
python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge
python-fastjsonschema 2.17.1 pyhd8ed1ab_0 conda-forge
python-json-logger 2.0.7 pyhd8ed1ab_0 conda-forge
python-picard 0.7 pyh8a188c0_0 conda-forge
python-tzdata 2023.3 pyhd8ed1ab_0 conda-forge
python_abi 3.10 3_cp310 conda-forge
pytz 2023.3 pyhd8ed1ab_0 conda-forge
pyvista 0.40.1 pyhd8ed1ab_0 conda-forge
pyvistaqt 0.11.0 pyhd8ed1ab_0 conda-forge
pywavelets 1.4.1 py310hf1a086a_0 conda-forge
pyyaml 6.0 py310h8e9501a_5 conda-forge
pyzmq 25.1.0 py310h30b7201_0 conda-forge
qdarkstyle 3.1 pyhd8ed1ab_0 conda-forge
qt-main 5.15.8 hcac2fde_14 conda-forge
qtpy 2.3.1 pyhd8ed1ab_0 conda-forge
readline 8.2 h92ec313_1 conda-forge
referencing 0.29.1 pyhd8ed1ab_0 conda-forge
requests 2.31.0 pyhd8ed1ab_0 conda-forge
rfc3339-validator 0.1.4 pyhd8ed1ab_0 conda-forge
rfc3986-validator 0.1.1 pyh9f0ad1d_0 conda-forge
rpds-py 0.8.11 py310had9acf8_0 conda-forge
scikit-image 0.21.0 py310h1253130_0 conda-forge
scikit-learn 1.3.0 py310h02d4e2a_0 conda-forge
scipy 1.11.1 py310h0975f3d_0 conda-forge
scooby 0.7.2 pyhd8ed1ab_0 conda-forge
seaborn 0.12.2 hd8ed1ab_0 conda-forge
seaborn-base 0.12.2 pyhd8ed1ab_0 conda-forge
send2trash 1.8.2 pyhd1c38e8_0 conda-forge
setuptools 68.0.0 pyhd8ed1ab_0 conda-forge
sip 6.7.9 py310h1253130_0 conda-forge
six 1.16.0 pyh6c4a22f_0 conda-forge
snappy 1.1.10 h17c5cce_0 conda-forge
sniffio 1.3.0 pyhd8ed1ab_0 conda-forge
soupsieve 2.3.2.post1 pyhd8ed1ab_0 conda-forge
sqlite 3.42.0 h203b68d_0 conda-forge
stack_data 0.6.2 pyhd8ed1ab_0 conda-forge
statsmodels 0.14.0 py310ha11ecec_1 conda-forge
svt-av1 1.4.1 h7ea286d_0 conda-forge
tbb 2021.9.0 hffc8910_0 conda-forge
tbb-devel 2021.9.0 h4f9cb39_0 conda-forge
terminado 0.17.1 pyhd1c38e8_0 conda-forge
threadpoolctl 3.2.0 pyha21a80b_0 conda-forge
tifffile 2023.7.10 pyhd8ed1ab_0 conda-forge
tinycss2 1.2.1 pyhd8ed1ab_0 conda-forge
tk 8.6.12 he1e0b03_0 conda-forge
toml 0.10.2 pyhd8ed1ab_0 conda-forge
tomli 2.0.1 pyhd8ed1ab_0 conda-forge
tornado 6.3.2 py310h2aa6e3c_0 conda-forge
tqdm 4.65.0 pyhd8ed1ab_1 conda-forge
traitlets 5.9.0 pyhd8ed1ab_0 conda-forge
typing-extensions 4.7.1 hd8ed1ab_0 conda-forge
typing_extensions 4.7.1 pyha770c72_0 conda-forge
typing_utils 0.1.0 pyhd8ed1ab_0 conda-forge
tzdata 2023c h71feb2d_0 conda-forge
unicodedata2 15.0.0 py310h8e9501a_0 conda-forge
uri-template 1.3.0 pypi_0 pypi
urllib3 2.0.3 pyhd8ed1ab_1 conda-forge
utfcpp 3.2.3 hce30654_0 conda-forge
vtk 9.2.6 qt_py310h1234567_208 conda-forge
vtk-base 9.2.6 qt_py310h1234567_208 conda-forge
vtk-io-ffmpeg 9.2.6 qt_py310h1234567_208 conda-forge
wcwidth 0.2.6 pyhd8ed1ab_0 conda-forge
webcolors 1.13 pypi_0 pypi
webencodings 0.5.1 py_1 conda-forge
websocket-client 1.6.1 pyhd8ed1ab_0 conda-forge
wheel 0.40.0 pyhd8ed1ab_1 conda-forge
widgetsnbextension 3.5.2 py310hca03da5_0  
wrapt 1.15.0 py310h8e9501a_0 conda-forge
wslink 1.11.1 pyhd8ed1ab_0 conda-forge
x264 1!164.3095 h57fd34a_2 conda-forge
x265 3.5 hbc6ce65_3 conda-forge
xlrd 2.0.1 pyhd8ed1ab_3 conda-forge
xmltodict 0.13.0 pyhd8ed1ab_0 conda-forge
xorg-libxau 1.0.11 hb547adb_0 conda-forge
xorg-libxdmcp 1.1.3 h27ca646_0 conda-forge
xz 5.2.6 h57fd34a_0 conda-forge
yaml 0.2.5 h3422bc3_2 conda-forge
yarl 1.9.2 py310h2aa6e3c_0 conda-forge
zeromq 4.3.4 hbdafb3b_1 conda-forge
zfp 1.0.0 hb6e4faa_3 conda-forge
zipp 3.16.2 pyhd8ed1ab_0 conda-forge
zlib 1.2.13 h53f4e23_5 conda-forge
zlib-ng 2.0.7 h1a8c8d9_0 conda-forge
zstd 1.5.2 h4f39d0f_7 conda-forge

```

Is it currently possible to plot power spectra with the current version of MNE or would I have to install an earlier version? I tried to update some dependencies as suggested above using `pip install --upgrade ipython ipykernel ipympl matplotlib`, but still get the same error.

Thanks so much for your help,  
Dani

---

<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:** [July 18, 2023, 3:55pm UTC](https://mne.discourse.group/t/mne-viz-plot-raw-psd-raw-not-work/7213/15 "2023-07-18T15:55:49Z")

</div>

@DaniG downgrade matplotlib from 3.7.2 to 3.7.1. This is not an MNE-Python bug. see [Jupyter yields: 'NoneType' object has no attribute '\_get\_renderer' · Issue #11799 · mne-tools/mne-python · GitHub](https://github.com/mne-tools/mne-python/issues/11799)

---

<div class="post-metadata">

**Author:** ![DaniG](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/danig/32/2809_2.png) [@DaniG](https://mne.discourse.group/u/DaniG)\
**Post date:** [July 18, 2023, 4:54pm UTC](https://mne.discourse.group/t/mne-viz-plot-raw-psd-raw-not-work/7213/16 "2023-07-18T16:54:31Z")

</div>

Amazing - that worked! Thanks a lot 🙂
