MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Display BarChart ticks in AccountingForm?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg120995] Re: Display BarChart ticks in AccountingForm?
  • From: Mark McClure <mcmcclur at unca.edu>
  • Date: Sun, 21 Aug 2011 05:31:03 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201108201017.GAA04962@smc.vnet.net>

On Sat, Aug 20, 2011 at 6:17 AM, Porscha Louise McRobbie
<pmcrobbi at umich.edu> wrote:

> I have a BarChart with large y-values
>
> I do not want the y-axis tick marks to display in scientific notation.
> How can I get the tick marks to display using AccountingForm?  The
> following does not seem to work:
>
> BarChart[{1 10^13, 2 10^13, 3 10^13}, ChartLabels -> {"a", "b", "c"},
>  Ticks -> {None,
>    AccountingForm[#, DigitBlock -> 3] & /@ {1 10^13, 2 10^13,
>      3 10^13}}]


In the specificiation Ticks -> {xs_List, ys_List}, the xs and ys are
meant to be lists of numbers.  If you want the tick to be specified as
something other than a number, you could use an ordered pair, the
second element of which specifies the label.  Frequently, the second
term is a string, as in:

Plot[Sin[x^2], {x, 0, 2},
 Ticks -> {{{Sqrt[Pi/2], "max"}, Sqrt[Pi]}, {1}}]

Now, a term whose Head is AccountingForm is not a number.  Thus, you
probably want something like so:

BarChart[{1 10^13, 2 10^13, 3 10^13},
 Ticks -> {None, {#, AccountingForm[#, DigitBlock -> 3]} & /@
    {1 10^13,
     2 10^13, 3 10^13}},
 ChartLabels -> {"a", "b", "c"}]


Mark McClure




  • Prev by Date: Re: Display BarChart ticks in AccountingForm?
  • Next by Date: Re: NDSolve with square root
  • Previous by thread: Re: Display BarChart ticks in AccountingForm?
  • Next by thread: Re: Display BarChart ticks in AccountingForm?