Re: scatter plot

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue Sep 25 2012 - 12:43:16 MDT

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
Received on Tue Sep 25 12:43:23 2012

This archive was generated by hypermail 2.1.8 : Wed Sep 26 2012 - 13:56:03 MDT