amueller / word_cloud

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

Using `--colormap` has no effect #649

Open DannyBen opened 3 years ago

DannyBen commented 3 years ago

Description

Using --colormap NAME from the CLI, with any of the supported colormap names does not seem to have any impact on the result.

Steps/Code to Reproduce

All these CLI calls produce the same result:

wordcloud_cli \
  --text tmp/debug.txt --random_state 1 \
  --imagefile 1.png --colormap Greens

wordcloud_cli \
  --text tmp/debug.txt --random_state 1 \
  --imagefile 2.png --colormap hot

wordcloud_cli \
  --text tmp/debug.txt --random_state 1 \
  --imagefile 3.png --colormap binary

Expected Results

Expected to see different colors.

Actual Results

All calls use the same default colormap.

1

Versions

Linux-5.4.0-86-generic-x86_64-with-glibc2.29 Python 3.8.10 (default, Jun 2 2021, 10:49:15) [GCC 9.4.0] NumPy 1.21.2 matplotlib 3.4.3 wordcoud 1.8.1

amueller commented 2 years ago

Sorry I thought I had commented on this already. This should be fairly straight-forward to fix, do you want to give it a go? Unfortunately the CLI is not as well tested as the python interface.

xeruf commented 2 years ago

I tried it, but have little experience with OO-python and could not comprehend it properly. I could not find any obvious oversight anyways.