I want to use ms instead of s as the unit of x-axis. But frameticks seems not to work here as it cannot change the value of x-axis.
How to replace the number of x-axis 0.0001 with 1 or 0.1? Or just scale the x-axis?
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityI want to use ms instead of s as the unit of x-axis. But frameticks seems not to work here as it cannot change the value of x-axis.
How to replace the number of x-axis 0.0001 with 1 or 0.1? Or just scale the x-axis?
Here is a way to do what you are asking.
Before
Plot[Sin[200 Pi t], {t, 0., .01}]
After
Plot[Sin[200 Pi t], {t, 0., .01},
Ticks -> {{#, 1000 #} & /@ FindDivisions[{0., .01}, 5] // N, Automatic}]
This update is in response to the comment made by drabus.
It's annoying but frame ticks must be specified somewhat differently from axis ticks. So if you are framing the plot, do it this way:
Plot[Sin[200 Pi t], {t, 0., .01},
Frame -> True,
FrameTicks ->
{Automatic, {{#, 1000 #} & /@ FindDivisions[{0., .01}, 5] // N, Automatic}}]
FrameTicks
option and drop the Ticks
option.
$\endgroup$
Mar 26, 2015 at 2:44
Frame -> True, FrameTicks -> {{Automatic, None}, {{#, 1000 #} & /@ FindDivisions[{0., .01}, 5] // N, None}}
$\endgroup$
Plot[x^2, {x, .0001, .0005},
Ticks -> {Table[{i, ToString[10000 i]}, {i, .0001, .0005, .0001}],
Automatic}
]
Ticks -> {Table[{i, Round[10000 i]}, {i, .0001, .0005, .0001}]
$\endgroup$
Mar 26, 2015 at 15:37