Thread: How to plot a graph with these data

1. No Profile Picture
Registered User
Devshed Newbie (0 - 499 posts)

Join Date
Nov 2012
Posts
13
Rep 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. No Profile Picture
Contributing User
Devshed Intermediate (1500 - 1999 posts)

Join Date
Feb 2004
Location
San Francisco Bay
Posts
1,941
Rep Power
1314
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.