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


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

Re: Number Separator for Number Labels on Plot Axes

Started byBob Hanlon <hanlonr357@gmail.com>
First post2013-11-08 21:16 +0000
Last post2013-11-08 21:16 +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: Number Separator for Number Labels on Plot Axes Bob Hanlon <hanlonr357@gmail.com> - 2013-11-08 21:16 +0000

#16204 — Re: Number Separator for Number Labels on Plot Axes

FromBob Hanlon <hanlonr357@gmail.com>
Date2013-11-08 21:16 +0000
SubjectRe: Number Separator for Number Labels on Plot Axes
Message-ID<l5jkat$lss$1@smc.vnet.net>
Show[(plt = Plot[x^2, {x, 0, 100}]), Ticks ->
  {Automatic, ((Ticks /. AbsoluteOptions[plt, Ticks])[[2]] /.
     {val_,
       lbl_, len_List, sty_List} :>
      {val,
       NumberForm[lbl, DigitBlock -> 3], len, sty})}]


Show[(plt = Plot[x^2, {x, 0, 100}]), Ticks ->
  {Automatic, ((Ticks /. AbsoluteOptions[plt, Ticks])[[2]] /.
     {val_,
       lbl_, len_List, sty_List} :>
      {val,
       NumberForm[lbl, DigitBlock -> 3, NumberSigns -> {"-$", "$"}],
       len, sty})}]



Bob Hanlon


On Wed, Nov 6, 2013 at 12:35 AM, Gregory Lypny
<gregory.lypny@videotron.ca>wrote:

> Hello everyone,
>
> Is there a way to format the numbers that appear on the axes of plots, for
> example, including number separators for thousands, as in 2,000, 3,400,
> etc., or including dollar signs, $5, $6, and so on? I tried using
> NumberForm on Ticks but that gave me an error.
>
> Gregory
>
>
>

[toc] | [standalone]


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


csiph-web