The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 ]
Tomas Garza Hernandez

Posts: 264
Registered: 4/15/05
Re: Number Separator for Number Labels on Plot Axes
Posted: Nov 7, 2013 12:20 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Yes, one possibility is as follows: if you Plot, say 100 x^2, by default you get the numbers {20000, 40000, 60000, 80000, 100000} on the vertical axes. Suppose you want to format them with a comma dividing thousands and write a $ sign to the left of each. Then set
origticks=Table[20000 j, {j,1,5}];newticks=NumberForm[#,5,DigitBlock->3]&/@origticks;b=ToString/@newticks;c = "$" <> # & /@ b;

and then


Check the Online Help on Ticks|Scope|Ticks Positions and Labeling


> From:
> Subject: Number Separator for Number Labels on Plot Axes
> To:
> Date: Wed, 6 Nov 2013 00:35:43 -0500
> 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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.