Matplotlib: Difference between revisions

From CommunityData
(Flesh out the program)
(no need for too many square brackets)
Line 21: Line 21:


# IPython: an interactive python shell
# IPython: an interactive python shell
# Download the CDSW Matplotlib code from [[http://mako.cc/teaching/2015/cdsw-autumn/wikibios.zip here]]  
# Download the CDSW Matplotlib code from [http://mako.cc/teaching/2015/cdsw-autumn/wikibios.zip here]
# First plot: <tt>001-hello-plot.py</tt>
# First plot: <tt>001-hello-plot.py</tt>
# Subplots: <tt>002-subplots.py</tt>
# Subplots: <tt>002-subplots.py</tt>
# Let's do something more interesting: <tt>003-plot-timeseries.py</tt>
# Let's do something more interesting: <tt>003-plot-timeseries.py</tt>
# Visit the [[http://matplotlib.org/gallery.html Matplotlib gallery]].  
# Visit the [http://matplotlib.org/gallery.html Matplotlib gallery].  
# Make another kind of plot: <tt>004-plot-histogram.py</tt>
# Make another kind of plot: <tt>004-plot-histogram.py</tt>
# Dive deeper into web APIs: <tt>005-traffic-timeseries.py</tt>
# Dive deeper into web APIs: <tt>005-traffic-timeseries.py</tt>

Revision as of 04:21, 8 May 2015

Visualizing data with Matplotlib and Wiki-bios

In this session, we will explore how to produce clear, informative charts, graphs, and plots with Matplotlib, the most popular toolkit for scientific data visualization in Python.

We'll start with the data-set created in this morning containing information about edits to the Harry Potter Wikipedia article.

We will then proceed to visualize different aspects of data from the Socrata web API.


Goals

  • Get set up to make graphs with Matplotlib
  • Learn the basics of the Matplotlib API and workflow
  • Practice reading the Matplotlib documentation
  • Build a plotting program step by step
  • Learn simple ways to distill the essence of a large data set
  • Explore the art of visualizing data
  • Exercise your creativity by making your own visualization
  1. IPython: an interactive python shell
  2. Download the CDSW Matplotlib code from here
  3. First plot: 001-hello-plot.py
  4. Subplots: 002-subplots.py
  5. Let's do something more interesting: 003-plot-timeseries.py
  6. Visit the Matplotlib gallery.
  7. Make another kind of plot: 004-plot-histogram.py
  8. Dive deeper into web APIs: 005-traffic-timeseries.py
  9. Play around with any/all the data you've seen!

References

Example topics to cover in Lecture

  • line charts
  • histograms
  • binning
  • scatter plots
  • heat maps
  • axis labeling
  • legends