Matplotlib
From CommunityData
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
- Download the CDSW Matplotlib code from [here]
- First plot: `001-hello-plot.py`
- Subplots: `002-subplots.py`
References
- matplotlib API reference
- matplotlib Examples (many, with source)
- Other plotting resources
Example topics to cover in Lecture
- line charts
- histograms
- binning
- scatter plots
- heat maps
- axis labeling
- legends