Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

matplotlib

matplotlib is a 2D graphics library for Python that is much better for creating mathematical graphs than the Python Imaging Library. The figures it produces are intended to be of high enough quality to be used in publications.

Installation

Before installing matplotlib, you’ll need to install NumPy, as described in the previous section. matplotlib has binary builds for all major platforms, including Windows, Mac OS X, RPM-based Linux distributions, and Debian-based distributions. You can find detailed instructions for installing matplotlib on any of the platforms at http://matplotlib.sourceforge.net/installing.html.

Simple Usage Example

This example will use orange circles to plot four points at (1,1), (2,4), (3,9), and (4,16). It will then save the output to a file and display it in a window on the screen.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint