[ncl-talk] xy vertical profiles
Barry Lynn
barry.h.lynn at gmail.com
Mon May 20 05:26:18 MDT 2019
Hi:
Now I believe I understand.
A "yx" plot is simply one where the axis against which the variable is
plotted is in the y, rather than x position. I had tried this, but I had
forgotten to change my settings for max/min, so m curves were not bounded
correctly.
Here is the code that works.
;---To plot multiple lines, you must put them into a multidimensional array.
data = new((/2,nz/),float)
data(0,:) = qc_1(:)
data(1,:) = qc_2(:)
xaxis = new(nz,integer)
do i = 0,nz-1,1
xaxis(i) = i ; here the "xaxis" is simply set to an integer model level
value.
end do
;---Set plotting parameters
res = True ; plot mods desired
res at tmXTOn = False
res at tmYLFormat = "f" ; remove trailing ".0"
min_h = min(data(:,:))
max_h = max(data(:,:))
res at trYMinF = 0.
res at trYMaxF = nz
res at trXMinF = 0 ; set minimum X-axis value
res at trXMaxF = max_h ; based on maximum mass of plotted variable
label = (/"WRF Standard","WRF SLA"/)
colors = (/"blue","red"/)
res at xyLabelMode = "Custom" ; label a line
res at xyExplicitLabels = label ; text to use
res at xyLineLabelFontHeightF = 0.0150 ; font height
res at xyLineColors = colors ; label color
res at xyLineLabelFontColors = colors ; label color
; res at tiYAxisString = "QC Total [g cm~S~-3~N~]"
; res at tiXAxisString = "Time Interval (five minutes)"
res at tiXAxisString = "QC Total [g cm~S~-3~N~]"
res at tiYAxisString = "Model Level"
res at tiMainString = "weno = " + total_qc_1 + " - sla = " + total_qc_2
; Similar resources are xyLineThicknessF and xyLineColor,
; which will affect all lines in the array.
;
res at xyLineThicknesses = (/ 3.0, 3.0/)
res at xyLineColors = (/"blue","red"/)
;plot = gsn_csm_xy (wks,xaxis,data,res) ; create plot
plot = gsn_csm_xy (wks,data,xaxis,res) ; create plot
On Mon, May 20, 2019 at 1:33 PM Barry Lynn <barry.h.lynn at gmail.com> wrote:
> Hi Dave:
>
> Thank you for your suggestions.
>
> I found something under "profile plots." The first example here is
> similar to what I am looking for.
>
> http://www.hao.ucar.edu/modeling/tgcm/NCL/Graphics/profile.shtml
>
> Note, Ozone is a function of height. Hence, the ozone concentration is
> plotted against the x axis, rather than the y axis as shown in the examples
> on
>
> https://www.ncl.ucar.edu/Applications/xy.shtml
>
> Perhaps there is an appropriate example on your "ncl" page as well?
>
>
>
> On Sun, May 19, 2019 at 8:09 PM Dave Allured - NOAA Affiliate <
> dave.allured at noaa.gov> wrote:
>
>> Oh. If you just want a simple line plot, please see example xy_3 on the
>> XY plots example page.
>>
>>
>> On Sun, May 19, 2019 at 9:22 AM Dave Allured - NOAA Affiliate <
>> dave.allured at noaa.gov> wrote:
>>
>>> Barry,
>>>
>>> The term "vertical profiles" is vague. See if any of these categories
>>> on the NCL examples main web page are close to what you are looking for:
>>>
>>> Latitude vs. time
>>> Press/height vs. latitude
>>> Press/height vs. longitude
>>> Press/height vs. time
>>> Time vs. longitude (Hovmueller)
>>> Time vs. latitude
>>> Transects & Cross Sections
>>> Vertical interpolation
>>>
>>> Otherwise, please say what specific quantities you expect on the X axis,
>>> the Y axis, and the displayed field magnitude or contour levels.
>>> Alternatively it would be helpful if you could find and point to an on-line
>>> image, anywhere, of the type of plot you need.
>>>
>>> --Dave
>>>
>>>
>>> On Sun, May 19, 2019 at 5:27 AM Barry Lynn <barry.h.lynn at gmail.com>
>>> wrote:
>>>
>>>> Hi:
>>>>
>>>> I've been searching the ncl pages for how to create a vertical yx
>>>> profile.
>>>>
>>>> In other words, the variable is plotted against the y axis rather than
>>>> the x axis.
>>>>
>>>> Right now, I have no problem making an xy plot, with multiple curves,
>>>> but I need to map them against the y versus x axis.
>>>>
>>>> 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
>
>
--
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/20190520/85cd9006/attachment.html>
More information about the ncl-talk
mailing list