Services & Resources / Wolfram Forums / MathGroup Archive
-----

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: [mg131972] Re: Number Separator for Number Labels on Plot Axes
  • From: Tomas Garza <tgarza10 at msn.com>
  • Date: Thu, 7 Nov 2013 00:28:57 -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>

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


Plot[10x^2,{x,0,100},Ticks->{Automatic,Transpose[{origticks,c}]}]


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


-Tomas



> From: gregory.lypny at videotron.ca
> Subject: Number Separator for Number Labels on Plot Axes
> To: mathgroup at smc.vnet.net
> 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
>
>
 		 	   		  


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