Re: y-axis manipulation for histograms

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Dec 15 2010 - 09:44:38 MST

Hi Neil,

Rick is correct, there's no automatic way to do this.

I'm familiar with this code, so I modified it to force the
percentages to be on the left.

Save the attached file, make sure you load it after you load "gsn_code.ncl", and then
call "gsn_histogram_mod" instead of "gsn_histogram".

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "./gsn_histogram_mod.ncl"

...

plot(0) = gsn_histogram_mod(wks,enws,res)
. . .

--Mary

  
On Dec 14, 2010, at 3:44 PM, Rick Brownrigg wrote:

> Neil,
>
> I'm not an expert on this, but I took a look through the
> gsn_histogram() code, and I don't see that there's a means to move the
> percentage label to the left. It may be possible to turn off labeling
> and tick marks on the left hand side by setting
>
> res@tmYLOn = False
>
> leaving you with just percentage on the right. (Example
> "histo_9.ncl" shows how to turn off all axis labelling, and example
> histo_12.ncl suppresses the "frequency" label http://www.ncl.ucar.edu/Applications/histo.shtml
> )
>
> I'm not saying it can't be done, just that it doesn't look too
> promising....FWIW.
>
> Rick
>
> On Dec 14, 2010, at 12:31 PM, Neil Berg wrote:
>
>> Hello NCL community,
>>
>> I am trying to plot just the probability on the left y-axis for my
>> histograms. Currently, I am unable to figure out how to suppress
>> the "frequency" left y-axis and replace it with "probability
>> percentage", which is now on the right y-axis. I've attached a
>> picture of my histograms and also the relevant code snippet.
>>
>> Thank you for your help in advance,
>>
>> Neil Berg
>> <
>> comp_hourly_histos
>> .eps><code_snippet.ncl>_______________________________________________
>> 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

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

Received on Wed Dec 15 09:44:45 2010

This archive was generated by hypermail 2.1.8 : Wed Dec 22 2010 - 16:10:23 MST