[ncl-talk] Bar Graph Overlap

Rick Brownrigg brownrig at ucar.edu
Fri May 31 11:18:19 MDT 2019


Hi Zach,

I've studied this, and I am not sure what is going on.  I speculate that
since the xy plots are drawn independently, their x-axis are also
independent, but the positioning of the bars is at the same spot
*graphically* rather than in data-space. (make sense?)

Also, I'm confused by these settings:  tmXBValues = (/11,12,1,2,3/).
The docs for tmXBValues state the values should be monotonically
increase/decreasing (?)

Here is an example that looks like what I think you might be going for;
perhaps it will yield some insights:
    http://ncl.ucar.edu/Applications/Images/unique_5_lg.png

Hope that helps...
Rick

On Thu, May 30, 2019 at 9:54 PM Zach Rieck <zrr817 at gmail.com> wrote:

> 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
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190531/c6b320ee/attachment.html>


More information about the ncl-talk mailing list