Reputation: 25023
In my preamble I have
import numpy as np
import numpy as np
import matplotlib.pyplot as plt
from cycler import cycler
plt.style.use([
'seaborn-paper', {'axes.prop_cycle': (
cycler('color', ['k'])*
cycler('lw', [2,1])*
cycler('dashes', [[],[13,2],[8,3,1,3]]))}])
When I later use plt.plot()
using keyword arguments (or their equivalents),
e.g.,
a = np.array((0.,5.))
plt.plot(a,a, linewidth=6)
plt.plot(-a,a, '-')
I'm expecting a VERY wide 1st line and a continuous 2nd one, but this is what I get
What can I do if I want to
tia
Upvotes: 0
Views: 204
Reputation: 87376
The issue as that the aliases for linewidth are not being properly de-aliased (so both linewidth
and lw
are being used to set the width and conflicting). A similar thing is happening with the style string vs linestyle vs dashes.
import numpy as np
import numpy as np
import matplotlib.pyplot as plt
from cycler import cycler
plt.style.use([
'seaborn-paper', {'axes.prop_cycle': (
cycler('color', ['k'])*
cycler('linewidth', [2,1])*
cycler('dashes', [[],[13,2],[8,3,1,3]]))}])
a = np.array((0.,5.))
plt.plot(a,a, linewidth=6)
plt.plot(-a,a, dashes=[])
should work.
The first issue (the lw aliasing) is fixed in 2.x, but even using dashes is the cycle is now broken :(
https://github.com/matplotlib/matplotlib/issues/7426
Upvotes: 1