Forums: » Register « |  Free Tools |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |

New Free Tools on Dev Shed!

#1
November 21st, 2012, 09:11 AM
 giacomo84
Registered User

Join Date: Nov 2012
Posts: 13
Time spent in forums: 3 h 21 m 37 sec
Reputation Power: 0
How to plot a graph with these data

hi. i'd like to understand how to make the following graph in python, using matplotlib.

i have values for pressure, and it varies with y-axis. so, for example i have:

x=1,y=1,p=3
x=1,y=2,p=5
x=1,y=3,p=0

and so on, other sets for other x, eg:

x=2,y=1,p=9
x=2,y=2,p=5 ...

x=3,y=1,p=3
x=3,y=2,p=7 ...

So, what i need to do, is to put pressure values in a x-y graph. How i can do this? I was thinking of dot with different diameters or stuffs like that, but i don't now how to do.

thanks

#2
November 21st, 2012, 11:36 AM
 Lux Perpetua
Contributing User

Join Date: Feb 2004
Location: San Francisco Bay
Posts: 1,939
Time spent in forums: 1 Month 1 Week 3 h 27 m 29 sec
Reputation Power: 1312
You can use different diameters:
Code:
`matplotlib.pyplot.scatter(x, y, s)`
s is an array of sizes in units of points^2 (i.e., proportional to area). The diameter would be proportional to sqrt(s).

You can also choose the color of each point.
Code:
`help(matplotlib.pyplot.scatter)`
will give you the details.

 Viewing: Dev Shed Forums > Programming Languages > Python Programming > How to plot a graph with these data