SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: Jason G. <jas...@cr...> - 2011年05月30日 20:16:41
In the docs for Line2D, it says that the linestyle can be "any drawstyle 
in combination with a linestyle, e.g. 'steps--'." However, this doesn't 
seem to work in practice. I believe I have matplotlib 1.0.1 here:
In [2]: from matplotlib import lines
In [3]: line=lines.Line2D([0,1,2],[0,1,4], linestyle='steps--')
In [4]: line.get_drawstyle()
Out[4]: 'default'
In [5]: line.get_linestyle()
Out[5]: '--'
Note that if I specifically set the linestyle using set_linestyle, it 
appears to parse out the drawstyle:
In [11]: line.set_linestyle('steps--')
In [12]: line.get_drawstyle()
Out[12]: 'steps'
However, if I plot the line using the plot() command, the drawstyle is 
correctly set to 'steps'.
In [6]: from matplotlib import pyplot
In [7]: line2=pyplot.plot([0,1,2],[0,1,4], linestyle='steps--')
In [8]: line2
Out[8]: [<matplotlib.lines.Line2D object at 0x114fcb110>]
In [9]: line2[0].get_drawstyle()
Out[9]: 'steps'
In [10]: line2[0].get_linestyle()
Out[10]: '--'
Should Line2D parse out the drawstyle from the linestyle, or are the 
docs wrong about the Line2D linestyle parameters, or am I just 
misunderstanding something here?
Thanks,
Jason
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /