Closed
Description
If the axes.prop_cycle
contains the label 'ls' it is not possible to manually specify a linestyle in a plot. However, if axes.prop_cycle
contains the label 'linestyle', everything seems to work as expected.
An example showing the problem:
from cycler import cycler
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
mpl.__version__ # ==1.5.1
linestyle_cycle = cycler('linestyle', ['-', '--'])
ls_cycle = cycler('ls', ['-', '--'])
x = np.arange(10)
mpl.rcParams['axes.prop_cycle'] = linestyle_cycle
plt.figure()
for k in range(1, 6):
plt.plot(x, k * x)
plt.plot(x, x**2, 'k:') # Black dotted as expected
plt.title('linestyle_cycle')
mpl.rcParams['axes.prop_cycle'] = ls_cycle
plt.figure()
for k in range(1, 6):
plt.plot(x, k * x)
plt.plot(x, x**2, 'k:') # Black dashed - not expected
plt.title('ls_cycle')
Metadata
Metadata
Assignees
Labels
No labels