[ncl-talk] Adding arrow head at the and of the polylines

Adam Phillips asphilli at ucar.edu
Mon Jun 19 11:42:24 MDT 2017


Hi Chang,
As Mary noted this is a user-donated function and thus is not officially
supported by the NCL project. However, I was able to get an arrow drawn on
the first example of the latitude x height applications page by using the
donated arrow function here:
http://www.ncl.ucar.edu/Applications/height_lat.shtml#ex1

I have attached the modified version of h_lat_1.ncl along with the
resulting graphic. Note that you can pass gs resources into the arrow
function to modify the color, thickness, etc as is shown on the polyline
applications page here:
http://www.ncl.ucar.edu/Applications/polyg.shtml

Hope that helps. If you have any further questions please respond to the
ncl-talk email list.
Adam




On Mon, Jun 19, 2017 at 11:33 AM, Mary Haley <haley at ucar.edu> wrote:

> Chang,
>
> This is a user-donated function that I am unfamiliar with.
>
> The code seems straight-forward enough.  If the head is simply at the
> wrong end of the vector, then you should be able to change arrow.ncl to
> swap which end the head is considered to be.
>
> If you are trying to create a pressure/latitutde plot with vectors, then
> you may want to look into gsn_csm_pres_hgt_vector. This requires that you
> have a 2D array of U and V values which you will need to seed with your own
> values:
>
> http://www.ncl.ucar.edu/Document/Graphics/Interfaces/
> gsn_csm_pres_hgt_vector.shtml
>
> --Mary
>
>
> On Mon, Jun 19, 2017 at 10:19 AM, Xi Chang <xi.chang01 at gmail.com> wrote:
>
>> Hi Mary and NCL,
>>
>> The script for the arrow-head can only work in the X and Y are in
>> cartesian coordinate. It did NOT work when *X is the latitude and Y is
>> the height* (hPa), the head of the vector is placed wrongly when I used
>> "polylines" function. Can you help me with this issue?
>>
>> Best,
>>
>> Chang
>>
>>
>>
>>
>>
>> On Thu, May 11, 2017 at 3:42 PM, Mary Haley <haley at ucar.edu> wrote:
>>
>>> Xi,
>>>
>>> I don't think we have any examples of this, but I typed "arrow polyline"
>>> in the search box of the NCL home page, and found this post by Arindam
>>> Chakraborty:
>>>
>>> https://www.ncl.ucar.edu/Support/talk_archives/2010/1344.html
>>>
>>> I've attached the arrow.ncl script that he included in that post. You
>>> should be able to run it as-is.
>>>
>>> --Mary
>>>
>>>
>>> On Wed, May 10, 2017 at 5:28 PM, Xi Chang <xi.chang01 at gmail.com> wrote:
>>>
>>>> Dear NCL,
>>>>
>>>> Is there any a function to add an arrow head to show the direction of
>>>> a line (using polylines)?
>>>> Thanks a lot,
>>>>
>>>> Best,
>>>> Xi
>>>>
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> ncl-talk at ucar.edu
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>
>>>>
>>>
>>
>
> _______________________________________________
> 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/20170619/c9ebe9a7/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: h_lat.png
Type: image/png
Size: 160679 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170619/c9ebe9a7/attachment.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: h_lat_1.ncl
Type: text/x-ncl
Size: 3373 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170619/c9ebe9a7/attachment.bin 


More information about the ncl-talk mailing list