SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: Michaël D. <mic...@la...> - 2008年02月26日 08:23:08
Hi list,
I have a set of data with 3 "columns" :
x = x coordinate of the point
y = y coordinate
z = temperature
I can't see how to set a different color for each point function of 
temperature value.
I have tried, which draw a colorfull beautiful "map", the color varying 
with the row rank of x (not what I want)
**********
 sqla="SELECT x, y, temperature FROM import_parcelle a WHERE 
dat_loc='" + date_traite + "' AND code_uc='" + code_uc + "' ORDER BY 
a.dateheure;"
 resa=db.query(sqla)
 data=resa.dictresult()
 x= [float(a["x"]) for a in data] # --> extraction de la colonne x
 y= [float(a["y"]) for a in data] # --> extraction de la colonne y
 z= [float(a["temperature"]) for a in data] # --> extraction de la 
colonne temperature
 scatter(x, y, c=arange(len(x)), cmap=cm.spring)
 title("Carte des temperatures(L/min)")
 xlim(min(x)-10,max(x)+10)
 ylim(min(y)-10,max(y)+10)
**********
What is the good way to do what I reach for ?
I have much trouble to know how to define the c parameter of scatter. I 
saw the "arrange" thing somewhere in internet, but don't understand what 
it is for.
Thanks in advance for your help.
Michael
From: John H. <jd...@gm...> - 2008年03月21日 19:56:18
On Tue, Feb 26, 2008 at 3:23 AM, Michaël Douchin
<mic...@la...> wrote:
> What is the good way to do what I reach for ?
> I have much trouble to know how to define the c parameter of scatter. I
> saw the "arrange" thing somewhere in internet, but don't understand what
> it is for.
Have you tried the scatter demos? See for example
http://matplotlib.sf.net/examples/scatter_demo2.py
JDH
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /