Re: help with scatter plot with 3 variables

From: Rahul Kanwar <rkanwar_at_nyahnyahspammersnyahnyah>
Date: Thu, 17 Aug 2006 19:18:18 -0400

Hello Adam,
   Thank you for your reply. I have brightness temperature data from
SMMR which has (lat, lon , Tb) pairs and i want to plot it over a map. I
do not want to interpolate it as its swath data and does not cover the
whole globe, i want to put circles at lat, lon with colors corresponding
to Tb.
   Your code seems to work. Is there some way to assign the color values
for z automatically. I wanted something like this (its from matlab) :

   scatter(X,Y,S,C)
  
   where S is the size of the marker and C is the z values, matlab
automatically scales the data according to the colormap being used.

bye,
Rahul

On Thu, 2006-08-17 at 17:07 -0600, Adam Phillips wrote:
> 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
>

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Aug 17 2006 - 17:18:18 MDT

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