question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

raw browser size gets mess up and becomes too small for working

See original GitHub issue

Describe the bug

While trying to look into issue #9616, I ran into a problem with the sample dataset which could not be plotted using raw.plot(). This problem occurs on both the version 0.23 and on the latest commit version using the develop mode.

Steps to reproduce

import mne
from pathlib import Path

data_folder = Path(mne.datasets.sample.data_path())
raw_file = data_folder / 'MEG' / 'sample' / 'sample_audvis_filt-0-40_raw.fif'
raw = mne.io.read_raw_fif(raw_file)
raw.plot()

Actual results

Opening raw data file C:\Users\Mathieu\mne_data\MNE-sample-data\MEG\sample\sample_audvis_filt-0-40_raw.fif...
    Read a total of 4 projection items:
        PCA-v1 (1 x 102)  idle
        PCA-v2 (1 x 102)  idle
        PCA-v3 (1 x 102)  idle
        Average EEG reference (1 x 60)  idle
    Range : 6450 ... 48149 =     42.956 ...   320.665 secs
Ready.
Traceback (most recent call last):

  File "C:\Users\Mathieu\AppData\Local\Temp/ipykernel_20280/2983236992.py", line 9, in <module>
    raw.plot()

  File "c:\users\mathieu\documents\git\mne-python\mne\io\base.py", line 1520, in plot
    return plot_raw(self, events, duration, start, n_channels, bgcolor,

  File "<decorator-gen-165>", line 24, in plot_raw

  File "c:\users\mathieu\documents\git\mne-python\mne\viz\raw.py", line 350, in plot_raw
    fig = _browse_figure(**params)

  File "c:\users\mathieu\documents\git\mne-python\mne\viz\_figure.py", line 2353, in _browse_figure
    fig = _figure(inst=inst, toolbar=False, FigureClass=MNEBrowseFigure,

  File "c:\users\mathieu\documents\git\mne-python\mne\viz\_figure.py", line 2341, in _figure
    fig = figure(FigureClass=FigureClass, **kwargs)

  File "C:\Users\Mathieu\Documents\pyvenv\mne\lib\site-packages\matplotlib\pyplot.py", line 797, in figure
    manager = new_figure_manager(

  File "C:\Users\Mathieu\Documents\pyvenv\mne\lib\site-packages\matplotlib\pyplot.py", line 316, in new_figure_manager
    return _backend_mod.new_figure_manager(*args, **kwargs)

  File "C:\Users\Mathieu\Documents\pyvenv\mne\lib\site-packages\matplotlib\backend_bases.py", line 3544, in new_figure_manager
    fig = fig_cls(*args, **kwargs)

  File "c:\users\mathieu\documents\git\mne-python\mne\viz\_figure.py", line 410, in __init__
    self.subplotpars.update(left=left, bottom=bottom, top=top, right=right)

  File "C:\Users\Mathieu\Documents\pyvenv\mne\lib\site-packages\matplotlib\figure.py", line 166, in update
    raise ValueError('bottom cannot be >= top')

ValueError: bottom cannot be >= top

Additional information

Platform: Windows-10-10.0.19042-SP0 Python: 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)] Executable: C:\Users\Mathieu\Documents\pyvenv\mne\Scripts\python.exe CPU: AMD64 Family 25 Model 33 Stepping 0, AuthenticAMD: 12 cores Memory: 31.9 GB

mne: 0.24.dev0 numpy: 1.21.0 {blas=D:\a\1\s\numpy\build\openblas_info, lapack=D:\a\1\s\numpy\build\openblas_lapack_info} scipy: 1.7.0 matplotlib: 3.4.2 {backend=Qt5Agg}

sklearn: 0.24.2 numba: 0.53.1 nibabel: 3.2.1 nilearn: 0.8.0 dipy: 1.4.1 cupy: Not found pandas: 1.3.0 mayavi: 4.7.3 pyvista: 0.31.3 {pyvistaqt=0.5.0, OpenGL 4.5.0 NVIDIA 471.41 via NVIDIA GeForce RTX 3070/PCIe/SSE2} vtk: 9.0.1 PyQt5: 5.15.4

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
drammockcommented, Jul 30, 2021

There is no need to update the config because it will automatically be updated with the window dimensions when the plot is closed. All we need to do is make sure the window successfully opens

1reaction
cbrnrcommented, Jul 30, 2021

I’d prefer sanity checking and correcting the values in the config.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix a Little Screen on Chrome to Make It Bigger
Click the "Font Size" drop-down menu and choose a size from "Very Small" to "Very Large." Close the window to save your changes....
Read more >
Webpage gets messy when the browser changes size
This happens only when you re-size the browser horizontally. This is my CSS: http://pastebin.com/SfKT0Eth. I can't figure out my mistake since I ...
Read more >
Windows Photo Viewer is distorting my raw (CR2) photo files
When I first open it, it will look normal for about 2 seconds, and then once it fully loads, the photo gets distorted....
Read more >
Image component sizes property does not work #18413
Resize the browser window width to be smaller than 500px to see that the image will fit to 100% of the screen, not...
Read more >
WebGL Resizing the Canvas.
Why is it so blurry? Because the browser takes our 10x15 pixel canvas and stretches it to 400x300 pixels and generally it filters...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found