Hanno,
I wrestled with this one for a while. The attached script is the result
of my effort. The two keys were to define the colormap, and then make
sure that when you call the colormap that the values span the full
range. For example, if you want a data point to be "yellow", and that
color (RGB: 1,1,0) is between 0.75 and 0.85 on your colormap, then give
the point a value of 0.81 (or whatever in the range). Then be sure to
also pass a zero (0.0) and a one (1.0) to the scatter. By spanning the
full scale range you will be sure to fix the color that you want from
the colormap to the data point that you define. It might be a hack, but
it works ok.

Cheers,
Jake

-----Original Message-----
From: Louis Pecora [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 13, 2006 7:47 AM
To: matplotlib-users@lists.sourceforge.net
Subject: Re: [Matplotlib-users] plot x y value(x,y)

Hanno Klemm wrote:
> Hi Louis,
>
> sorry for being unclear. What I have is a list of data points given in

> the format
>
> x y value
>
> so my array looks like
>
> x_1, y_1, v_1
> x_2, y_2, v_2,
>
> etc.
>
> Now I want to plot a point at (x_i, y_i) and assign to it a color 
> according to v_i. The problem is, that the values at x and y are given

> and are not calculated.
>
> Christian's suggestion with a scatter plot works fine for me, but if 
> there are other possibilities I'm always keen to learn something.
>
> Hope this clarifies matters.
>
> Best regards,
> Hanno
>
>   

Got it.  Yes, sounds like you want a "3D" scatter plot.  v (at some
"height) over the surface of x,y points.  There is a contour in
matplotlib, but I don't think it will do what you want.  I will go back
and look over matplotlib.

You might want to go to the matplotlib web site and download the
examples.  There are tons of them.  Maybe one is right for you.

--
Cheers,

Lou Pecora

Code 6362
Naval Research Lab
Washington, DC  20375
USA
Ph:  +202-767-6002
email:  [EMAIL PROTECTED]



Attachment: fixed_color_scatter.py
Description: fixed_color_scatter.py

Attachment: fixed_color_scatter.png
Description: fixed_color_scatter.png

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to