Drexel dragonThe Math ForumDonate to the Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Display BarChart ticks in AccountingForm?
Replies: 3   Last Post: Aug 21, 2011 4:50 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Mark McClure

Posts: 193
Registered: 9/12/07
Re: Display BarChart ticks in AccountingForm?
Posted: Aug 21, 2011 4:50 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Sat, Aug 20, 2011 at 6:17 AM, Porscha Louise McRobbie
<pmcrobbi@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

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2015. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.