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: Number Separator for Number Labels on Plot Axes
Replies: 3   Last Post: Nov 8, 2013 4:16 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Bob Hanlon

Posts: 895
Registered: 10/29/11
Re: Number Separator for Number Labels on Plot Axes
Posted: Nov 8, 2013 4:16 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


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
>
>
>






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

[Privacy Policy] [Terms of Use]

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