amueller / word_cloud

A little word cloud generator in Python
https://amueller.github.io/word_cloud
MIT License
10.01k stars 2.31k forks source link

MatplotlibDeprecationWarning: The get_cmap function was deprecated in Matplotlib 3.7 #737

Closed gabriel-enrique closed 7 months ago

gabriel-enrique commented 9 months ago

Description

Creating a wordcloud will give you this warning (wordcloud version: 1.9.2)

.../wordcloud/wordcloud.py:106: MatplotlibDeprecationWarning: The get_cmap function was deprecated in Matplotlib 3.7 and will be removed two minor releases later. Use ``matplotlib.colormaps[name]`` or ``matplotlib.colormaps.get_cmap(obj)`` instead.
  self.colormap = plt.cm.get_cmap(colormap)

Steps/Code to Reproduce

Code snippet that generates that warning:

from wordcloud import WordCloud
wordcloud = WordCloud(background_color="white", max_words=5000, contour_width=3, contour_color='steelblue')
wordcloud.generate(long_string)
gabriel-enrique commented 9 months ago

Duplicated (a duplicate of #736)

thomasjpfan commented 7 months ago

Thank you for opening the issue! matplotlib deprecated usage was removed in 1.9.3.