[ncl-talk] How to restore the "Height" Label

Laura Fowler laura at ucar.edu
Wed Apr 17 14:12:47 MDT 2019


Hi Adam:
I am so glad that you replied to my previous e-mail. Yes, I was able to
plot the YAxis Label "HEIGHT" on the right side of the plot. You are right.
It was there the all time, just not visible because there was too much
space between the two plots. Using vpXF was very helpful. See attached
rh.top_panel.png file.

I wanted to add an other row below that top row using a second gsn_panel as
in panel_14.ncl. Unfortunately, and although I am getting really close, I
am unable to keep the exact same values for the width and height of the
second row as those of the first row. I tried to do the same using
res at vpWidthF and res at vpHeightF but that quite did not work.

I used two separate calls to gsn_panel specifying gsnPanelTop and
gsnPanelBottom (as you suggested in a previous e-mail), but I do see the
width and height varying slightly between the 2 panels (using
gsnPanelDebug).  I must be missing a little something. see

If you have some time to look at my the bottom of my ncl script, I would
really appreciated it. I am also attaching the script.

Thanks,
Laura







On Wed, Apr 17, 2019 at 10:57 AM Adam Phillips <asphilli at ucar.edu> wrote:

> Hi Laura,
> Could the right plot height label be getting pushed off the page? Try
> drawing the 2nd plot on its' own to see.
> Adam
>
> On Mon, Apr 15, 2019 at 1:18 PM Laura Fowler <laura at ucar.edu> wrote:
>
>> Hello:
>>
>> I am drawing a longitude versus pressure panel plot using the procedure
>> gsn_csm_pres_hgt (see test.png). Between the left and the right panels,
>> I do not want any labels  but I want to restore the right labels including
>> "Height (km)" for the right panel. I used the following:
>>
>>
>> nplots = 2
>>
>> plots  = new(nplots,graphic)
>>
>>
>> diag = rhu_gf(nFGLevels|:,lon|:)
>>
>> ;res at gsnLeftStringParallelPosF = -0.05
>>
>> res at gsnLeftString = "a) GFu: RELATIVE HUMIDITY (-)"
>>
>> res at tiYAxisOn     = True
>>
>> res at tmYLOn        = True
>>
>> res at tmYLBorderOn  = True
>>
>> res at tmYROn        = True
>>
>> res at tmYRBorderOn  = True
>>
>> res at tmYRLabelsOn  = False
>>
>> plot = gsn_csm_pres_hgt(wks,diag,res)
>>
>> getvalues plot at contour
>>
>>    "pmAnnoManagers" : am_ids
>>
>> end getvalues
>>
>> index = ind(NhlName(am_ids).eq."right_axis")
>>
>> if(.not.ismissing(index)) then
>>
>>    NhlRemoveAnnotation(plot at contour,am_ids(index))
>>
>> end if
>>
>> plots(0) = plot
>>
>> delete(index)
>>
>> delete(plot)
>>
>>
>> diag = rhv_gf(nFGLevels|:,lon|:)
>>
>> ;res at gsnLeftStringParallelPosF = -0.05
>>
>> res at gsnLeftString = "b) GFv: RELATIVE HUMIDITY (-)"
>>
>> res at tiYAxisOn     = True
>>
>> res at tmYLOn        = True
>>
>> res at tmYLBorderOn  = True
>>
>> res at tmYLLabelsOn  = False
>>
>> res at tmYROn        = True
>>
>> res at tmYRBorderOn  = True
>>
>> res at tmYRLabelsOn  = True
>>
>> plots(1) = gsn_csm_pres_hgt(wks,diag,res)
>>
>>
>> Unfortunately that did not restore the labels and title of the right
>> axis. I wonder if that has to do with using NhlRemoveAnnotation set in plots(0).
>> Is there a way around this?
>>
>> Thanks,
>> Laura
>>
>>
>>
>> --
>>
>> !-------------------------------------------------------------------------------------------------------------
>> Laura D. Fowler
>>
>> Mesoscale and Microscale Meteorology Division (MMM)
>> National Center for Atmospheric Research
>> P.O. Box 3000, Boulder CO 80307-3000
>>
>> e-mail: laura at ucar.edu
>> phone: 303-497-1628
>>
>>
>> !-------------------------------------------------------------------------------------------------------------
>> _______________________________________________
>> 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>
>


-- 
!-------------------------------------------------------------------------------------------------------------
Laura D. Fowler

Mesoscale and Microscale Meteorology Division (MMM)
National Center for Atmospheric Research
P.O. Box 3000, Boulder CO 80307-3000

e-mail: laura at ucar.edu
phone: 303-497-1628

!-------------------------------------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190417/5cea9507/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rh.top_panel.png
Type: image/png
Size: 49154 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190417/5cea9507/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rh3.png
Type: image/png
Size: 85369 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190417/5cea9507/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test2.ncl
Type: application/octet-stream
Size: 6930 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190417/5cea9507/attachment.obj>


More information about the ncl-talk mailing list