[ncl-talk] add string on each domain
Adam Phillips
asphilli at ucar.edu
Thu Apr 2 09:22:07 MDT 2015
Hi Qi,
What you are seeing looks right to me.The ocean is very likely = 0.0m. When
the first contour level starts at 2, the ocean will be colored the color
that shades all areas less than 2. When the first contour level starts at
0, all areas greater than *or equal to* 0 and less than 25 (?) will be
colored green, and all areas less than 0 blue. This is a good example of
NCL color filling behavior.
Hope that helps!
Adam
On Thu, Apr 2, 2015 at 2:26 AM, LI Qi <liqi123sh at qq.com> wrote:
>
> Dear Rick,
>
> Really appreciate your help! It works!
>
> Attached is my script to add domain idx.
>
> But I still have a minor question: when the minimum contour level of
> terrain height (unit: m) is set to 0, the ocean area shows green. Only when
> set to 2, the ocean displays correctly (shown below). Why?
> The terrain data is output from WRF model.
>
> Best regards,
> Qi
>
>
> ncl script:
> xbox = (/lon2(0,0),lon2(0,nx2),lon2(ny2,nx2),lon2(ny2,0),lon2(0,0)/)
> ybox = (/lat2(0,0),lat2(0,nx2),lat2(ny2,nx2),lat2(ny2,0),lat2(0,0)/)
> datatondc(map, xbox, ybox, xbox_out, ybox_out)
> gsn_polyline_ndc(wks, xbox_out, ybox_out, lnres)
> ; domain 2 idx
> gsn_text_ndc(wks, "d02" , xbox_out(3), ybox_out(3), txres)
>
>
>
>
>
>
>
> ------------------ Original ------------------
> *From: * "Rick Brownrigg";<brownrig at ucar.edu>;
> *Date: * Thu, Apr 2, 2015 00:47 AM
> *To: * "LI Qi"<liqi123sh at qq.com>;
> *Cc: * "ncl-talk"<ncl-talk at ucar.edu>;
> *Subject: * Re: [ncl-talk] add string on each domain
>
> Hi,
>
> There's probably a couple of ways to do this. gsn_add_text allows you to
> add and position text in the coordinate space of the data:
>
> http://ncl.ucar.edu/Document/Graphics/Interfaces/gsn_add_text.shtml
>
>
> In the example script you referenced, you'd want to make this call before
> the call to "draw(map)" for plot 3.
>
> Alternatively, you can position the text in normalized-device-coordinate
> space (NDC-space) using gsn_text_ndc():
>
> http://ncl.ucar.edu/Document/Graphics/Interfaces/gsn_text_ndc.shtml
>
> Look in particular at how the nested domain's outline was drawn *on top
> of* plot3 using NDC coordinates:
>
> ; PLOT 3
> draw(map) ; domain 2 already overlaid here - so just draw again
> xbox = (/lon2(0,0),lon2(0,nx2),lon2(ny2,nx2),lon2(ny2,0),lon2(0,0)/)
> ybox = (/lat2(0,0),lat2(0,nx2),lat2(ny2,nx2),lat2(ny2,0),lat2(0,0)/)
> datatondc(map, xbox, ybox, xbox_out, ybox_out)
> gsn_polyline_ndc(wks, xbox_out, ybox_out, lnres)
>
> Hope that helps...
>
> Rick
>
>
>
>
> On Tue, Mar 31, 2015 at 8:35 PM, LI Qi <liqi123sh at qq.com> wrote:
>
>> Hello NCL community,
>>
>> I was wondering how to add strings like d01 and d02 in the top-left
>> corner of each domain separately.
>>
>> The plot of nested domains is shown below.
>> (
>> http://www2.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/Examples/EXPERIMENTAL/wrf_overlay_doms.htm
>> )
>>
>>
>>
>>
>> _______________________________________________
>> 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
>
>
--
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/20150402/ec140b24/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2BFCF807 at AA32EF10.36FD1C55
Type: application/octet-stream
Size: 291528 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150402/ec140b24/attachment-0002.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2FFFF406 at AA32EF10.36FD1C55
Type: application/octet-stream
Size: 279677 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150402/ec140b24/attachment-0003.obj
More information about the ncl-talk
mailing list