[ncl-talk] The problem of drawing NCL picture

Adam Phillips asphilli at ucar.edu
Fri Nov 6 10:14:13 MST 2015


Hi Chao,
Whenever you write to ncl-talk *always* include any error messages that you
are getting from your script. In this case you were likely seeing this:
fatal:Variable (wks_type) is undefined, can not assign attribute (wkWidth)
fatal:["Execute.c":8575]:Execute: Error occurred at or near line.....

Your code had this:
u=a->UGRD_P0_L102_GLL0(0,:,:)
v=a->VGRD_P0_L102_GLL0(0,:,:)
wks = gsn_open_wks("x11","vector2b")
wks_type at wkWidth  = 1000
wks_type at wkHeight = 1000

You cannot attach attributes to an undefined array, in this case wks_type.
I think what you want to do is this:
u=a->UGRD_P0_L102_GLL0(0,:,:)
v=a->VGRD_P0_L102_GLL0(0,:,:)
wks_type = "x11"
wks_type at wkWidth  = 1000
wks_type at wkHeight = 1000
wks = gsn_open_wks(wks_type,"vector2b")

Hope that helps. If not, please respond to the ncl-talk email list.
Adam




On Fri, Nov 6, 2015 at 10:02 AM, Wang, Chao <cxw151530 at utdallas.edu> wrote:

> Dear Sir/Madam,
>
> Sorry to bother again. My name is Chao. I have reviewed my code and
> improved it, but still got the same graph. It shows little different from
> the result I got from Matlab.
> And I used the code:
>  *wks_type at wkWidth = 1000*
> *wks_type at wkHeight = 1000*
> to make the picture bigger, but it still shows the same size. I don’t know
> what is the problem.
> Here is the script I used:
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>


-- 
Adam Phillips
Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/   303-497-1726

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20151106/e037dab1/attachment.html 


More information about the ncl-talk mailing list