-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Open
Labels
status: needs comment/discussionneeds consensus on next stepneeds consensus on next steptopic: color/cycle
Milestone
Description
Hi matplotlib developers,
I was surprised to discover that the cycler validation does not allow colors specified with 'CN'
syntax.
import numpy as np
import matplotlib.pyplot as plt
from cycler import cycler
fig, ax = plt.subplots()
ax.set_prop_cycle(cycler(color=['C1', 'C0'])) # raises ValueError
# ax.set_prop_cycle(cycler(color=['tab:orange', 'tab:blue'])) # works fine
ax.plot(np.arange(9))
ax.plot(-np.arange(9))
plt.show()
If matplotlib can differentiate between {'C0', 'C1', 'C2', 'C3', 'C4', 'C5', 'C6', 'C7', 'C8', 'C9'}
colors and {'b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'}
colors (case insensitive) anywhere else that a color is specified, then it seems to me that the cycler should be able to handle this as well. Thanks.
Tested with matplotlib 3.0.3 and python 3.7.3 (Anaconda) on Windows 10.
Metadata
Metadata
Assignees
Labels
status: needs comment/discussionneeds consensus on next stepneeds consensus on next steptopic: color/cycle