Matplotlib: Difference between revisions

imported>Jesstess
imported>Jesstess
== Project steps ==
 
=== 1. Create a basic plot ===
 
<ol>
to
 
<pre>x_values = [30, 4, 7, 20, 22, 25]
y_values = [0, 2, 4, 8, 16, 32]
pyplot.plot(x_values, y_values, "o-")</pre>
 
Note how matplotlib automatically resizes the graph to fit all of the points in the figure for you.
</li>
<li>
Read about how to generate random integers on http://docs.python.org/library/random.html#random.randint.
 
Then, instead of hard-coding x values and y values in <code>basic_plot.py</code>, generate a list of random y values.
 
An example plot using random y values might look like this:
 
[File:Basic_plot.png|300px]
</li>
</ol>
 
 
=== 2. Plotting the world population over time ===
 
<ol>
Anonymous user