Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #4502 > unrolled thread

Re: Display BarChart ticks in AccountingForm?

Started byMark McClure <mcmcclur@unca.edu>
First post2011-08-21 09:32 +0000
Last post2011-08-21 09:32 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Display BarChart ticks in AccountingForm? Mark McClure <mcmcclur@unca.edu> - 2011-08-21 09:32 +0000

#4502 — Re: Display BarChart ticks in AccountingForm?

FromMark McClure <mcmcclur@unca.edu>
Date2011-08-21 09:32 +0000
SubjectRe: Display BarChart ticks in AccountingForm?
Message-ID<j2qjbb$cud$1@smc.vnet.net>
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

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web