Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.

Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.

Introduction to Matplotlib for Data Analysis

Abstract
This talk covers what matplotlib is, why use it and how to install it. We'll be covering simple examples that will allow you to get started, but also display the strengths of the matplotlib package. I spend most of my day writing queries using Jade and SQL. Here, we use matplotlib as part of my work for exploratory data analysis and display and explaination of complicated data. I presented this topic at my local linux group. This month someone showed me a graph they had done using matplotlib, after my talk.
Outline
10 slides of a open office presentation mixed with demonstration using pylab interactively and running a script to output a chart. - Introduction: Why I use matplotlib. - Installation: Which packages required and where to obtain them. - Website: Url and description - Short display using pylab interactively: Start up pylab in ipython and bring up a simple scatter chart. Explaination of the functionality of the show window. - Basic bargraph script: Explaination of code. Difference between axes, axis and figure. - Adding labels: Adding title, axis labels, legend, ticks and ticklabels. - How to import data: Genfromtxt Splitting the imported data - Multiple plots on the same figure: Using Subplot Using Gridspec which requires matplotlib 1.0.0 - Twin Axes: How to plot two different datasets on the same plot with different scales.

[Presentation by Catherine Thwaites, uploaded by ewblen on behalf of kiwipycon]

Introduction to Matplotlib for Data Analysis

3.
Installation What you need is: Python version 2.5, 2.6 or 2.7 Numpy version 1.3+ Matplotlib version 1.0.1 Linux Matplotlib 0.99 is the latest in the debian repositaries, Latest version 1.0.1. needs to be installed from source. Instructions http://matplotlib.sourceforge.net/users/installing.html Windows Download and install.

4.
Website for documentation http://matplotlib.sourceforge.net/ Gallery has large number of examples.

5.
Ways to run matplotlib <ul><li>Interactively using pylab and ipython

8.
As part of a larger program </li></ul>catherine@catherine-HP-Mini-110-3100:~$ ipython -pylab Interactively using pylab in ipython Imports modules required to plot in one namespace Chart is updated as you enter commands

9.
In [1]: plot([1,2,3,4],[56,45,58,32]) Out[1]: [<matplotlib.lines.Line2D object at 0xa9a3a2c>] Show Window Save in various open formats Change plot size in window Zoom to inspect Pan to move along