; ; File: test_titles.ncl ; ; Date: 1 April 2011 ; ; Purpose: Demonstrate the issue with gsnLeftString and gsnRightString if ; one is missing "tall" characters, and pmLabelBarWidthF. ; ;_________________________________________________________________________________ ; Load NCL Library Scripts load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl" ; Plot resources res = True res@mpProjection = "LambertConformal" ; Map projection res@mpLambertMeridianF = 265 ; Meridian (from cwolff script) res@mpLambertParallel1F = 25 ; Parallel 1 (from cwolff script) res@mpLambertParallel2F = 25 ; Parallel 2 (from cwolff script) res@mpLimitMode = "Corners" ; Choose map limit mode res@mpLeftCornerLatF = 22.5 ; Southern latitude bound res@mpLeftCornerLonF = -122.5 ; Western longitude bound res@mpRightCornerLatF = 52.0 ; Northern latitude bound res@mpRightCornerLonF = -60.0 ; Eastern longitude bound res@mpFillOn = False ; Turn off map fill res@mpPerimOn = True ; Turn on map perimeter res@mpDataBaseVersion = "Ncarg4_1" ; Map database res@mpOutlineBoundarySets = "National" ; Outline database set res@mpOutlineSpecifiers = (/"Canada : Provinces",\ "United States : States"/) ; Outlines to draw from the set res@cnFillDrawOrder = "Predraw" ; Contour draw order res@cnFillOn = True ; Fill contours res@cnLinesOn = False ; Turn off contour lines res@cnRasterModeOn = True ; Turn on raster fill res@cnLevelSelectionMode = "ExplicitLevels" ; Turn contour to explicit (defined for each plot) res@gsnMaximize = True ; Mazimize the plot res@gsnShape = True ; Scale the X and Y axes res@gsnAddCyclic = False ; Turn off cyclic for regional (non-global) data res@gsnDraw = False ; Don't draw res@gsnFrame = False ; Don't frame the plot res@gsnLeftStringFontHeightF = 0.018 ; Left title font height res@gsnRightStringFontHeightF = 0.018 ; Right title font height res@trGridType = "Curvilinear" ; Use the curvilinear grid res@vpWidthF = 1.0 ; Set the view width to 1.0 res@pmLabelBarOrthogonalPosF = -0.10 ; Move the label bar up closer to the plot res@lbBoxMinorExtentF = 0.12 ; Adjust how skinny the boxes appear res@lbTitlePosition = "Bottom" ; Place the color bar label on the bottom res@lbTitleFontHeightF = 0.015 ; Size of color bar label res@lbTitleOffsetF = -0.4 ; How far from the box labels is the title res@lbLabelOffsetF = 0.05 ; How far from the boxes are the box labels ; Open workstation for plot wks_type = "png" wks_type@wkWidth = 1000 wks_type@wkHeight = 800 outfile = "testtitles" wks = gsn_open_wks(wks_type,outfile) ;**************************** Title Testing **********************************; ; This string has no characters that extend below the line res@gsnRightString = "No tall characters here to look the same as left" ; This string has characters that extend below the line res@gsnLeftString = "Probability @ FL 030" ;******************************************************************************; ;*************************** Label Bar Testing ********************************; ; When this is set to 1.0 and vpWidthF is 1.0, the plot area is a specific size, but ; reducing this value to 0.95 causes the plot area to become "bigger". I would assume ; reducing the label bar width would not change the plot size but this does not appear ; to be the case. res@pmLabelBarWidthF = 0.95 ;******************************************************************************; ; Define some dummy data dumdata = new((/225,301/),float) ; Plot the map and dummy data plot = gsn_csm_contour_map(wks,dumdata,res) draw(plot) frame(wks)