[ncl-talk] Disappearing Dots (Revisited)
Barry Lynn
barry.h.lynn at gmail.com
Tue Jan 14 20:25:01 MST 2020
Rashed's fix worked fine. I wonder why I am able to call the arrow routine
with a single array name (not array(i)).
Thanks again.
On Tue, Jan 14, 2020 at 9:48 PM Barry Lynn <barry.h.lynn at gmail.com> wrote:
> Rashed seems to demonstrate that his version works, so I will probably
> find the same. I'll update later.
>
> Thank you for the help.
>
> Barry
>
> On Tue, Jan 14, 2020 at 9:47 PM Barry Lynn <barry.h.lynn at gmail.com> wrote:
>
>> Hi Adam, Rasheed.
>>
>> In both cases, I call the function within a loop. The only difference is
>> whether I refer to array(i) or arr_0, arr_1... n.
>>
>> In any case, I will try Rashed's version.
>>
>> Barry
>>
>> On Tue, Jan 14, 2020 at 9:06 PM Adam Phillips <asphilli at ucar.edu> wrote:
>>
>>> Hi Barry,
>>> If I had to guess, it is that the arrow function writes the
>>> gsn_add_polyline output as attributes named arr,arr1, and arr2 to the plt
>>> array that is to be returned by the function. If you call the function
>>> multiple times and pass all the graphical output to the same logical array
>>> named "array", each time you call arrow, array at arr, array at arr1 and
>>> array at arr2 will get overwritten. To get around this, you should alter
>>> the arrow function to use the unique_string function.
>>> https://www.ncl.ucar.edu/Document/Functions/Built-in/unique_string.shtml
>>>
>>> For an example of how to do this, see polymarker example #18:
>>> https://www.ncl.ucar.edu/Applications/polyg.shtml#ex18
>>>
>>> For example, change this:
>>> plt at arr = gsn_add_polyline(wks,plt,xpts,ypts,res)
>>> to this:
>>> str = unique_string("arr")
>>> plt@$str$ = gsn_add_polyline(wks,plt,xpts,ypts,res)
>>>
>>> and do the same for the other two calls to gsn_add_polyline.
>>> Hope that helps!
>>> Adam
>>>
>>>
>>> On Tue, Jan 14, 2020 at 9:45 AM Barry Lynn via ncl-talk <
>>> ncl-talk at ucar.edu> wrote:
>>>
>>>> Hi:
>>>>
>>>> I have a bit of a mystery:
>>>>
>>>> I have a loop where I am calling gsn_add_polymarker. I created an array
>>>> (dum_b(n_calls)) so I could plot the markers within the loop.
>>>>
>>>> dum_b(i) = gsn_add_polymarker(wks,plot,lon_old(i),lat_old(i),mkres)
>>>>
>>>>
>>>> However, when I call:
>>>>
>>>>
>>>> array(i) = arrow(wks,plot,xpts,ypts,mkres)
>>>>
>>>>
>>>> I am not able to make the lines with the arrows (more than once).
>>>>
>>>>
>>>> warning:TransformPostDraw: tfPolyDrawList element 1 is invalid
>>>>
>>>>
>>>> Yet, if I call the same with
>>>>
>>>>
>>>> arr_0 = arrow...
>>>>
>>>>
>>>> arr_1 = arrow...
>>>>
>>>>
>>>> up to n_calls, I have no problem.
>>>>
>>>>
>>>> If someone can solve the mystery, I would be curious to find out the
>>>> reason for this "strange" behavior.
>>>>
>>>>
>>>> https://www.ncl.ucar.edu/Support/talk_archives/2010/att-1344/arrow.ncl
>>>>
>>>> On Mon, Jul 8, 2019 at 12:13 PM Barry Lynn <barry.h.lynn at gmail.com>
>>>> wrote:
>>>>
>>>>> Hi:
>>>>>
>>>>> That was absolutely the correct solution -- thank you.
>>>>>
>>>>> Are you aware of a way to increase the spacing between maps? I am
>>>>> using wrf resources so this is very obtuse.
>>>>>
>>>>> Barry
>>>>>
>>>>> On Mon, Jul 8, 2019 at 10:44 AM Rashed Mahmood <rashidcomsis at gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Hi Barry,
>>>>>> A quick look suggests that it may be related to not specifying unique
>>>>>> ids for markid and textid:
>>>>>> markid = gsn_add_polymarker(wks,plots(0),lon,lat,mkres)
>>>>>> textid = gsn_add_text(wks,plots(0),cities,lon,lat,txres)
>>>>>>
>>>>>> Next lines should have,
>>>>>> markid*1 *= gsn_add_polymarker(wks,plots(0),lon,lat,mkres)
>>>>>> textid*1* = gsn_add_text(wks,plots(0),cities,lon,lat,txres)
>>>>>>
>>>>>> and so on...
>>>>>>
>>>>>> Cheers
>>>>>>
>>>>>> Rashed
>>>>>>
>>>>>>
>>>>>> On Mon, Jul 8, 2019 at 7:51 AM Barry Lynn via ncl-talk <
>>>>>> ncl-talk at ucar.edu> wrote:
>>>>>>
>>>>>>> Hello:
>>>>>>>
>>>>>>> For some reason, the markid only appears on the last graph, but not
>>>>>>> the first two. Yet, the "call" to each is the same. I had this problem in
>>>>>>> other programs I wrote.
>>>>>>>
>>>>>>> If you have a suggestion, thank you,
>>>>>>>
>>>>>>> Barry
>>>>>>> --
>>>>>>> Barry H. Lynn, Ph.D
>>>>>>> Senior Associate Scientist, Lecturer,
>>>>>>> The Institute of the Earth Science,
>>>>>>> The Hebrew University of Jerusalem,
>>>>>>> Givat Ram, Jerusalem 91904, Israel
>>>>>>> Tel: 972 547 231 170
>>>>>>> Fax: (972)-25662581
>>>>>>>
>>>>>>> C.E.O, Weather It Is, LTD
>>>>>>> Weather and Climate Focus
>>>>>>> http://weather-it-is.com
>>>>>>> Jerusalem, Israel
>>>>>>> Local: 02 930 9525
>>>>>>> Cell: 054 7 231 170
>>>>>>> Int-IS: x972 2 930 9525
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> ncl-talk mailing list
>>>>>>> ncl-talk at ucar.edu
>>>>>>> List instructions, subscriber options, unsubscribe:
>>>>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> Barry H. Lynn, Ph.D
>>>>> Senior Associate Scientist, Lecturer,
>>>>> The Institute of the Earth Science,
>>>>> The Hebrew University of Jerusalem,
>>>>> Givat Ram, Jerusalem 91904, Israel
>>>>> Tel: 972 547 231 170
>>>>> Fax: (972)-25662581
>>>>>
>>>>> C.E.O, Weather It Is, LTD
>>>>> Weather and Climate Focus
>>>>> http://weather-it-is.com
>>>>> Jerusalem, Israel
>>>>> Local: 02 930 9525
>>>>> Cell: 054 7 231 170
>>>>> Int-IS: x972 2 930 9525
>>>>>
>>>>>
>>>>
>>>> --
>>>> Barry H. Lynn, Ph.D
>>>> Senior Associate Scientist, Lecturer,
>>>> The Institute of the Earth Science,
>>>> The Hebrew University of Jerusalem,
>>>> Givat Ram, Jerusalem 91904, Israel
>>>> Tel: 972 547 231 170
>>>> Fax: (972)-25662581
>>>>
>>>> C.E.O, Weather It Is, LTD
>>>> Weather and Climate Focus
>>>> http://weather-it-is.com
>>>> Jerusalem, Israel
>>>> Local: 02 930 9525
>>>> Cell: 054 7 231 170
>>>> Int-IS: x972 2 930 9525
>>>>
>>>> _______________________________________________
>>>> 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>
>>>
>>
>>
>> --
>> Barry H. Lynn, Ph.D
>> Senior Associate Scientist, Lecturer,
>> The Institute of the Earth Science,
>> The Hebrew University of Jerusalem,
>> Givat Ram, Jerusalem 91904, Israel
>> Tel: 972 547 231 170
>> Fax: (972)-25662581
>>
>> C.E.O, Weather It Is, LTD
>> Weather and Climate Focus
>> http://weather-it-is.com
>> Jerusalem, Israel
>> Local: 02 930 9525
>> Cell: 054 7 231 170
>> Int-IS: x972 2 930 9525
>>
>>
>
> --
> Barry H. Lynn, Ph.D
> Senior Associate Scientist, Lecturer,
> The Institute of the Earth Science,
> The Hebrew University of Jerusalem,
> Givat Ram, Jerusalem 91904, Israel
> Tel: 972 547 231 170
> Fax: (972)-25662581
>
> C.E.O, Weather It Is, LTD
> Weather and Climate Focus
> http://weather-it-is.com
> Jerusalem, Israel
> Local: 02 930 9525
> Cell: 054 7 231 170
> Int-IS: x972 2 930 9525
>
>
--
Barry H. Lynn, Ph.D
Senior Associate Scientist, Lecturer,
The Institute of the Earth Science,
The Hebrew University of Jerusalem,
Givat Ram, Jerusalem 91904, Israel
Tel: 972 547 231 170
Fax: (972)-25662581
C.E.O, Weather It Is, LTD
Weather and Climate Focus
http://weather-it-is.com
Jerusalem, Israel
Local: 02 930 9525
Cell: 054 7 231 170
Int-IS: x972 2 930 9525
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200115/d35f5d0b/attachment.html>
More information about the ncl-talk
mailing list