[ncl-talk] Overlaying two plots onto the same contour map
Rick Brownrigg
brownrig at ucar.edu
Wed Nov 20 07:34:24 MST 2019
I might also speculate that you have not associated the lon/lat arrays as
"coordinate variables" to the variable "data", as i) that doesn't happen
automatically with ascii data, and ii) that process is not illustrated in
example overlay_12.ncl. When you obtain a plot of one or both plots
separately, do the tick mark labellings look like reasonable geographical
coordinates? Or grid coordinates perhaps?
Check out the following link and search for *Attaching coordinate arrays to
a variable*
There you'll find several examples of how to assign coordinates to your
data.
http://ncl.ucar.edu/Applications/concepts_list.shtml
Rick
On Wed, Nov 20, 2019 at 7:09 AM Rashed Mahmood via ncl-talk <
ncl-talk at ucar.edu> wrote:
> Hi Giulio,
> The following should NOT work in your example (since you are not plotting
> a map plot here):
> tb_plot = gsn_csm_contour_map(wks,tb,tres)
>
> It should be " tb_plot = gsn_csm_contour(wks,tb,tres)"
>
> I do not know if there are other issues, if there are please provide full
> script and a picture and may be the data file.
>
> Cheers,
> Rashed
>
>
>
>
>
>
> On Wed, Nov 20, 2019 at 11:49 AM G.Monte--- via ncl-talk <
> ncl-talk at ucar.edu> wrote:
>
>> Dears all,
>> I have some problems in overlaying two plots onto the same contour map.
>> The data fields to be overlayed are arranged into an ascii file and are
>> read in the following way by NCL 6.4.0:
>> ;---read longitude
>> lon = dataf(:,4)
>>
>> ;---read latitude
>> lat = dataf(:,3)
>>
>> ;---read tb
>> tb = dataf(:,6)
>>
>> ;---read data
>> flag = dataf(:,11)
>>
>> For plotting them, I follwed the template shown in overlay_12.ncl, where I
>> set:
>> ;---Create the two plots
>> tb_plot = gsn_csm_contour_map(wks,tb,tres)
>> vv_plot = gsn_csm_contour(wks,flag,dres)
>> ;---Overlay the vv plot on the tb plot
>> overlay(tb_plot,vv_plot)
>> ;---Drawing the tb plot will also draw vv plot
>> draw(tb_plot)
>> frame(wks)
>>
>> By doing so, only the second data field (named "flag") appeared in the
>> plot, while the first field (named "tb") did not; it appears only if I
>> plot them separately.
>> I really don't understand the reason, I kindly ask you a suggestion.
>>
>> Thank you,
>> Giulio
>>
>> _______________________________________________
>> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20191120/08b91895/attachment.html>
More information about the ncl-talk
mailing list