pymoo icon indicating copy to clipboard operation
pymoo copied to clipboard

Error with get_cmap using Scatter visualization function

Open lisasoubirou opened this issue 1 year ago • 2 comments

Hi, I was trying to plot some results with the Scatter visualization function, but I got the following error: 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)

lisasoubirou avatar Jun 07 '24 15:06 lisasoubirou

Please use matplotlib.colormaps.get_cmap() instead.

tacaswell avatar Jun 07 '24 18:06 tacaswell

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

blankjul avatar Jun 16 '24 16:06 blankjul