proplot-dev / proplot

🎨 A succinct matplotlib wrapper for making beautiful, publication-quality graphics
https://proplot.readthedocs.io
MIT License
1.07k stars 96 forks source link

Fixed an incompatibility issue with higher versions of matplotlib(3.8.2) #446

Closed longtsing closed 5 months ago

longtsing commented 6 months ago

Referenced to previous commits that attempted to fix compatibility with higher versions of matplotlib.

On the premise of ensuring that matplotlib versions below 3.6 continue to run, we will do our best to achieve compatibility with higher versions of matplotlib (3.8.2).

The code is tested and runs normally under matplotlib 3.8.2 version (ubuntu).

By the way: Why can’t the checker pass after modifying setup.cfg?

chudlerk commented 6 months ago

I'm getting this error when I try to create a figure. Windows 10, matplotlib 3.8.0

>>> import proplot as pplt
>>> pplt.subplots()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\kchudler\AppData\Local\miniconda3\envs\test\Lib\site-packages\proplot\ui.py", line 231, in subplots
    fig = figure(rc_kw=rc_kw, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kchudler\AppData\Local\miniconda3\envs\test\Lib\site-packages\proplot\ui.py", line 144, in figure
    return plt.figure(FigureClass=pfigure.Figure, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kchudler\AppData\Local\miniconda3\envs\test\Lib\site-packages\matplotlib\pyplot.py", line 934, in figure
    manager = new_figure_manager(
              ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kchudler\AppData\Local\miniconda3\envs\test\Lib\site-packages\matplotlib\pyplot.py", line 465, in new_figure_manager
    return _get_backend_mod().new_figure_manager(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kchudler\AppData\Local\miniconda3\envs\test\Lib\site-packages\matplotlib\backend_bases.py", line 3396, in new_figure_manager
    return cls.new_figure_manager_given_figure(num, fig)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kchudler\AppData\Local\miniconda3\envs\test\Lib\site-packages\matplotlib\backend_bases.py", line 3401, in new_figure_manager_given_figure
    return cls.FigureCanvas.new_manager(figure, num)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kchudler\AppData\Local\miniconda3\envs\test\Lib\site-packages\matplotlib\backend_bases.py", line 1785, in new_manager
    return cls.manager_class.create_with_canvas(cls, figure, num)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kchudler\AppData\Local\miniconda3\envs\test\Lib\site-packages\matplotlib\backend_bases.py", line 2680, in create_with_canvas
    return cls(canvas_class(figure), num)
               ^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kchudler\AppData\Local\miniconda3\envs\test\Lib\site-packages\matplotlib\backends\backend_qt.py", line 197, in __init__
    super().__init__(figure=figure)
  File "C:\Users\kchudler\AppData\Local\miniconda3\envs\test\Lib\site-packages\matplotlib\backend_bases.py", line 1726, in __init__
    figure.set_canvas(self)
  File "C:\Users\kchudler\AppData\Local\miniconda3\envs\test\Lib\site-packages\proplot\figure.py", line 1766, in set_canvas
    method = '_draw' if callable(getattr(canvas, '_draw', None)) else 'draw'
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: super-class __init__() of type FigureCanvasQTAgg was never called
Mickychen00 commented 5 months ago

Will it be merged in a near future?