MathGroup Archive 2013

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

Search the Archive

Re: Number Separator for Number Labels on Plot Axes

  • To: mathgroup at smc.vnet.net
  • Subject: [mg131975] Re: Number Separator for Number Labels on Plot Axes
  • From: Bob Hanlon <hanlonr357 at gmail.com>
  • Date: Fri, 8 Nov 2013 16:23:04 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-outx@smc.vnet.net
  • Delivered-to: mathgroup-newsendx@smc.vnet.net
  • References: <20131106053543.C81456A4C@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 at 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
>
>
>




  • Prev by Date: Re: Unit conversion of a list of quantities
  • Next by Date: Re: Unit conversion of a list of quantities
  • Previous by thread: Re: Number Separator for Number Labels on Plot Axes
  • Next by thread: Re: Number Separator for Number Labels on Plot Axes