Anonymous user
Matplotlib: Difference between revisions
→Project steps
imported>Jesstess |
imported>Jesstess |
||
Line 76:
== Project steps ==
=== 1. Create a basic plot ===
<ol>
Line 104:
to
<pre>x_values = [
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>
Line 121 ⟶ 130:
=== 2. Plotting the world population over time ===
<ol>
|