[ncl-talk] Histogram using "gsn_csm_xy" res at gsnXYBarChartOutlineOnly = True

Joowan Kim joowan at ucar.edu
Sun Feb 8 17:16:41 MST 2015


Hi Mary
I should read this more carefully.
Thanks for the clear explanation!

Best!
Joowan


On Sun, Feb 8, 2015 at 4:49 PM, Mary Haley <haley at ucar.edu> wrote:

> This is the correct behavior.
>
> Please read the documentation for gsnXYBarChart and
> gsnXYBarChartOutlineOnly at:
>
> http://www.ncl.ucar.edu/Document/Graphics/Interfaces/gsn_csm_xy.shtml
>
>    - *gsnXYBarChart*
>    <http://www.ncl.ucar.edu/Document/Graphics/Resources/gsn.shtml#gsnXYBarChart>
>    - if set to True, then instead of a curve, a bar will be drawn for each Y
>    value. Each bar will be centered around its X location.
>
>    - *gsnXYBarChartOutlineOnly*
>    <http://www.ncl.ucar.edu/Document/Graphics/Resources/gsn.shtml#gsnXYBarChartOutlineOnly>
>    - if set to True, then instead of a curve, you will get a box outline of
>    your curve. This resource is different than the behavior of
>    *gsnXYBarChart*
>    <http://www.ncl.ucar.edu/Document/Graphics/Resources/gsn.shtml#gsnXYBarChart>,
>    because the vertical lines represent the exact location of the X values,
>    and not centered about the X values.
>
> --Mary
>
>
> On Sun, Feb 8, 2015 at 1:48 PM, Joowan Kim <joowan at ucar.edu> wrote:
>
>> Dear NCL experts
>>
>> I'm drawing histogram using, gsn_csm_xy.
>> It is very useful for me as it support drawing only outline of the
>> histogram, res at gsnXYBarChartOutlineOnly = True
>>
>> But I found this option shifts the histogram half of dx (bin size).
>> Is it only my problem or designed like that on purpose?
>> I'm using ncl v6.2.0 in MacOS.
>>
>> please see my testing example below
>> Any comment will be helpful for me!
>>
>> Thanks
>>
>> ----------------------------
>> s = random_normal(0,3,2000)
>> r = True
>> r at bin_max =  5.
>> r at bin_min = -5.
>> y = pdfx(s,10,r)
>> x = y at bin_center
>>
>> w = gsn_open_wks("eps","bar2")
>> o = True
>> o at gsnDraw  = False
>> o at gsnFrame = False
>> o at gsnXYBarChart = True
>> p1 = gsn_csm_xy(w,x,y,o)
>> o at gsnXYBarChartOutlineOnly = True
>> o at xyLineColor = "red"
>> p2 = gsn_csm_xy(w,x,y,o)
>> overlay(p1,p2)
>> draw(p1)
>> frame(w)
>>
>> print("CAUTION: gsnXYBarChartOutlineOnly = True shifts the histogram...")
>> ----------------------------
>>
>>
>> --
>> Joowan Kim
>> Atmospheric Chemistry Division
>> National Center for Atmospheric Research
>> PO Box 3000  Boulder, CO 80307
>> e-mail : joowan at ucar.edu
>>            joowan.k at gmail.com
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>


-- 
Joowan Kim
Atmospheric Chemistry Division
National Center for Atmospheric Research
PO Box 3000  Boulder, CO 80307
e-mail : joowan at ucar.edu
           joowan.k at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150208/5a5f1720/attachment.html 


More information about the ncl-talk mailing list