[ncl-talk] 2nd y-axis label plus...
Mary Haley
haley at ucar.edu
Tue May 26 08:24:36 MDT 2015
Hi Marston,
No need to send me the data, thanks! Glad it's working.
--Mary
On Tue, May 26, 2015 at 7:15 AM, Marston Johnston <shejo284 at gmail.com>
wrote:
> Hi Mary,
>
> The example solution in #19 solved the problem.
> The plots needed to brought closer so that the right titles
> could be seen. The results look great now.
> Thanks a lot!
>
> Do you still need me to send you the data?
>
> /M
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Marston S. Johnston, PhD
> Department of Earth Sciences
> University of Gothenburg, Sweden
> Email: marston.johnston at gu.se
> Phone: +46-31-7862859
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Only the fruitful thing is true!
>
> On 26 May 2015, at 05:32, Mary Haley <haley at ucar.edu> wrote:
>
> Hi Marston,
>
> There are a couple of things you can do to get the plots to be closer
> together.
>
> One thing is to try setting the panel resource "gsnPanelYWhiteSpacePercent
> <http://www.ncl.ucar.edu/Document/Graphics/Resources/gsn.shtml#gsnPanelYWhiteSpacePercent>"
> to something smaller than 1.0 and greater than 0.0.
>
> Another thing you can do is set the special gsnPanelXF resource, which
> allows you to set the x position of each plot in a panel, in order to
> override the default. Setting resP at gsnPanelDebug to True will print the
> default values being used for the x position, allowing you to adjust as
> necessary.
>
> See example panel_19.ncl for more information:
>
> http://www.ncl.ucar.edu/Applications/panel.shtml#ex19
>
>
> Setting res at tmYLLabelsOn to False *should* turn off the Y axis labels. I
> do see that you are calling gsn_csm_xy2, so perhaps this is doing something
> unexpected. It would really help if you could provide us with the data so
> we can run your script, or else provide us with a small test case that
> illustrates the problem.
>
> To change the side of the Y axis title, try setting tiYAxisSide to
> "Right". See example title_8.ncl:
>
> http://www.ncl.ucar.edu/Applications/title.shtml#ex8
>
> I should point out that the gsn_csm_xy2 routine may be trying to control
> some of these features in order to make sure all the labels and tickmarks
> are correct. If you continue to have problems with this routine, then let
> me know.
>
> --Mary
>
>
> On Mon, May 25, 2015 at 12:15 AM, Marston Johnston <shejo284 at gmail.com>
> wrote:
>
>> Hi,
>>
>> I’m trying to complete this figure by making some cosmetic changes.
>> I thought these would be rather easy but I’m missing something. What I
>> would like to do are:
>>
>> 1.) Move the plots closer vertically and remove the y-axis labels.
>> 2.) I added a y2-axis title on the right side of the right column plots.
>> How do I get these to show up?
>> I’ve tried using the tmYLLabelsOn but this doesn’t give me the changes I
>> need. I suspect something is interfering.
>>
>> Would appreciate some advice on this.
>>
>> Thanks in advance!
>> /M
>>
>>
>> plot snip…..
>>
>> wks = gsn_open_wks("pdf","zmean_xy")
>> plot = new(4,graphic)
>> data = new((/3,dimsizes(djfzm&lat)/),double)
>>
>> res = True
>> resR = True
>>
>> res at gsnFrame = False
>> res at gsnDraw = False
>> res at xyLineThicknesses = (/2.0,2.0,2.0/)
>> res at xyLineColors = (/"blue","red","black"/)
>>
>> resR at trYMinF = -4
>> resR at trYMaxF = 30
>> res at trYMinF = 180
>> res at trYMaxF = 300
>>
>> ; add a legend
>> res at pmLegendDisplayMode = "Always" ; turn on legend
>> res at pmLegendSide = "Top" ; Change location of
>> res at pmLegendOrthogonalPosF = -0.65 ; Move into plot
>> res at pmLegendParallelPosF = 0.35 ; Move to right
>> res at pmLegendWidthF = 0.2 ; Decrease width
>> ;res at pmLegendHeightF = 0.1 ; Decrease height
>> res at lgBoxMinorExtentF = 0.2 ; Shorten the legend lines
>> res at lgLabelFontHeightF = 0.02 ; Change the font size
>> res at lgPerimOn = False ; no box around
>> res at xyExplicitLegendLabels = (/"EC-Earth","NOAA18"/)
>>
>> resR at xyLineThicknesses = 2. ; thicker line
>>
>> ; GRID lines
>> res at tmXMajorGrid = True ; implement x grid
>> res at tmXMajorGridThicknessF = 1.0 ; 2.0 is default
>> res at tmXMajorGridLineDashPattern = 2 ; select short dash
>> lines
>> resR at tmYMajorGrid = True ; implement y grid
>> resR at tmYMajorGridThicknessF = 1.0 ; 2.0 is default
>> resR at tmYMajorGridLineDashPattern = 2 ; select short dash
>> lines
>>
>> res at tiYAxisString = "Brightness Temperature [K]" ; y-axis title
>> ;res at tmXBLabelsOn = False ; do not draw bottom
>> labels
>> ;resR at tmYRLabelsOn = False ; no right labels
>> ;res at tmYLLabelsOn = True
>> data(0,:) = djfzm
>> data(1,:) = djfozm
>> data(2,:) = djfzm - djfozm
>> plot(0) = gsn_csm_xy2 (wks,djfzm&lat,data(0:1,:),data(2,:),res,resR)
>>
>> ;**************************
>> res at pmLegendDisplayMode = "Never"
>> res at tiYAxisString = "" ; y-axis title
>> ;res at tmYLLabelsOn = False ; left labels
>>
>> resR at tiYAxisString = "EC-Earth - NOAA18 [~F33~D K]" ; y2-axis title
>> ;resR at tmYRLabelsOn = True ; right labels
>>
>> data(0,:) = mamzm
>> data(1,:) = mamozm
>> data(2,:) = mamzm - mamozm
>> plot(1) = gsn_csm_xy2 (wks,mamzm&lat,data(0:1,:),data(2,:),res,resR)
>>
>> res at tiYAxisString = "Brightness Temperature [K]" ; y-axis title
>> resR at tiYAxisString = "" ; y-axis title
>> res at tiXAxisString = "Latitude" ; x-axis title
>> ;res at tmXBLabelsOn = True ; draw bottom labels
>> ;resR at tmYRLabelsOn = False ; right labels
>> ;res at tmYLLabelsOn = True ; left labels
>> data(0,:) = jjazm
>> data(1,:) = jjaozm
>> data(2,:) = jjazm - jjaozm
>> plot(2) = gsn_csm_xy2 (wks,jjazm&lat,data(0:1,:),data(2,:),res,resR)
>>
>> res at tiYAxisString = "" ; y-axis title
>> resR at tiYAxisString = "EC-Earth - NOAA18 [~F33~D K]" ; y2-axis title
>> res at tiXAxisString = "Latitude" ; x-axis title
>> ;res at tmYRLabelsOn = True ; right labels
>> ;res at tmYLLabelsOn = False ;left labels
>> ;resR at tmYRLabelsOn = True
>> data(0,:) = sonzm
>> data(1,:) = sonozm
>> data(2,:) = sonzm - sonozm
>> plot(3) = gsn_csm_xy2 (wks,sonzm&lat,data(0:1,:),data(2,:),res,resR)
>>
>> resP = True
>> resP at gsnMaximize = True
>> gsn_panel(wks,plot,(/2,2/),resP)
>>
>> ***************
>>
>>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> Marston S. Johnston, PhD
>> Department of Earth Sciences
>> University of Gothenburg, Sweden
>> Email: marston.johnston at gu.se
>> Phone: +46-31-7862859
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> Only the fruitful thing is true!
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> 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/20150526/24f0c396/attachment.html
More information about the ncl-talk
mailing list