Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'PsyplotCanvasManager' object has no attribute '_get_toolbar' #32

Open
dkobashi opened this issue Jun 16, 2023 · 2 comments · May be fixed by #33
Open

AttributeError: 'PsyplotCanvasManager' object has no attribute '_get_toolbar' #32

dkobashi opened this issue Jun 16, 2023 · 2 comments · May be fixed by #33
Assignees
Labels

Comments

@dkobashi
Copy link

Problem description

I tried to open ERA5 single level netcdf data to visualize on GUI; however, I had an error when I tried to plot a figure for a variable (e.g. u10).

Expected Output

When selecting a variable, psyplot should show the figure of the variable.

'PsyplotCanvasManager' object has no attribute '_get_toolbar' Traceback (most recent call last): File "C:\Users\d.kobashi\AppData\Local\miniconda3\envs\psyplot\lib\site-packages\psy_view\ds_widget.py", line 1055, in func self.make_plot() File "C:\Users\d.kobashi\AppData\Local\miniconda3\envs\psyplot\lib\site-packages\psy_view\ds_widget.py", line 1311, in make_plot self.sp = sp = self.plot(name=self.variable, **self.plot_options) File "C:\Users\d.kobashi\AppData\Local\miniconda3\envs\psyplot\lib\site-packages\psyplot\project.py", line 2180, in __call__ return super(DatasetPlotterInterface, self).__call__(*args, **kwargs) File "C:\Users\d.kobashi\AppData\Local\miniconda3\envs\psyplot\lib\site-packages\psyplot\project.py", line 1983, in __call__ return self._project_plotter._add_data( File "C:\Users\d.kobashi\AppData\Local\miniconda3\envs\psyplot\lib\site-packages\psyplot\project.py", line 2222, in _add_data return super(DatasetPlotter, self)._add_data(plotter_cls, self._ds, File "C:\Users\d.kobashi\AppData\Local\miniconda3\envs\psyplot\lib\site-packages\psyplot\project.py", line 1772, in _add_data return self.project._add_data(*args, **kwargs) File "C:\Users\d.kobashi\AppData\Local\miniconda3\envs\psyplot\lib\site-packages\psyplot\project.py", line 180, in wrapper return func(self, *args, **kwargs) File "C:\Users\d.kobashi\AppData\Local\miniconda3\envs\psyplot\lib\site-packages\psyplot\project.py", line 801, in _add_data plotter_cls(arr, make_plot=(not bool(share) and make_plot), File "C:\Users\d.kobashi\AppData\Local\miniconda3\envs\psyplot\lib\site-packages\psyplot\plotter.py", line 1260, in __init__ self.initialize_plot(data, ax=ax, draw=draw, clear=clear, File "C:\Users\d.kobashi\AppData\Local\miniconda3\envs\psyplot\lib\site-packages\psyplot\plotter.py", line 1418, in initialize_plot self._plot_by_priority(fmto_priority, grouper, File "C:\Users\d.kobashi\AppData\Local\miniconda3\envs\psyplot\lib\site-packages\psyplot\plotter.py", line 1622, in _plot_by_priority update(fmto) File "C:\Users\d.kobashi\AppData\Local\miniconda3\envs\psyplot\lib\site-packages\psyplot\plotter.py", line 1602, in update fmto.initialize_plot(fmto.value) File "C:\Users\d.kobashi\AppData\Local\miniconda3\envs\psyplot\lib\site-packages\psyplot\plotter.py", line 659, in initialize_plot self.update(value, *args, **kwargs) File "C:\Users\d.kobashi\AppData\Local\miniconda3\envs\psyplot\lib\site-packages\psy_maps\plotters.py", line 1085, in update proj = self.ax.projection File "C:\Users\d.kobashi\AppData\Local\miniconda3\envs\psyplot\lib\site-packages\psyplot\plotter.py", line 275, in ax return self.plotter.ax File "C:\Users\d.kobashi\AppData\Local\miniconda3\envs\psyplot\lib\site-packages\psy_maps\plotters.py", line 2099, in ax plt.figure() File "C:\Users\d.kobashi\AppData\Local\miniconda3\envs\psyplot\lib\site-packages\matplotlib\_api\deprecation.py", line 454, in wrapper return func(*args, **kwargs) File "C:\Users\d.kobashi\AppData\Local\miniconda3\envs\psyplot\lib\site-packages\matplotlib\pyplot.py", line 840, in figure manager = new_figure_manager( File "C:\Users\d.kobashi\AppData\Local\miniconda3\envs\psyplot\lib\site-packages\matplotlib\pyplot.py", line 384, in new_figure_manager return _get_backend_mod().new_figure_manager(*args, **kwargs) File "C:\Users\d.kobashi\AppData\Local\miniconda3\envs\psyplot\lib\site-packages\psyplot_gui\backend.py", line 74, in new_figure_manager return new_figure_manager_given_figure(num, thisFig) File "C:\Users\d.kobashi\AppData\Local\miniconda3\envs\psyplot\lib\site-packages\psyplot_gui\backend.py", line 82, in new_figure_manager_given_figure return PsyplotCanvasManager(canvas, num) File "C:\Users\d.kobashi\AppData\Local\miniconda3\envs\psyplot\lib\site-packages\psyplot_gui\backend.py", line 109, in __init__ self.toolbar = self._get_toolbar(canvas, parent_widget) AttributeError: 'PsyplotCanvasManager' object has no attribute '_get_toolbar'

Output of psyplot -aV

# Paste the output of the command ``psyplot -aV`` (ran from the command line) psy_maps.plugin: requirements: cartopy: 0.21.1 version: 1.4.2 psy_reg.plugin: requirements: scipy: 1.10.1 statsmodels: 0.14.0 version: 1.4.0 psy_simple.plugin: version: 1.4.1 psyplot: requirements: matplotlib: 3.7.1 numpy: 1.24.3 pandas: 2.0.2 python: 3.9.16 | packaged by conda-forge | (main, Feb 1 2023, 21:28:38) [MSC v.1929 64 bit (AMD64)] xarray: 2023.5.0 version: 1.4.3 psyplot_gui: requirements: pyqt: 5.15.7 qt: 5.15.6 qtconsole: 5.4.3 version: 1.4.0
@Chilipp
Copy link
Member

Chilipp commented Jun 16, 2023

thanks for reporting @dkobashi! I assume it's a compatibility issue with the latest version of matplotlib. psyplot-gui needs an update here. As an immediate workaround, use matplotlib<3.6, e.g. via conda install -c conda-forge 'matplotlib<3.6'

@Chilipp Chilipp self-assigned this Jun 16, 2023
@Chilipp Chilipp added the bug label Jun 16, 2023
@Chilipp
Copy link
Member

Chilipp commented Jun 16, 2023

as this is an issue for the psyplot-gui, I will transfer it to this repo

@Chilipp Chilipp transferred this issue from psyplot/psyplot Jun 16, 2023
@Chilipp Chilipp linked a pull request Jul 24, 2023 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants