Re: white space for script tm_2.ncl

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed May 25 2011 - 09:06:29 MDT

The white space can be caused by a number of things, but you can start by trying to set gsnPanelYWhiteSpacePercent and/or gsnPanelXWhiteSpacePercent to something less than 5 but greater than 0. It
represents the percentage of white space. It looks like you already have this in your script below, so try making it smaller.

See example 6 at:

http://www.ncl.ucar.edu/Applications/panel.shtml

--Mary

On May 25, 2011, at 8:33 AM, Jiangziqiang wrote:

> Hello,
>
> I did a try for script tm_2.ncl , and I met a minor issue: there is some white space between two plots
> Now I want to decrease the amount of white space, can you help me ?
>
> Many thanks
>
>
> Script tm_2.ncl:
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> begin
> arr = random_uniform(-4.,4.,56)
>
> wks = gsn_open_wks("x11","tm")
> gsn_define_colormap(wks,"gsdtol")
> res = True
>
> ; The following vp resources set the boundaries of the xy plot
> ; in ndc grid space (0.->1.)
> res@vpWidthF = 0.8 ; set width of plot
> res@vpHeightF = 0.3 ; set height of plot
> res@vpXF = 0.1 ; set left hand side start point of plot
> ; as vpWidthF = .8, plot will occupy .1->.9 in NDC coords.
>
> res@trXMinF = 1949 ; set minimum X-axis value
> res@trXMaxF = 2006 ; set maximum X-axis value
>
> res@gsnDraw = False ; don't draw the plots, gsn_panel will draw them
> res@gsnFrame = False ; don't advance the frame, gsn_panel will
> res@txFontHeightF = 0.015 ; set font height of gsn*String
> plot = new(2,graphic) ; preallocate graphics array for two panel plots
> res@tmXBMode = "Manual"
> res@tmXBTickStartF = 1950
> res@tmXBTickEndF = 2005
> res@tmXBTickSpacingF = 5
> res@tmXBLabelsOn = False
> res@gsnLeftString = "tmXBMode = Manual"
> plot(0) = gsn_csm_xy(wks,ispan(1950,2005,1),arr,res)
>
> res@tmXBMode = "Explicit"
> res@tmXBValues = (/1950,1960,1970,1980,1990,2000,2005/)
> res@tmXBLabels = (/"1950","1960","1970","1980","1990","2000","2005"/)
> res@tmXBMinorValues = ispan(1949,2006,1)
> res@tmXBLabelsOn = True
> res@gsnLeftString = "tmXBMode = Explicit"
> plot(1) = gsn_csm_xy(wks,ispan(1950,2005,1),arr,res)
>
> panres = True ; panel resource list
> panres@g snPanelYWhiteSpacePercent = 5.0 ; set spacing vertically between 2 panels
>
> gsn_panel(wks,plot,(/2,1/),panres)
> end
>
> _______________________________________________
> 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 Wed May 25 09:06:40 2011

This archive was generated by hypermail 2.1.8 : Wed May 25 2011 - 09:35:33 MDT