[ncl-talk] Contour plots Overlay

Adam Phillips asphilli at ucar.edu
Fri Nov 1 12:30:52 MDT 2019


Hi Melissa,
The vertical axis labels are not tied to the coordinate variables of your 2
arrays per se. The coordinate variables will tell NCL what range to show on
the Y-axis though. In the example I sent I used the same array and split it
in two, but the same principle will hold true if you have two completely
different datasets.  I just modified the script to read in a 2nd dataset
and to use that as upper contour field. I had to modify the time coordinate
variable on the 2nd dataset to be of the same type (months since January
1979) so that things lined up. Note that the two datasets do not have to
cover the same number of timesteps though.
Adam



On Fri, Nov 1, 2019 at 12:05 PM MELISSA KAZEMI RAD <
mk1369 at scarletmail.rutgers.edu> wrote:

> Hi Adam,
>
> Thank you for the comment. However, what I want to do is draw the base
> plot such that it only occupies the lower half of the plot space, and for
> gsn_csm_contour to overwrite the vertical axis labels regardless of the
> vertical levels of the base plot, and that is a different effect. Your data
> extends further beyond the point where the filled contour plot stops. But I
> have two datasets with different number of vertical levels and different
> ranges of values.
>
> Melissa
>
> On Fri, Nov 1, 2019 at 1:48 PM Adam Phillips <asphilli at ucar.edu> wrote:
>
>> Hi Melissa,
>> I think all you need to do is to set trYMinF appropriately. I modified
>> Pressure vs Time example #3 to replicate what you are doing:
>> http://www.ncl.ucar.edu/Applications/height_time.shtml#ex3
>>
>> Setting trYMinF results in a warning but everything looks good. I've
>> attached the modified script and the resulting plot.
>> Adam
>>
>> On Fri, Nov 1, 2019 at 10:21 AM MELISSA KAZEMI RAD via ncl-talk <
>> ncl-talk at ucar.edu> wrote:
>>
>>> Hi,
>>>
>>> I have an urgent problem. I have two 2D datasets with dimensions height
>>> and time. However, they differ in their height dimension size; one has 26
>>> vertical levels that ranges from 0 to 1500 m, the other 100 vertical levels
>>> that range from 0 to 3000 m. I'd like to overlay the second dataset (line
>>> contour) on the first one (filled contour), but I'm running into problems
>>> because the base plot has fewer vertical levels. I tried res at tfDoNDCOverlay
>>>        = True but it's not working.
>>>
>>> I was wondering how I could achieve this overlay. what I'd like to be
>>> able to draw the base contour plot so that it takes the lower half of the
>>> plot, and then overlay the line contour plot, and then write the Y axis
>>> labels that range from 0 to 3000.
>>>
>>> I'd really appreciate any help.
>>> Melissa
>>>
>>> --
>>> *Melissa Kazemi Rad*
>>> *Atmospheric Sciences Department*
>>> *Rutgers University*
>>> _______________________________________________
>>> 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>
>>
>
>
> --
> *Melissa Kazemi Rad*
> *Atmospheric Sciences Department*
> *Rutgers University*
>


-- 
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/20191101/748b07f9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: h_time_3.ncl
Type: text/x-ncl
Size: 2350 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20191101/748b07f9/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: h_time.png
Type: image/png
Size: 183832 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20191101/748b07f9/attachment.png>


More information about the ncl-talk mailing list