SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: Brent F. <bfi...@me...> - 2006年11月30日 06:25:19
Hi All
I am new to Matplotlib, and was wondering if anybody knew of an easy way to
construct a dropline from a data point in a plot to the x axis, i.e. a
vertical line from (x1,y1) to (x1,0)?
Regards
Brent Fillery
-- 
View this message in context: http://www.nabble.com/Construction-of-Drop-Lines-in-Plot-tf2729919.html#a7614274
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: John H. <jdh...@ac...> - 2006年12月05日 14:06:25
>>>>> "Brent" == Brent Fillery <bfi...@me...> writes:
 Brent> Hi All
 Brent> I am new to Matplotlib, and was wondering if anybody knew
 Brent> of an easy way to construct a dropline from a data point in
 Brent> a plot to the x axis, i.e. a vertical line from (x1,y1) to
 Brent> (x1,0)?
 ax.plot((x1, x1), (y1, 0), linestyle='-', color='black', linewidth=2)
should do it... There are some helper functions vline and
axvline you may want to look at
http://matplotlib.sourceforge.net/matplotlib.pylab.html#-axvline
http://matplotlib.sourceforge.net/matplotlib.pylab.html#-vline
The first will draw a vertical line that spans the axes vertical
extent regardless of zoom level, and the second simply draws a
vertical line at a given x from y1 to y2. vline supports many
vertical lines and for a single one as in your example, it's easy
enough to just use plot.
JDH
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 によって変換されたページ (->オリジナル) /