plot and page size

From: Dan Barrie <dbarrie_at_nyahnyahspammersnyahnyah>
Date: Fri, 15 Jun 2007 11:59:40 -0400

Dear ncl users:

The archives detail a great deal of discussion regarding the gsn
resources, particularly the ones that pertain to page size/ plot
maximization. Despite all the talk on this matter, I'm still having a
lingering, yet simple issue with my .ps files and their orientation.
Using only the resource function gsnMaximize, my plot is fitted to the
postscript sheet. However, it is then oriented sideways on my screen. I
understand that you can then use the function gsnPaperOrientation to set
the sheet to a portrait orientation, but then there is a huge white area
both above and below my plot filling the rest of the page, which
eliminates the alteration performed by the gsnMaximize function. I have
tried using the gsnPaperWidth and gsnPaperHeight functions to alter this
large whitespace, but they do not seem to work. It's at this point that
the archived discussion doesn't help address this issue. Can anyone
help? I would rather not use some secondary software package (ie
imagemagick) to rotate the image, since it often leads to resolution
reductions. Thanks!

-Dan

;*************************************************
; ce_3.ncl
;************************************************

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/shea_util.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"

;************************************************

begin

;************************************************
; open file and read in data
;************************************************

  in1 =
addfile("/data/sv3/dbarrie/db008.01/db008.01.cam2.h1.0000-09-01-00000.nc","r")
  in2 =
addfile("/data/sv3/dbarrie/db008.02/db008.02.cam2.h1.0000-09-01-00000.nc","r")

do i=1,72,1

  SLP1 = in1->PSL(i,:,:)
  SLP2 = in2->PSL(i,:,:)
 
;************************************************
; make differences
;************************************************

  SLP = SLP2 - SLP1
  copy_VarCoords(SLP1,SLP)
  copy_VarAtts(SLP1,SLP)
 
;************************************************
; create plot
;************************************************

if (i .lt. 10)
    wks = gsn_open_wks("ps" ,"timeseries0"+i+"")
    else
        wks = gsn_open_wks("ps" ,"timeseries"+i+"")
end if
print(i)

  gsn_define_colormap(wks,"BlAqGrYeOrRe") ; choose colormap

  res = True ; plot mods desired
  res_at_gsnMaximize = True ; Fill entire ps plot space
  res_at_gsnPaperOrientation = "portrait" ; Choose orientation
  res_at_gsnPaperWidth = 9 ; Specify ps document width
  res_at_gsnPaperHeight = 4 ; Specify ps document height
  res_at_cnFillOn = True ; turn on color fill
  res_at_cnLinesOn = False ; turn of contour lines
  res_at_cnLevelSelectionMode = "ManualLevels" ;turn on manual range
  res_at_cnMinLevelValF = -5.0 ; minimum of range
  res_at_cnMaxLevelValF = 5 ; maximum of range
  res_at_cnLevelSpacingF = 0.5 ; contour spacing
  res_at_gsnSpreadColors = True ; use full range of color map
  res_at_lbLabelStride = 4

  res_at_pmTickMarkDisplayMode = "Always"; use NCL default lat/lon labels

  res_at_gsnAddCyclic = False ; data already has cyclic point
                       ; this must also be set for any zoom

; note that the gsn_csm_*map_ce templates automatically set
; res_at_mpLimitMode="LatLon" for you. If you are plotting a different
projection,
; you may have to set this resource.

; res_at_mpMinLatF = -60 ; range to zoom in on
; res_at_mpMaxLatF = 30.
; res_at_mpMinLonF = 30.
; res_at_mpMaxLonF = 120.

  plot = gsn_csm_contour_map_ce(wks, SLP, res)
;************************************************

end do

end
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Jun 15 2007 - 09:59:40 MDT

This archive was generated by hypermail 2.2.0 : Fri Jun 15 2007 - 12:34:56 MDT