Re: remove 3rd a Border

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri Oct 16 2009 - 06:32:20 MDT

Hi Louis,

This function is specifically meant to provide that 3rd axis,
and unfortunately there's no simple way to turn it off.

In case the work-around doesn't work for you, I've attached a modified
version of gsn_csm_xy3 (called gsn_csm_xy3_no3rdaxis) if you want to
give it a try.

Load the scripts with:

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "gsn_csm_xy3_no3rdaxis.ncl"

and then call it instead of gsn_csm_xy3:

   plot = gsn_csm_xy3_no3rdaxis(wks,lon,t,u,v,res1,res2,res3)

--Mary

On Wed, 14 Oct 2009, Adam Phillips wrote:

> Hi Louis,
> I don't know of a way to turn off the 3rd axis border. Thus,
> I would think the easiest thing to do would be to use the
> res3@amOrthogonalPosF resource to move the 3rd y-axis border
> right over the first y-axis border. In the example you
> reference (xy #19), amOrthogonalPosF is used to shift the
> 3rd y-axis border to the right. Perhaps you can shift it
> enough to exactly overlay it with the 1st y-axis.
>
> If that advice doesn't help, let us know.
> Best regards,
> Adam
>
> louis Vonder wrote:
>> Dear all,
>>
>> On the attached object it is and figure inspired
>> from www.ncl.ucar.edu/Applications/Scripts/xy_19.ncl.
>>
>> But in my example I am trying to remove the 3rd axis by setting this
>>
>> res3@tmYRBorderOn = False
>> res3@tmYLBorderOn = False
>> res3@tmYLMajorLineColor = "white"
>> res3@tmYRMajorLineColor = "white"
>>
>> Despite these settings the results is negative !!!
>>
>> here the script I am using.
>>
>>
>> ;*****************************************************
>> ;xy_19.ncl
>> ;*****************************************************
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>> ;*****************************************************
>> begin
>> ; Create variables to contain data.
>> ;
>>
>> data1 = asciiread("SMT3_Area_025_213_233K", (/48, 6/), "float")
>> data2 = asciiread("SMT3_Area_025_233_253K", (/48, 6/), "float")
>> data3 = asciiread("SMT3_Area_025_253_273K", (/48, 6/), "float")
>>
>> time = fspan(1, 48, 48)
>>
>>
>>
>>
>>
>> wks = gsn_open_wks("eps", "figure") ; open a ps file
>>
>> plot = new(6, graphic) ; create a plot array
>>
>>
>>
>> res = True
>> res@gsnDraw = False ; don't draw
>> res@gsnFrame = False ; don't advance frame
>> res@vpXF = 0.2
>> res@vpWidthF = 0.6
>> res@vpYF = 0.9
>> res@vpHeightF = 0.665
>>
>> res@gsnRightString = " "
>>
>>
>> res@tmXBLabelsOn = False ; do not draw bottom labels
>> res@tmXBOn = False ; no bottom tickmarks
>> res@tmYRLabelsOn = False ; no right labels
>> res@tmYROn = False ; no right tickmarks
>>
>>
>> res1 = True
>> res2 = True
>> res3 = True
>>
>> ; Adding Y grid line
>>
>> res1@tmYMajorGrid = False ; Turn on vertical lines
>> res1@tmYMajorGridThicknessF = 0.025
>> res1@tmYMajorGridLineDashPattern = 2
>>
>> res1@tmXMajorGrid = False ; Turn on vertical lines
>> res1@tmXMajorGridThicknessF = 0.025
>> res1@tmXMajorGridLineDashPattern = 2
>>
>>
>> ; res1@tmXUseBottom = False ; Keep top axis independent of bottom.
>> ; res1@tmXTLabelsOn = True ; have tick mark labels
>> ; res1@tmXTOn = True ; have tick marks
>>
>>
>> res1@tmXUseBottom = False ; Keep top axis independent of bottom.
>> res1@tmXBLabelsOn = True ; have tick mark labels
>> res1@tmXTOn = False ; have tick marks
>>
>> res1@tmXBMode = "Explicit" ; label independently
>> res1@tmXBValues = (/2, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46/)
>> res1@tmXBLabels = (/"12", "14", "16", "18", "20", "22", "00",
>> "02", "04", "06", "08", "10"/)
>>
>>
>> res1@tmXTMode = "Explicit" ; label independently
>> res1@tmXTValues = (/2, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46/)
>> res1@tmXTLabels = (/"12", "14", "16", "18", "20", "22", "00",
>> "02", "04", "06", "08", "10"/)
>>
>>
>> res1@gsnDraw = False ; don't draw yet
>> res1@gsnFrame = False ; don't advance frame yet
>>
>>
>> res1@vpHeightF = 0.4 ; change aspect ratio of plot
>> res1@vpWidthF = 0.8
>>
>> res1@gsnMaximize = True
>> res1@trXMaxF = max(time) ; Control end of X axis
>> res1@trXMinF = min(time) ; Control end of X axis
>>
>>
>> res1@tiXAxisFontHeightF = 0.03
>>
>> res1@xyLineColor = "black" ; t
>> res2@xyLineColor = "black" ; u
>> res3@xyLineColor = "black" ; v
>>
>> res1@xyLineThicknesses = 1.5
>> res2@xyLineThicknesses = 1.5
>> res3@xyLineThicknesses = 2.5
>>
>>
>> res1@xyDashPattern = 0.
>> res2@xyDashPattern = 0.
>> res3@xyDashPattern = 0.
>>
>> ; res3@xyDashPatterns = NhlNewDashPattern(wks, pattern3)
>>
>>
>>
>> ; res1@tiYAxisString = "213K ~F0~~F34~#~F0~ Tb ~F0~~F34~#~F0~ 233K"
>> ; res2@tiYAxisString = "233K ~F0~~F34~#~F0~ Tb ~F0~~F34~#~F0~ 253K"
>> ; res3@tiYAxisString = "253K ~F0~~F34~#~F0~ Tb ~F0~~F34~#~F0~ 273K"
>>
>>
>> ; res1@tiYAxisString = "210K ~F0~~F34~#~F0~ T~B~b~N~ ~F0~~F34~#~F0~
>> 220K"
>> ; res2@tiYAxisString = "233K ~F0~~F34~#~F0~ T~B~b~N~ ~F0~~F34~#~F0~
>> 253K"
>> ; res3@tiYAxisString = "263K ~F0~~F34~#~F0~ T~B~b~N~ ~F0~~F34~#~F0~
>> 283K"
>>
>>
>> res3@amOrthogonalPosF = 0.7 ; Move "v" axis line to right a little.
>>
>>
>> res1@xyDashPattern = 0 ; Make curves all solid
>> res1@xyMarkLineMode = "MarkLines" ; Markers *and* lines
>> res1@xyMarkers = (/16/) ; 3 different markers
>> res1@xyMarkerColors = (/"black"/) ; 3 different colors
>> res1@xyMarkerSizeF = 0.015
>>
>> res2@xyDashPattern = 0 ; Make curves all solid
>> res2@xyMarkLineMode = "MarkLines" ; Markers *and* lines
>> res2@xyMarkers = (/0/) ; 3 different markers
>> res2@xyMarkerColors = (/"black"/) ; 3 different colors
>> res2@xyMarkerSizeF = 0.015
>>
>> res3@xyDashPattern = 0 ; Make curves all solid
>> res3@xyMarkLineMode = "MarkLines" ; Markers *and* lines
>> res3@xyMarkers = (/1/) ; 3 different markers
>> res3@xyMarkerColors = (/"black"/) ; 3 different colors
>> res3@xyMarkerSizeF = 0.015
>>
>>
>> res3@tmYLMajorLengthF = 0.03
>> res3@tmYLMinorLengthF = 0.015
>>
>> res1@tmXBLabelsOn = False
>> res1@tmXBOn = False ; no bottom tickmarks
>>
>> ; res1@tmXBLabelsOn = True
>> ; res1@tmXBOn = True ; no bottom tickmarks
>>
>>
>> res1@tmYLLabelsOn = False ; have tick mark labels
>> res2@tmYLLabelsOn = False ; have tick mark labels
>> res3@tmYLLabelsOn = False ; have tick mark labels
>>
>> res1@tmYRLabelsOn = False ; have tick mark labels
>> res2@tmYRLabelsOn = False ; have tick mark labels
>> res3@tmYRLabelsOn = False ; have tick mark labels
>>
>> res1@tmYLOn = False ; have tick marks
>> res2@tmYLOn = False ; have tick marks
>> res3@tmYLOn = False ; have tick marks
>>
>> res1@tmYROn = False ; have tick marks
>> res2@tmYROn = False ; have tick marks
>> res3@tmYROn = False ; have tick marks
>>
>> res3@tmYRBorderOn = False
>> res3@tmYLBorderOn = False
>> res3@tmYLMajorLineColor = "white"
>> res3@tmYRMajorLineColor = "white"
>>
>> ; res1@gsnRightStringFontHeightF = 0.03
>> ; res1@gsnRightString = "Region 1"
>> plot(0) = gsn_csm_xy3(wks, time, data1(:,0), data2(:,0), data3(:,0),
>> res1, res2, res3)
>> ; res1@gsnRightString = "Region 2"
>> plot(1) = gsn_csm_xy3(wks, time, data1(:,1), data2(:,1), data3(:,1),
>> res1, res2, res3)
>> ; res1@gsnRightString = "Region 3"
>> plot(2) = gsn_csm_xy3(wks, time, data1(:,2), data2(:,2), data3(:,2),
>> res1, res2, res3)
>>
>> ; res1@gsnRightString = "Region 4"
>> plot(3) = gsn_csm_xy3(wks, time, data1(:,3), data2(:,3), data3(:,3),
>> res1, res2, res3)
>>
>> res1@tmXBLabelsOn = False
>> res1@tmXBOn = False ; no bottom tickmarks
>> res1@tiXAxisString = "LST"
>> res1@tmXBLabelsOn = True
>> res1@tmXBOn = True ; no bottom tickmarks
>> res1@tmXBMinorOn = True
>>
>> ; res1@gsnRightString = "Region 5"
>> plot(4) = gsn_csm_xy3(wks, time, data1(:,4), data2(:,4), data3(:,4),
>> res1, res2, res3)
>> ; res1@gsnRightString = "Region 6"
>> plot(5) = gsn_csm_xy3(wks, time, data1(:,5), data2(:,5), data3(:,5),
>> res1, res2, res3)
>>
>>
>>
>> ;************************************************
>> ; create panel
>> ;************************************************
>> resP = True ; modify the panel plot
>> resP@gsnFrame = False ; don't advance panel plot
>> resP@gsnPanelLabelBar = False ; add common colorbar
>> resP@gsnMaximize = True
>>
>> ; resP@gsnPanelFigureStrings = (/"1", "2", "3", "4", "5", "6"/) ; add
>> strings to panel
>> ; res@txFontHeightF = .25
>> resP@amJust = "TopLeft"
>> resP@gsnPanelFigureStringsPerimOn = False
>> resP@txString = " "
>> resP@tiXAxisString = " "
>> resP@tiYAxisString = " "
>> resP@gsnMaximize = True
>> ; resP@gsnPanelBottom = 0.05 ; add space at
>> bottom
>> gsn_panel(wks, plot, (/3, 2/), resP) ; now draw as one plot
>>
>>
>>
>> lres = True
>> lres@lgLineColors =(/"black", "black", "black"/)
>> lres@lgMonoMarkerIndex = False
>> lres@lgMarkerIndexes = (/1, 0, 16/)
>> lres@lgMarkerSizeF = 0.009
>> lres@vpWidthF = 0.16 ; Change width and
>> lres@vpHeightF = 0.07 ; height of legend.
>> lres@lgPerimOn = False ; turn off box around
>> lres@lgLabelFontHeightF = 0.18 ; label font height
>> ;lres@lgDashIndexes = (/0, 0, NhlNewDashPattern(wks, pattern3)/)
>> lres@lgDashIndexes = (/0., 0., 0./)
>> lres@lgLineThicknessF = 3.0
>> lres@lgLineLabelStrings = (/"", "", ""/) ; no labels in lines
>> lres@lgItemType = "MarkLines"
>> lres@lgMarkerColors = (/"black", "black", "black"/)
>> gsn_legend_ndc(wks, 3, (/"253K ~F0~~F34~#~F0~ Tb ~F0~~F34~#~F0~ 273K",
>> "233K ~F0~~F34~#~F0~ Tb ~F0~~F34~#~F0~ 253K", "213K ~F0~~F34~#~F0~ Tb
>> ~F0~~F34~#~F0~ 233K"/), 0.18, 0.68, lres)
>>
>>
>>
>>
>> xtres = True
>> xtres@txFontHeightF = 0.03
>> xtres@txAngleF = 0.
>> gsn_text_ndc(wks, "1",.4, .78, xtres)
>> gsn_text_ndc(wks, "2",.9, .78, xtres)
>>
>> gsn_text_ndc(wks, "3",.4, .55, xtres)
>> gsn_text_ndc(wks, "4",.9, .55, xtres)
>>
>> gsn_text_ndc(wks, "5",.35, .32, xtres)
>> gsn_text_ndc(wks, "6",.9, .32, xtres)
>>
>>
>> frame(wks)
>>
>> end
>>
>> Thanks
>>
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> --
> __________________________________________________
> Adam Phillips
> asphilli@ucar.edu
> National Center for Atmospheric Research tel: (303) 497-1726
> Climate and Global Dynamics Division fax: (303) 497-1333
> P.O. Box 3000
> Boulder, CO 80307-3000 http://www.cgd.ucar.edu/cas/asphilli
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Fri, 16 Oct 2009 06:32:20 -0600 (MDT)

This archive was generated by hypermail 2.1.8 : Thu Oct 22 2009 - 12:22:52 MDT