[ncl-talk] Bar Graph Overlap

Zach Rieck zrr817 at gmail.com
Thu May 30 21:53:08 MDT 2019


To Whom it May Concern-

I have a bar chart where I'm trying to compare monthly averages for 2
different data sets (5 months). I have set the resources for label bar to
the right location and have the right font size, but I'm not sure why my
data seems to be overlapping on top of itself. I have an offset set up
where one plot is set to be at .675 of each plot point and the other is set
at .925, which is more than the thickness of the bars.

I have attached the plot and code, and will list the resource section of my
code below Thanks in advance for any help you can provide.
    wks2 = gsn_open_wks("pdf", "Trial_Lake_Monthly_Avgs")
    sres = True
    sres at gsnDraw = True
    sres at gsnFrame = False
    sres at gsnXYBarChart = True
    sres at gsnXYBarChartBarWidth = 0.15
    sres at tmXBMode          = "Explicit"
    sres at tmXBLabelFontHeightF = 0.0205
    sres at tmXTLabelFontHeightF = 0.0205
    sres at tmYLLabelFontHeightF = 0.0225
    sres at tiMainFontHeightF = 0.025
    sres at tiMainFont = "helvetica"
    sres at tiMainString = "Trial Lake 40.68 N 110.95W elev 9945 ft"
    sres at tmXBValues = (/11,12,1,2,3/)
    sres at tmXBLabels = (/"Nov","Dec","Jan","Feb","Mar"/)
    sres at gsnXYBarChartColors = (/"red"/)
    plot2 = gsn_csm_xy(wks2,fspan(.675,4.675,5),WRF_avgs,sres)
    sres at gsnXYBarChartColors = (/"blue"/)
    plot3 = gsn_csm_xy(wks2,fspan(.925,4.925,5),SN_avgs,sres)

    lbres                    = True          ; labelbar only resources
    lbres at vpWidthF           = 0.1           ; labelbar width
    lbres at vpHeightF          = 0.1           ; labelbar height
    lbres at lbBoxMajorExtentF  = 0.36          ; puts space between color
boxes
    lbres at lbFillColors       = (/"red","blue"/)
    lbres at lbMonoFillPattern  = True          ; Solid fill pattern
    lbres at lbLabelFontHeightF = 0.015         ; font height. default is small
    lbres at lbLabelJust        = "CenterLeft"  ; left justify labels
    lbres at lbPerimOn          = False
    lbres at lgPerimColor   = "white"
    labels = (/"WRF","SNOTEL"/)
    gsn_labelbar_ndc(wks2,2,labels,0.52,0.1,lbres)

Respectfully,

-Zach Rieck
zrr817 at gmail.com
(513)-502-5652
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190530/0f78e503/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Trial_Lake_Monthly_Avgs.pdf
Type: application/pdf
Size: 52223 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190530/0f78e503/attachment-0002.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Trial_Lake.pdf
Type: application/pdf
Size: 211544 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190530/0f78e503/attachment-0003.pdf>


More information about the ncl-talk mailing list