Re: Replace Frequency With Percent in Histogram

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Mar 17 2010 - 10:22:24 MDT

Hi Dan,

The histogram code only allows you to put these special labels on the
right.

If you want to put them on the left, you will need to make a personal
copy of $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl and edit it.

Where you see the lines:

       set_attr(res2,"tmYUseLeft", False)
       set_attr(res2,"tmYROn",True)
       set_attr(res2,"tmYRLabelsOn",True)
       set_attr(res2,"tmYRMode","Explicit")
       set_attr(res2,"tmYRValues",bins_at_pnice)
       set_attr(res2,"tmYRMinorValues",bins_at_pmnice)
       if(percentsign)
         set_attr(res2,"tmYRLabels",pnice+"%")
       else
         set_attr(res2,"tmYRLabels",pnice)
       end if

You will want to change YR to YL.

I haven't actually tested this, so let me know if it doesn't work.

You will also need to do Dennis' suggestion below of setting
tiYAxisString to "Percent" or "%".

--Mary

On Mar 17, 2010, at 9:28 AM, Dennis Shea wrote:

> Try
>
> res@tiYAxisString = "Percent"
>
> On 03/17/2010 08:36 AM, Dan Barrie wrote:
>> Dear NCL users,
>>
>> I would like to replace the default histogram left Y-Axis values for
>> "Frequency" with "Percent", which appears on the right Y-Axis by
>> default
>> when res@gsnHistogramComputePercentages is set to True. Does
>> anyone have
>> a suggestion for how to do this? Thanks.
>>
>> -Dan
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> --
> ======================================================
> Dennis J. Shea tel: 303-497-1361 |
> P.O. Box 3000 fax: 303-497-1333 |
> Climate Analysis Section |
> Climate & Global Dynamics Div. |
> National Center for Atmospheric Research |
> Boulder, CO 80307 |
> USA email: shea 'at' ucar.edu |
> ======================================================
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Mar 17 10:23:26 2010

This archive was generated by hypermail 2.1.8 : Wed Mar 17 2010 - 13:00:16 MDT