-
Notifications
You must be signed in to change notification settings - Fork 98
Closed
Labels
Milestone
Description
Description
Since cycle supports cmaps, the input of cmap name in the configuration should be supported.
Steps to reproduce
import proplot as plot
import numpy as np
fig, axs = plot.subplots()
state = np.random.RandomState(51423)
data = (20 * state.rand(10, 21) - 10).cumsum(axis=0)
plot.rc.update({'cycle': 'plum', 'lines.linewidth': '5'})
lines = axs.plot(data[:, :5])Expected behavior:
Like:
plot.rc.update({'lines.linewidth': '5'})
lines = axs.plot(data[:, :5], cycle='plum')
Actual behavior: [What actually happened]
Traceback (most recent call last):
File "/home/xin/Desktop/test.py", line 11, in <module>
plot.rc.update({'cycle': 'plum', 'lines.linewidth': '5'})
File "/home/xin/Documents/Github/proplot/proplot/config.py", line 906, in update
self.__setitem__(prefix + key, value)
File "/home/xin/Documents/Github/proplot/proplot/config.py", line 410, in __setitem__
kw_quick, kw_added, kw_params = self._get_param_dicts(key, value)
File "/home/xin/Documents/Github/proplot/proplot/config.py", line 490, in _get_param_dicts
colors = _get_cycle_colors(value)
File "/home/xin/Documents/Github/proplot/proplot/config.py", line 1020, in _get_cycle_colors
+ ', '.join(map(repr, cycles)) + '.'
ValueError: Invalid cycle name 'plum'. Options are: '538', 'accent', 'classic', 'colorblind', 'colorblind10', 'dark2', 'default', 'flatui', 'ggplot', 'paired', 'pastel1', 'pastel2', 'qual1', 'qual2', 'set1', 'set2', 'set3', 'tab10', 'tab20', 'tab20b', 'tab20c'.
