# Matplotlib bottom cannot be \<= top

**URL:** <https://mne.discourse.group/t/matplotlib-bottom-cannot-be-top/3379>\
**Category:** Support & Discussions\
**Tags:** visualization\
**Created:** [July 9, 2021, 6:56pm UTC](https://mne.discourse.group/t/matplotlib-bottom-cannot-be-top/3379 "2021-07-09T18:56:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PaulF](https://avatars.discourse-cdn.com/v4/letter/p/eb9ed0/32.png) [@PaulF](https://mne.discourse.group/u/PaulF)\
**Post date:** [July 9, 2021, 6:56pm UTC](https://mne.discourse.group/t/matplotlib-bottom-cannot-be-top/3379/1 "2021-07-09T18:56:47Z")

</div>

> [@%matplotlib qt ,, ValueError: bottom cannot be \>= top](https://mne.discourse.group/t/matplotlib-qt-valueerror-bottom-cannot-be-top/2499/8):
>
> `print(mne.get_config_path())`

I just came across [this topic](https://mne.discourse.group/t/matplotlib-qt-valueerror-bottom-cannot-be-top/2499) and am encountering a similar, if not identical problem, which arose only yesterday and which I could not solve using the above. Running Mac (OS Big Sur 11.3.1) with Python 3.9.2, IDLE 3.9.2, matplotlib 3.4.2, and mne 0.23.0.

Here’s my code:

```python
import mne
raw=mne.io.read_raw_edf('file.edf', preload=True)
raw.plot()

```

Here’s my error message:

````python
   File "/Users/fishbacp/Desktop/my_script.py", line 22, in <module> raw.plot()
    File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site- 
   packages/mne/io/base.py", line 1531, in plot
    return plot_raw(self, events, duration, start, n_channels, bgcolor,
  File "<decorator-gen-161>", line 24, in plot_raw
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/mne/viz/raw.py", line 342, in plot_raw
    fig = _browse_figure(**params)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/mne/viz/_figure.py", line 2278, in _browse_figure
    fig = _figure(inst=inst, toolbar=False, FigureClass=MNEBrowseFigure,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/mne/viz/_figure.py", line 2266, in _figure
    fig = figure(FigureClass=FigureClass, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/matplotlib/pyplot.py", line 797, in figure
    manager = new_figure_manager(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/matplotlib/pyplot.py", line 316, in new_figure_manager
    return _backend_mod.new_figure_manager(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/matplotlib/backend_bases.py", line 3544, in new_figure_manager
    fig = fig_cls(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/mne/viz/_figure.py", line 401, in __init__
    self.subplotpars.update(left=left, bottom=bottom, top=top, right=right)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/matplotlib/figure.py", line 166, in update
    raise ValueError('bottom cannot be >= top')
ValueError: bottom cannot be >= top ```

````

I reinstalled matplotlib and mne and restarted my computer, but this doesn’t solve the problem. The data is loaded fine, as I can print out raw.info.

I entered `print(mne.get_config_path())` as suggested above. It shows

/Users/fishbacp/.mne/mne-python.json

I don’t see this file anywhere in my system. I install mne with all my other packages in

/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages

Thanks

Paul

---

<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 9, 2021, 7:42pm UTC](https://mne.discourse.group/t/matplotlib-bottom-cannot-be-top/3379/2 "2021-07-09T19:42:41Z")

</div>

the `get_config_path()` function doesn’t actually check whether a config file exists there, and indeed it may not exist unless you’ve called `mne.set_config(...)` at least once. Quite likely your problem is that it’s trying to plot a raw browser interface into a 640x480 window. I suggest running `mne.set_config('MNE_BROWSE_RAW_SIZE', '16,9', setenv=False)` and see if it works after that. Subsequently, the size of the browse window will be automatically stored in the config file, so matplotlib won’t attempt to open such a small window for raw data browsers any more.

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [July 9, 2021, 11:00pm UTC](https://mne.discourse.group/t/matplotlib-bottom-cannot-be-top/3379/3 "2021-07-09T23:00:08Z")

</div>

Hello,

> [@PaulF](#):
>
> I entered `print(mne.get_config_path())` as suggested above. It shows
> 
> /Users/fishbacp/.mne/mne-python.json
> 
> I don’t see this file anywhere in my system.

The Finder won’t show you this hidden folder by default. To navigate to the folder containing the file, in the Finder press `Cmd–Shift–G` and enter `~/.mne` in the dialog box.

> [@PaulF](#):
>
> I install mne with all my other packages in
> 
> /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages

If you follow our [official installation instructions](https://mne.tools/stable/install/mne_python.html), you should actually end up with a `conda` environment at a different location. Not saying that this is the cause of your issue, but we **do** observe that sometimes, problems arise if users install MNE-Python in a “non-standard” way (i.e., deviating from our installation instructions).

---

<div class="post-metadata">

**Author:** ![PaulF](https://avatars.discourse-cdn.com/v4/letter/p/eb9ed0/32.png) [@PaulF](https://mne.discourse.group/u/PaulF)\
**Post date:** [July 13, 2021, 12:50pm UTC](https://mne.discourse.group/t/matplotlib-bottom-cannot-be-top/3379/4 "2021-07-13T12:50:12Z")

</div>

Thanks. Was able to find the file and delete it.
