[ncl-talk] scatter plot help
Mary Haley
haley at ucar.edu
Fri Mar 6 08:36:29 MST 2015
I'm not sure exactly what you are trying to plot. The transpose array
simply takes a 2D array and swaps its dimensions. It looks like you are
passing four 3D arrays to it, which doesn't really make sense.
How exactly are you trying to plot c1, c2, c3, and c4?
If you are trying to plot c1 versus c3, and c2 versus c4, then I recommend
creating two separate plots and then overlaying them with "overlay".
Something like this:
plot1 = gsn_csm_xy(wks,transpose(c1(:,:,0),transpose(c3(:,:,0)),res)
plot2 = gsn_csm_xy(wks,transpose(c2(:,:,0)),transpose(c4(:,:,0)),res)
overlay(plot1, plot2)
draw(plot1)
frame(wks)
Note the "(:,:,0)" subscripting is necessary, because these are 3D arrays
(360 x 90 x 1)
--Mary
On Wed, Mar 4, 2015 at 3:41 PM, Vanúcia Schumacher <
vanucia-schumacher at hotmail.com> wrote:
> Hi users,
>
> I would like to plot a graph of correlation between models (x axis) and
> reanalysis (y axis), but when I use: plot = gsn_csm_xy
> (wks,transpose((/c1,c2/)),((/c3,c4/)),res) from example scatter.7.ncl
> returns the error:
>
> fatal:Number of subscripts do not match number of dimensions of
> variable,(2) Subscripts used, (3) Subscripts expected
>
> outputs correlations are:
>
> Variable: c1
> Type: double
> Total Size: 259200 bytes
> 32400 values
> Number of Dimensions: 3
> Dimensions and sizes: [360] x [90] x [1]
> Coordinates:
> Number Of Attributes: 1
> _FillValue : 1.000000020040877e+20
> (0)
> (0) min=1 max=1
>
> Variable: c2
> Type: double
> Total Size: 259200 bytes
> 32400 values
> Number of Dimensions: 3
> Dimensions and sizes: [360] x [90] x [1]
> Coordinates:
> Number Of Attributes: 1
> _FillValue : 1.000000020040877e+20
> (0)
> (0) min=1 max=1
>
> Variable: c3
> Type: float
> Total Size: 129600 bytes
> 32400 values
> Number of Dimensions: 3
> Dimensions and sizes: [360] x [90] x [1]
> Coordinates:
> Number Of Attributes: 1
> _FillValue : 1e+20
> (0)
> (0) min=1 max=1
>
> Variable: c4
> Type: float
> Total Size: 129600 bytes
> 32400 values
> Number of Dimensions: 3
> Dimensions and sizes: [360] x [90] x [1]
> Coordinates:
> Number Of Attributes: 1
> _FillValue : 1e+20
> (0)
> (0) min=1 max=1
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150306/54386bbd/attachment.html
More information about the ncl-talk
mailing list