Closed
Description
the following does not work:
import matplotlib.pyplot as plt
ls = (0,(2,2))
plt.plot()
line = plt.axvline(1,linestyle=ls)
however:
line.set_linestyle(ls)
produces the expected result. both axhline
and axvline
are affected, axhspan
and axvspan
not.
matplotlib '1.5.1' installed through Anaconda on Ubuntu 15.10.
Traceback:
Traceback (most recent call last):
File "/home/georg/python/linestyle_bug.py", line 13, in <module>
line = plt.axhline(0,1,linestyle=ls)
File "/home/georg/anaconda2/lib/python2.7/site-packages/matplotlib/pyplot.py", line 2574, in axhline
ret = ax.axhline(y=y, xmin=xmin, xmax=xmax, **kwargs)
File "/home/georg/anaconda2/lib/python2.7/site-packages/matplotlib/axes/_axes.py", line 749, in axhline
l = mlines.Line2D([xmin, xmax], [y, y], transform=trans, **kwargs)
File "/home/georg/anaconda2/lib/python2.7/site-packages/matplotlib/lines.py", line 332, in __init__
self.set_linestyle(linestyle)
File "/home/georg/anaconda2/lib/python2.7/site-packages/matplotlib/lines.py", line 1029, in set_linestyle
self.set_dashes(ls[1])
File "/home/georg/anaconda2/lib/python2.7/site-packages/matplotlib/lines.py", line 1165, in set_dashes
if self._dashSeq != seq:
AttributeError: 'Line2D' object has no attribute '_dashSeq'
Metadata
Metadata
Assignees
Labels
No labels