[ncl-talk] how to plot xy2 plot with 1D data

Mary Haley haley at ucar.edu
Mon Aug 17 22:12:22 MDT 2015


Grace,

I'm confused by what you are asking for. You said the observed data didn't
have a time dimension, but then you said it had "one data per hour". This
sounds like you have some kind of time data.

In order to use gsn_csm_xy2, you need to have both sets of Y values be the
same length, and be at the same X (in this case "time") values.

If you have two different sets of X and Y axes values, then look at the
gsn_csm_x2y2 function. There's an example at:

http://www.ncl.ucar.edu/Applications/xy.shtml#ex20

--Mary


On Sat, Aug 15, 2015 at 7:07 PM, grace <313695096 at qq.com> wrote:

> Hi,all:
>     I am wondering how to plot xy2 plot with 1D data?
>    I want to compare wrfout data with observed data in a xy2 plot with
> time as the X axis,
> but the observed data are 1D without time  demension in a .txt file, a
> data per hour .
>     I have  extract the wrfout data as 1D data in a .txt file :
> ;;;;;;;;;;;;;;;;;;;;;
> ascii_file = "temp.txt"
> str = new(ntimes, "string")
>   do it =0, ntimes-1,1        ; TIME LOOP
> t2= wrf_user_getvar(a,"T2",it)
>       t2= t2-273.15
>       t2 at units = "c"
> tt2=t2(it,98, 98)
>     end if
>    str(it) = sprintf("%12.8f", tt2)
> end do
>    asciiwrite(ascii_file, str)
> ;;;;;;;;;;;;;;;;;;;;;;;
>
> How can I plot the xyplot with time as the X axis while data do not have
> time demension with the "plot = gsn_csm_xy2(wks,time,t2,tob,resL,resR)"
>
>    Or do you guys have some advice?
>     any information will be appreciated
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> 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/20150817/74836592/attachment.html 


More information about the ncl-talk mailing list