Hello,
I am fairly new to ncl and using it for some wrf plotting. I am plotting
greyscale terrain contours overlaid with precip contours, so I am trying
to put one label bar on the bottom and one vertical to the right of the
plot. However, the vertical label bar is showing up beneath the plot
instead (Image attached). It seemed from other examples that setting
@lbOrientation = "vertical" should place it automatically vertical and
to the right? I'm out of ideas.
Thank you,
Tracy
Code:
; Sample script being used to familiarize myself with
; plotting WRF runs in ncl
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
begin
a = addfile("./wrfout_d01_2007-08-06_12:00:00.nc","r")
wks = gsn_open_wks("x11","plt_ter")
; Define precip colormap then merge it with the grayscale map
prcolor = (/"White","White","Ivory", \
"DarkOliveGreen1","Chartreuse", \
"Chartreuse3","Green","ForestGreen", \
"Yellow","Orange","Red","Violet"/)
gsn_merge_colormaps(wks,"gsdtol",prcolor)
; Define/manipulate variables
ter = wrf_user_getvar(a,"HGT",0)
u10 = wrf_user_getvar(a,"U10",0)
u10 = u10*1.94386
u10@units = "kts"
v10 = wrf_user_getvar(a,"V10",0)
v10 = v10*1.94386
v10@units = "kts"
rain_exp = wrf_user_getvar(a,"RAINNC",0)
rain_con = wrf_user_getvar(a,"RAINC",0)
rain_tot = rain_exp + rain_con
rain_tot@description = "Total Precipitation"
times = wrf_user_list_times(a)
; Basic resource options
res = True
res@TimeLabel = times(0)
pltres = True
mpres = True
mpres@tiMainString = "Sample Plot"
mpres@mpGridLineColor = "White"
mpres@mpGridLineDashPattern = 4
mpres@mpOutlineBoundarySets = "National"
mpres@mpGeophysicalLineColor = "White"
mpres@mpGeophysicalLineThicknessF = 2
; Options for plotting terrain height
ot = res
ot@cnFillOn = True
ot@ContourParameters = (/ 0,3000,250/)
ot@gsnSpreadColorStart = 1
ot@gsnSpreadColorEnd = 32
con_ter = wrf_contour(a,wks,ter,ot)
; Options for overlaying precip
op = res
op@cnFillOn = True
op@UnitLabel = "mm"
op@cnLevelSelectionMode = "ExplicitLevels"
op@cnLevels = (/ .1, .2, .4, .8, 1.6, 3.2, 6.4, 12.8, 25.6, 51.2, 102.4/)
op@cnFillColors = (/"Transparent","Transparent","Ivory", \
"DarkOliveGreen1","Chartreuse", \
"Chartreuse3","Green","ForestGreen", \
"Yellow","Orange","Red","Violet"/)
op@lbOrientation = "vertical"
precip = wrf_contour(a,wks,rain_tot,op)
; Options for overlaying wind barbs
ov = res
ov@NumVectors = 30
ov@vcWindBarbColor = "Red"
vec = wrf_vector(a,wks,u10,v10,ov)
; Make the plot
plot = wrf_map_overlays(a,wks,(/con_ter,precip,vec/),pltres,mpres)
end
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
This archive was generated by hypermail 2.1.8 : Thu Jun 30 2011 - 12:54:44 MDT