Re: scatter plot

From: cheryl Ma <xiaoyancloud_at_nyahnyahspammersnyahnyah>
Date: Fri Sep 28 2012 - 08:58:38 MDT

Thanks, Mary!

In this example, data are grouped as the values of X and Y.
I want to to firstly count the density numbers within the specific range of
X and Y, e.g.
if X < 10, Y < 10
            , 10<Y<20
            , 20<Y<30
            , 30<Y<40
            , 40<Y<50
...
40<X<50, Y < 10
            , 10<Y<20
            , 20<Y<30
            , 30<Y<40
            , 40<Y<50

Suppose these density number is within (10, 100), I want to use the density
to group the data, with the different color for the groups on the X-Y
scatter plot, so color bar shows the density number.

I can't figure out how to modify the example for this purpose, could you
help me for that? thanks,

Xiaoyan

On Thu, Sep 27, 2012 at 12:01 PM, Mary Haley <haley@ucar.edu> wrote:

> See the attached.
>
> --Mary
>
>
> On Sep 25, 2012, at 12:48 PM, Mary Haley wrote:
>
> > Sorry, I don't think I answered the right question.
> >
> > I will try to come up with an example for you, but it may not happen for
> a few hours.
> >
> > --Mary
> >
> > On Sep 25, 2012, at 12:43 PM, Mary Haley wrote:
> >
> >> You could turn your 3D array (ngroups x ny x nx) into a 2D array that
> is dimensioned ngroups x (nx*ny) by using ndtooned/onedtond, or "reshape"
> (if you have V6.1.0-beta):
> >>
> >>
> >> dims3d = dimsizes(my3darray)
> >> dims2d = (/dims3d(0),dims3d(1)*dims3d(2))
> >>
> >> my2darray = onedtond(ndtooned(my3darray),dims2d)
> >>
> >> or, in V6.1.0-beta:
> >>
> >> my2darray = reshape(my3darray,dims2d)
> >>
> >>
> >> --Mary
> >>
> >> On Sep 25, 2012, at 11:17 AM, cheryl Ma wrote:
> >>
> >>> Thanks, Mary.
> >>>
> >>> This example use gsn_csm_y, using index values for the X axis. In my
> case I want to use the real X and Y values.
> >>> So do I need to create a 3D array (2D array in the example) to hold X,
> Y, and group number?
> >>>
> >>> Thanks,
> >>> Xiaoyan
> >>>
> >>> On Mon, Sep 24, 2012 at 12:34 PM, Mary Haley <haley@ucar.edu> wrote:
> >>> Hi Xiaoyan,
> >>>
> >>> See example scatter_8.ncl at:
> >>>
> >>> http://www.ncl.ucar.edu/Applications/scatter.shtml
> >>>
> >>> --Mary
> >>>
> >>> On Sep 24, 2012, at 8:55 AM, cheryl Ma wrote:
> >>>
> >>>> Hi all,
> >>>>
> >>>> I want to make a scatter plot, with color coded as a function of
> density (looks like the plot attached below).
> >>>> Generally I use gsn_csm_xy to make scatter plot. Does anyone know how
> to make a scatterplot as shown?
> >>>>
> >>>> Thanks in advance,
> >>>> Xiaoyan
> >>>>
> >>>> <image.png>
> >>>> _______________________________________________
> >>>> ncl-talk mailing list
> >>>> List instructions, subscriber options, unsubscribe:
> >>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >>>
> >>>
> >>
> >> _______________________________________________
> >> ncl-talk mailing list
> >> List instructions, subscriber options, unsubscribe:
> >> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >
> > _______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Sep 28 08:58:57 2012

This archive was generated by hypermail 2.1.8 : Mon Oct 08 2012 - 15:54:16 MDT