File "/home/.../site-packages/cma/logger.py", line 916, in plot_axes_scaling
color = iter(pyplot.cm.get_cmap('plasma_r')(
AttributeError: module 'matplotlib.cm' has no attribute 'get_cmap'
And checking matplotlib documentation, they did this change in their 3.9 update:
Checking your code, I see you call: pyplot.cm.get_cmap(...) at least 3 times in the file:
Problem:
Using:
cma==3.3.0
matplotlib==3.9.0
Got the error:
And checking
matplotlib
documentation, they did this change in their 3.9 update:Checking your code, I see you call:
pyplot.cm.get_cmap(...)
at least 3 times in the file:https://github.com/CMA-ES/pycma/blob/development/cma/logger.py
Solution for new version:
I guess you just need to change the call
pyplot.cm.get_cmap(...)
into:pyplot.get_cmap(...)
which will work both for older (
<3.9
) and newer (>=3.9
) versions!For
>=3.9
there is also these other options:matplotlib.colormaps[name]
matplotlib.cm.ColormapRegistry.get_cmap(...)
But of course, those would not suffice, since then they will not work for older versions (
<3.9
)...Found this commit useful: https://github.com/matplotlib/matplotlib/commit/ef6fa3da7e3a2d71b0bf241fc95152df971c64aa