Alignment of Labelbar boxes

From: Stuart Moore <Stuart.Moore_at_nyahnyahspammersnyahnyah>
Date: Mon Oct 01 2012 - 23:34:03 MDT

Hi,

I am wondering if there is a label bar resource that allows you to ensure that the label bar boxes are in (vertical) alignment with the beginning of the label bar title? I can get this to work by adding leading spaces to the label bar title string but have failed to find a more elegant way so far.

The attached images show the alignment of the label bar boxes without (Unaligned.png) and with (aligned.png) the leading spaces on the label bar title string. The aim is to have all the text strings and label bar boxes aligned vertically down the left hand side of the plot.

I am adding the label bar as an annotation to the plot with the following resources,

;=========================================
nboxes = 9
labels = (/"0", "0 - 0.5", "0.5 - 1.4", "1.4 - 2.8", "2.8 - 5", "5 - 10", "10 - 20", "20 - 40", "> 40"/)

lbres = True
lbres@lbBoxLinesOn = True ; boxes in colour bar
;; lbres@lbTitleString = " 24hr Rainfall (mm)"
lbres@lbTitleString = "24hr Rainfall (mm)"
lbres@lbAutoManage = True
lbres@vpWidthF = 0.4 * vpw
lbres@vpHeightF = 0.4 * vph
lbres@vpXF = 0.2
lbres@vpYF = 1.0
lbres@lbBoxMajorExtentF = 0.85
lbres@lbBoxMinorExtentF = 0.22
lbres@lbLabelFontHeightF = 0.012
lbres@lbAutoManage = False
lbres@lbTitleFontHeightF = 0.015
lbres@lbMonoFillPattern = True
lbres@lbLabelJust = "CenterLeft"
lbres@lbPerimOn = False
lbres@lbLabelOffsetF = 0.1

; reverse labels and colours
lbres@lbFillColors = res1@cnFillColors(::-1) labels = labels(::-1)

lbid = gsn_create_labelbar(wks,nboxes,labels,lbres)
;=========================================

Thanks in advance for any hints, Stuart.

--
Dr Stuart Moore
NIWA, Private Bag 14901, Kilbirnie, Wellington 6241, NZ
Tel: +64 (0)4 386 0569
Email: stuart.moore@niwa.co.nz
--
Please consider the environment before printing this email.
NIWA is the trading name of the National Institute of Water & Atmospheric Research Ltd.



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

Unaligned.png
aligned.png
Received on Tue Oct 2 07:34:25 2012

This archive was generated by hypermail 2.1.8 : Tue Oct 02 2012 - 13:38:41 MDT