Matplotlib: Difference between revisions

Very nice site!
Very nice site!
==Bonus exercises==
=== 1. Letter frequency analysis of the US Constitution ===
# Run <code>python</code>. It will generate a bar chart showing the frequency of each letter in the alphabet in the US Constitution.
# Open and read through <code></code>. The code for gathering and displaying the frequencies is a bit more complicated than the previous scripts in this projects, but try to trace the general strategy for plotting the data. Be sure to read the comments!
# Try to answer the following questions:
## On line 11, what is <code>string.ascii_lowercase</code>?
## On line 18, what is the purpose of <code>char = char.lower()</code>?
## What are the contents of <code>labels</code> after the <code>for</code> loop on line 30 completes?
## On line 41, what are the two arguments passed to <code>pyplot.xticks</code>
## On line 44, we use <code></code> instead of our usual <code>pyplot.plot</code>. What are the 3 arguments passed to <code></code>?
# We've included a mystery text file <code>mystery.txt</code>: an excerpt from an actual novel. Alter <code></code> to process the data in <code>mystery.txt</code> instead of <code>constitution.txt</code>, and re-run the script. What do you notice that is odd about this file? You can read more about this odd novel [ here].
=== 2. Tour the matplotlib gallery ===
You can truly make any kind of graph with matplotlib. You can even create animated graphs. Check out some of the amazing possibilities, including their source code, at the matplotlib gallery:
You've read, modified, and created scripts that plot and analyze data using matplotlib. Keep practicing!