You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've (partially?) fixed the cmap_d deprecation and removal using the suggestion to use matplotlib.colormaps instead, but there's a probably-related issue that I haven't figured out how to solve, namely certain types of plots (I've tried ax.plot() which doesn't have this problem and ax.fill_between() which does) raise the following exception:
Traceback (most recent call last):
File "fillbetween-example.py", line 4, in <module>
ax.fill_between([0, 1], [0, 0], [1, 1])
File "/usr/lib/python3.10/site-packages/proplot/internals/inputs.py", line 292, in _preprocess_or_redirect
return func(self, *args, **kwargs) # call unbound method
File "/usr/lib/python3.10/site-packages/proplot/axes/plot.py", line 3337, in fill_between
return self._apply_fill(*args, **kwargs)
File "/usr/lib/python3.10/site-packages/proplot/axes/plot.py", line 3297, in _apply_fill
obj = self._call_native(name, x, y1, y2, where=w, **kw)
File "/usr/lib/python3.10/site-packages/proplot/axes/plot.py", line 1293, in _call_native
obj = getattr(super(), name)(*args, **kwargs)
File "/usr/lib/python3.10/site-packages/matplotlib/__init__.py", line 1423, in inner
return func(ax, *map(sanitize_sequence, args), **kwargs)
File "/usr/lib/python3.10/site-packages/matplotlib/axes/_axes.py", line 5367, in fill_between
return self._fill_between_x_or_y(
File "/usr/lib/python3.10/site-packages/matplotlib/axes/_axes.py", line 5353, in _fill_between_x_or_y
collection = mcoll.PolyCollection(polys, **kwargs)
File "/usr/lib/python3.10/site-packages/matplotlib/_api/deprecation.py", line 454, in wrapper
return func(*args, **kwargs)
File "/usr/lib/python3.10/site-packages/matplotlib/collections.py", line 1174, in __init__
super().__init__(**kwargs)
File "/usr/lib/python3.10/site-packages/matplotlib/_api/deprecation.py", line 454, in wrapper
return func(*args, **kwargs)
File "/usr/lib/python3.10/site-packages/matplotlib/collections.py", line 158, in __init__
cm.ScalarMappable.__init__(self, norm, cmap)
File "/usr/lib/python3.10/site-packages/matplotlib/cm.py", line 415, in __init__
self.set_cmap(cmap) # The Colormap instance of this ScalarMappable.
File "/usr/lib/python3.10/site-packages/matplotlib/cm.py", line 603, in set_cmap
self.cmap = _ensure_cmap(cmap)
File "/usr/lib/python3.10/site-packages/matplotlib/cm.py", line 741, in _ensure_cmap
_api.check_in_list(sorted(_colormaps), cmap=cmap_name)
File "/usr/lib/python3.10/site-packages/matplotlib/_api/__init__.py", line 131, in check_in_list
raise ValueError(msg)
ValueError: 'Fire' is not a valid value for cmap; supported values are 'Accent', 'Accent_r', 'Blues', 'Blues_r', 'BrBG', 'BrBG_r', 'BuGn', 'BuGn_r', 'BuPu', 'BuPu_r', 'CMRmap', 'CMRmap_r', 'Dark2', 'Dark2_r', 'GnBu', 'GnBu_r', 'Greens', 'Greens_r', 'Greys', 'Greys_r', 'OrRd', 'OrRd_r', 'Oranges', 'Oranges_r', 'PRGn', 'PRGn_r', 'Paired', 'Paired_r', 'Pastel1', 'Pastel1_r', 'Pastel2', 'Pastel2_r', 'PiYG', 'PiYG_r', 'PuBu', 'PuBuGn', 'PuBuGn_r', 'PuBu_r', 'PuOr', 'PuOr_r', 'PuRd', 'PuRd_r', 'Purples', 'Purples_r', 'RdBu', 'RdBu_r', 'RdGy', 'RdGy_r', 'RdPu', 'RdPu_r', 'RdYlBu', 'RdYlBu_r', 'RdYlGn', 'RdYlGn_r', 'Reds', 'Reds_r', 'Set1', 'Set1_r', 'Set2', 'Set2_r', 'Set3', 'Set3_r', 'Spectral', 'Spectral_r', 'Wistia', 'Wistia_r', 'YlGn', 'YlGnBu', 'YlGnBu_r', 'YlGn_r', 'YlOrBr', 'YlOrBr_r', 'YlOrRd', 'YlOrRd_r', 'afmhot', 'afmhot_r', 'autumn', 'autumn_r', 'binary', 'binary_r', 'bone', 'bone_r', 'brg', 'brg_r', 'bwr', 'bwr_r', 'cividis', 'cividis_r', 'cool', 'cool_r', 'coolwarm', 'coolwarm_r', 'copper', 'copper_r', 'cubehelix', 'cubehelix_r', 'flag', 'flag_r', 'gist_earth', 'gist_earth_r', 'gist_gray', 'gist_gray_r', 'gist_heat', 'gist_heat_r', 'gist_ncar', 'gist_ncar_r', 'gist_rainbow', 'gist_rainbow_r', 'gist_stern', 'gist_stern_r', 'gist_yarg', 'gist_yarg_r', 'gnuplot', 'gnuplot2', 'gnuplot2_r', 'gnuplot_r', 'gray', 'gray_r', 'hot', 'hot_r', 'hsv', 'hsv_r', 'inferno', 'inferno_r', 'jet', 'jet_r', 'magma', 'magma_r', 'nipy_spectral', 'nipy_spectral_r', 'ocean', 'ocean_r', 'pink', 'pink_r', 'plasma', 'plasma_r', 'prism', 'prism_r', 'rainbow', 'rainbow_r', 'seismic', 'seismic_r', 'spring', 'spring_r', 'summer', 'summer_r', 'tab10', 'tab10_r', 'tab20', 'tab20_r', 'tab20b', 'tab20b_r', 'tab20c', 'tab20c_r', 'terrain', 'terrain_r', 'turbo', 'turbo_r', 'twilight', 'twilight_r', 'twilight_shifted', 'twilight_shifted_r', 'viridis', 'viridis_r', 'winter', 'winter_r'
Hi, will there be a permanent solution to this? Some time ago using the dev version seemed to work (still raising some deprecation warnings every time the code is run) but now it just doesn't work. I've tried reinstalling proplot and proplot-dev but still get the same error. I've had to remove the proplot dependency from many scripts now but I would rather not have to since it makes plotting so much easier.
@dforero0896 I took a stab at it in #433.
Plotting seems to work again. There are no proper unittests however so I can't be sure the entire codebase works with mpl v3.8. Give it a shot if you want!
Hi, thanks for you comment. I've tried !pip install git+https://github.com/cvanelteren/proplot.git --user but I keep getting the same error. It seems the requirement is still mpl < 3.6.0 so it downgrades.
@dforero0896 You need to pull from the changed branched. The command you outlined pulls from the main branch that does not have the changes. Run:
!pip install git+https://github.com/cvanelteren/proplot.git@mpl3.8 --user
from jupyter or without the ! from a terminal. Note that this does not upgrade matplotlib automatically as the code should be backwards compatible, but atleast I won't pull your mpl version down. You can upgrade mpl either before or after.
Activity
zxdawn commentedon Sep 21, 2022
Could you try the newest version of proplot?
cvanelteren commentedon Sep 21, 2022
@zxdawn works for me
swamidass commentedon Sep 24, 2022
That worked. Perhaps push a release to pypi?
ForceBru commentedon Oct 21, 2022
This downgraded Matplotlib from 3.6.1 to 3.5.3 for me...
knaaptime commentedon Nov 8, 2022
same. Looking closer, the requirements.txt file only lists matplotlib>3.0, but this line still enforces <3.6
knaaptime commentedon Nov 8, 2022
(if i try to use proplot anyway in an environment with mpl 3.6.2 i get
AttributeError: module 'matplotlib.cm' has no attribute 'cmap_d')zxdawn commentedon Nov 8, 2022
@knaaptime Yes, that's caused by matplotlib/matplotlib#22298.
knaaptime commentedon Nov 10, 2022
yup, just wanted to make sure you're aware since you asked for beta testers of the current dev install :)
Fix deprecated reference to mcm.cmap_d.
Z2h-A6n commentedon Nov 23, 2022
I've started working on this in a fork: https://github.com/Z2h-A6n/proplot
I've (partially?) fixed the
cmap_ddeprecation and removal using the suggestion to usematplotlib.colormapsinstead, but there's a probably-related issue that I haven't figured out how to solve, namely certain types of plots (I've triedax.plot()which doesn't have this problem andax.fill_between()which does) raise the following exception:dforero0896 commentedon Jul 25, 2023
Hi, will there be a permanent solution to this? Some time ago using the dev version seemed to work (still raising some deprecation warnings every time the code is run) but now it just doesn't work. I've tried reinstalling proplot and proplot-dev but still get the same error. I've had to remove the proplot dependency from many scripts now but I would rather not have to since it makes plotting so much easier.
Thanks in advance for any help/info.
cvanelteren commentedon Jul 29, 2023
@dforero0896 I took a stab at it in #433.
Plotting seems to work again. There are no proper unittests however so I can't be sure the entire codebase works with mpl v3.8. Give it a shot if you want!
dforero0896 commentedon Aug 1, 2023
Hi, thanks for you comment. I've tried
!pip install git+https://github.com/cvanelteren/proplot.git --userbut I keep getting the same error. It seems the requirement is still mpl < 3.6.0 so it downgrades.cvanelteren commentedon Aug 2, 2023
@dforero0896 You need to pull from the changed branched. The command you outlined pulls from the main branch that does not have the changes. Run:
!pip install git+https://github.com/cvanelteren/proplot.git@mpl3.8 --userfrom jupyter or without the ! from a terminal. Note that this does not upgrade matplotlib automatically as the code should be backwards compatible, but atleast I won't pull your mpl version down. You can upgrade mpl either before or after.
dforero0896 commentedon Aug 2, 2023
Right! I didn't notice. Thanks! I just tested it and it works like a charm so far. I'll update if I find something.