Color bar positioning problem

From: <Oliver.Fuhrer_at_nyahnyahspammersnyahnyah>
Date: Fri, 1 May 2009 09:48:10 +0200

 <<SnagIt1.png>> Hi all!

I'm trying to position a color bar on my plot using NDC coordinates. The
color bar seems to shift around rather unexpectedly with changing the
label font size (see attached png). Is this a bug or a feature? If the
latter, how can I manage to position my color bar exactly in NDC
coordinates?

Thanks,
Oli

-------- cbarproblem.ncl ------------

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
begin

; define workspace
wks_type = "ps"
wks_type_at_wkOrientation = "landscape"
wks = gsn_open_wks(wks_type, "cbarproblem")
gsn_define_colormap(wks,"cosam12")
map = gsn_retrieve_colormap(wks)

;draw grid
drawNDCGrid(wks)

; draw labelbar
levels = fspan(1.0,12.0,12)
labels = levels+""
r = True
r_at_lbPerimOn = False
r_at_lbBottomMarginF = 0.0
r_at_lbTitleOn = False
r_at_lbTopMarginF = 0.0
r_at_lbLeftMarginF = 0.0
r_at_lbRightMarginF = 0.0
r_at_lbJustification = "TopLeft"
r_at_lbOrientation = "Vertical"
r_at_lbAutoManage = False
r_at_vpWidthF = 0.1
r_at_lbBoxMinorExtentF = 0.2
r_at_lbLabelsOn = True
r_at_lbLabelAlignment = "InteriorEdges"
r_at_lbLabelJust = "CenterLeft"
r_at_lbMonoFillPattern = True
r_at_lbFillColors = map(1:dimsizes(levels),:)
r_at_vpHeightF = 0.4
ypos = 0.8
do i=0,3
  xpos = 0.2 + 0.2*i
  if (i.eq.0) then
    r_at_lbLabelFontHeightF = 0.01
  end if
  if (i.eq.1) then
    r_at_lbLabelFontHeightF = 0.02
  end if
  if (i.eq.2) then
    r_at_lbLabelFontHeightF = 0.05
  end if
  if (i.eq.3) then
    r_at_lbLabelFontHeightF = 0.1
  end if
  gsn_labelbar_ndc(wks,dimsizes(levels)+1,labels,xpos,ypos,r)
end do
delete(levels)
delete(labels)
delete(r)
delete(map)

; finish plot
frame(wks)
delete(wks)

end

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

SnagIt1.png
Received on Fri May 01 2009 - 01:48:10 MDT

This archive was generated by hypermail 2.2.0 : Fri May 01 2009 - 15:10:00 MDT