Re: help with scatter plot with 3 variables

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Thu, 17 Aug 2006 17:07:26 -0600

Hi Rahul,

I am not so sure that you want a true scatter plot. Assuming you have
monotonically increasing X-axis values, you can use gsn_csm_xy to plot
the markers, and then use the resource xyMarkerColors to set the markers
colors based on Z. For example:

wks = gsn_open_wks("ps","test")
gsn_define_colormap(wks,"wh-bl-gr-ye-re")
res = True
.........
colors = new(dimsizes(Z),"string")

do gg = 0,dimsizes(Z)-1
    if (Z(gg).lt..2) then
       colors(gg) = "red"
    end if
    if (Z(gg).ge..2.and.Z(gg).lt..3) then
       colors(gg) = "orange"
    end if

; and so on

end do
res_at_xyMarkerColor = colors
plot = gsn_csm_xy(wks,X,Y,res)
end

Good luck...
Adam

Rahul Kanwar wrote:
> Hello,
>
> I want to make a scatter plot with the data following type of data:
>
> X Y Z
> 1 2 3
> 2 3 4
> 3 5 5
> 4 3 7
>
> The values in the Z column are in decimals and vary from 0-300. I
> want to make a scatter plot with x-y axis and have circle 'o' as the
> marker with color of the marker varying according to the Z axis (I do'nt
> want to grid the data).
> I have tried suing xy but it dose'nt seem to be working. Can some one
> please help me with it ?
>
> regards,
> Rahul
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli_at_ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Aug 17 2006 - 17:07:26 MDT

This archive was generated by hypermail 2.2.0 : Fri Aug 18 2006 - 10:43:09 MDT