Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I plot a graph in Python?

I have installed Matplotlib, and I have created two lists, x and y.

I want the x-axis to have values from 0 to 100 in steps of 10 and the y-axis to have values from 0 to 1 in steps of 0.1. How do I plot this graph?

like image 238
dave Avatar asked Jan 12 '10 10:01

dave


2 Answers

Have a look through the Matplotlib gallery. All the graphs there have their source code available. Find one you like, cut & paste, and dissect!

like image 78
Sam Doshi Avatar answered Sep 21 '22 21:09

Sam Doshi


There is a very good book:

Sandro Tosi, Matplotlib for Python Developers, Packt Pub., 2009.

like image 33
Papiro Avatar answered Sep 24 '22 21:09

Papiro