[ncl-talk] plot orientation

Michael Buban - NOAA Affiliate michael.buban at noaa.gov
Fri Dec 16 13:19:31 MST 2016


Hello,

I'm trying to plot a simple HRRR dataset with a Lambert Conformal grid,
however the plots always come out rotated by 90 degrees.  How do I get the
plot to have LAT up/down and LON left/right?  I've extensive searched
online and none of the proposed fixed have any effect.  Here is my script.

_________________________

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

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

begin


  a = addfile("hrrr.t12z.wrfsfcf01.grib2","r")


  qv = a->DPT_P0_L103_GLC0(:,:) ;

  tk = a->TMP_P0_L103_GLC0(:,:) ;


   lat = a->gridlat_0(:,:)

   lon = a->gridlon_0(:,:)


   tk at lat2d = lat

   tk at lon2d = lon


   qv at lat2d = lat

   qv at lon2d = lon


    printVarSummary(lat)

    printVarSummary(lon)


   ny = 82

   nx = 71



  wks  = gsn_open_wks("X11","gsn_contour")    ; open a ps file


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

; create first plot

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

  resn            = True        ; create vector resource array

  resn at cnFillOn   = True        ; color fill

  resn at cnLinesOn  = False       ; no contour lines


  resn at gsnLeftString    = ""     ; no titles

  resn at gsnRightString   = ""

  resn at tiXAxisString    = ""

  resn at tiYAxisString    = ""


  resn at gsnDraw    = False       ; don't draw

  resn at gsnFrame   = False       ; don't advance frame


  resn at vpWidthF  = 0.8                    ; change the aspect ratio

  resn at vpHeightF = 0.8


  resn at mpDataBaseVersion = "MediumRes"

  resn at pmTickMarkDisplayMode = "Always"


  resn at gsnAddCyclic = False    ; regional data


  resn at mpProjection = "LambertConformal"


  resn at mpLimitMode            = "Corners"          ; choose region of map

  resn at mpLeftCornerLatF       = lat(0,0)

  resn at mpLeftCornerLonF       = lon(0,0)

  resn at mpRightCornerLatF      = lat(ny-1,nx-1)

  resn at mpRightCornerLonF      = lon(ny-1,nx-1)



  resn at cnLevelSelectionMode = "ManualLevels"    ; manually set the contour
levels

  resn at cnMinLevelValF = 260.0

  resn at cnMaxLevelValF = 288.0

  resn at cnLevelSpacingF = 1.0


;  resn at gsnPaperOrientation = "Portrait"


  resn at pmLegendDisplayMode = "Never"

  resn at tiMainOn = False


  plot1 = gsn_csm_contour_map(wks,tk,resn)



  draw(plot1)

  frame(wks)

end


____________________________________


I've tried setting resn at gsnPaperOrientation to "Portrait" and "Landscape",
and gsnMaximize to "True" and "False" with no change in results.


Any help would be appreciated.


Thanks,


Mike



_____________________________________
Michael S. Buban, Ph.D.
Research Associate
NOAA/ARL Atmospheric Turbulence and Diffusion Division
and Oak Ridge Associated Universities
456 South Illinois Avenue
Oak Ridge TN 37830
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161216/408d863c/attachment.html 


More information about the ncl-talk mailing list