3
$\begingroup$

I have a simple x-y plot that I need to fix up for publication. The x-coordinate of the points goes from 0 to 100000. So Mathematica puts tick marks at 0, 20000, 40000, 60000, 80000, and 100000. Is it possible for Mathematica to replace those numbers with 0, 0.2, 0.4, 0.6, 0.8, and 1, and let me include the "unit" 10^5 in the x-axis label?

$\endgroup$
0

1 Answer 1

3
$\begingroup$

The variable ct is a map between actual values and displayed scaled values

Clear[ct]
ct = Table[{10^4*i, N[i/10, 2]}, {i, 1, 10}];

Plot[Sin[2 Pi x/10^5], {x, 0, 10^5}, Ticks -> {ct, Automatic}, 
 AxesOrigin -> {0, -1}, AxesLabel -> {Superscript[10, 5], "y"}]

{{10000, 0.1}, {20000, 0.2}, {30000, 0.3}, {40000, 0.4}, {50000, 0.5}, {60000, 0.6}, {70000, 0.7}, {80000, 0.8}, {90000, 0.9}, {100000, 1.}}

enter image description here

Frame version

Clear[ct]
ct = Table[{10^4*i, N[i/10, 2]}, {i, 0, 10}];

Plot[Sin[2 Pi x/10^5], {x, 0, 10^5},
 FrameTicks -> {{Automatic, None}, {ct, None}}, 
 FrameLabel -> {Superscript[10, 5], "y"}, Frame -> True,
 PlotRangePadding -> None]

enter image description here

$\endgroup$
1
  • $\begingroup$ @ClintVanSiclen Does this answer your question? $\endgroup$
    – Young
    Jul 30, 2016 at 16:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.