Posts tagged ‘plotting’

Matplotlib: Graph with vertical lines ascending to points

This is different from a bar chart, since in a bar chart the bars have width.

The vlines function will do what you want this takes arrays for its various values.

Example

import pylab

pylab.vlines([1,2,3,4,5], 0, [2,4,6,8,10])
pylab.show()

March 27, 2011 at 11:09 pm Leave a comment

Drawing lines with matplotlib

Matplotlib’s pyplot library has the following functions for drawing lines:

axvline – A full vertical line (does not start or stop)
vlines – A vertical line segment (or multiple)
axhline – A full horizontal line
hlines – …

The relevant plot in the gallery is here:

http://matplotlib.sourceforge.net/examples/pylab_examples/axhspan_demo.html

March 25, 2010 at 3:55 pm Leave a comment


May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031