## [Matplotlib-users] Construction of Drop Lines in Plot

 [Matplotlib-users] Construction of Drop Lines in Plot From: Brent Fillery - 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. ```

 [Matplotlib-users] Construction of Drop Lines in Plot From: Brent Fillery - 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. ```
 Re: [Matplotlib-users] Construction of Drop Lines in Plot From: John Hunter - 2006-12-05 14:06:25 ```>>>>> "Brent" == Brent Fillery 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 ```