pymoo
pymoo copied to clipboard
Error with get_cmap using Scatter visualization function
Hi,
I was trying to plot some results with the Scatter visualization function, but I got the following error:
I found this "issue" Re-add matplotlib.cm.get_cmap from matplotlib: https://github.com/matplotlib/matplotlib/pull/28355
Replacing self.cmap = matplotlib.cm.get_cmap(cmap) by self.cmap = plt.get_cmap(cmap) in the Plot.init() function solved my problem. I just wanted to point out this issue with the latest version of matplotlib (3.9)
Please use matplotlib.colormaps.get_cmap() instead.
Does the current main branch work for you? There I have already merged a PR (Fixed the Plot Issue #593) where it is the following:
# the colormap or the color lists to use
if isinstance(cmap, str):
self.cmap = matplotlib.pyplot.get_cmap(cmap)
else:
self.cmap = cmap