Re: Multiple polygons on panel plots (lat,lon)

From: Wilhelm Haygen <w.haygen_at_nyahnyahspammersnyahnyah>
Date: Wed Jan 16 2013 - 05:37:38 MST

Hi-

Test this one, should work!

 dum = new(nplots*4,graphic)
 do n=0,nplots-1
 do i = 0 , 3

 dum(i+(4*n))=gsn_add_polyline(wks,plot(n),xpts(i:i+1),ypts(i:i+1),resp)

    end do
 end do

================================
Wilhelm Haygen
Institute of Meteorology
Ludwig Maximilians University Munich (LMU)
Germany
=================================

2013/1/16 Ahmad Farsyud <a.farsyud@gmail.com>

> Thank you for the response,
> However, after changing my codes it produced another error
> "fatal:Subscript out of range, error in subscript #0 "esp at these lines:
>
> do i = 0 , 3
> do n=0,nplots-1
> *dum((i*4)+n)=gsn_add_polyline(wks,plot(n),xpts(i:i+1),ypts(i:i+1),resp)
> <---*
> end do
> end do
>
> Thanks a lot.
> A.Farsyud.
>
>
>
>
> On Wed, Jan 16, 2013 at 12:25 AM, Mary Haley <haley@ucar.edu> wrote:
>
>>
>> On Jan 15, 2013, at 4:10 AM, Ahmad Farsyud wrote:
>>
>> Hallo,
>>
>> Anybody can tell me how can I handle this error:
>>
>> fatal:Number of elements of dimension (0) of argument (0) is (2) in
>> function (NhlAddPrimitive), expected (1) elements
>> fatal:Execute: Error occurred at or near line 4147 in file
>> $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl
>> fatal:Execute: Error occurred at or near line 4412 in file
>> $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl
>>
>> the error start at this lines:
>>
>> do i = 0 , 3
>> dum(i)=gsn_add_polyline(wks,*plot*,xpts(i:i+1),ypts(i:i+1),resp)
>>
>> end do
>>
>> I need to plot all ploygons on each of my map in the panel plots. Once I
>> change the plot
>> to be *plot(0) or plot(1), *I did not get any error anymore but the
>> polygons only appear in one map.
>> That's not my goal.
>>
>> Thanks for any help.
>> A. Farsyud
>>
>>
>> Hi,
>>
>> You can only attach lines to one plot object at a time, so that's why
>> plot(0) works and not plot. But, I can see why it would be useful to be
>> able to pass an array of plots, so I'll add this to our list of things to
>> do.
>>
>> Meanwhile, you will need to make "dum" big to be (# of plots) x 4:
>>
>> nplots = dimsizes(plots)
>> dum = new(nplots*4,graphic)
>>
>> do i = 0 , 3
>> do n=0,nplots-1
>> dum((i*4)+n)=gsn_add_polyline(wks,*plot(n)*,xpts(i:i+1),ypts(i:i+1),resp)
>>
>> end do
>> end do
>>
>> --Mary
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> 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 Wed Jan 16 05:37:55 2013

This archive was generated by hypermail 2.1.8 : Sat Jan 19 2013 - 10:23:16 MST