# Rescaling x axis without altering y axis

I have a plot as follows:

Plot[{Sin[t]^2}, {t, 0, 3000}, Background -> White]

Plot[{Sin[t]^2}, {t, 0, 3000}, Background -> White,
Ticks -> {{#, 1/902*\[Pi]/4 #} & /@ FindDivisions[{0., 3000}, 6] //
N, Automatic}]


But I need to reexpress the plot in terms of pi/4, pi/2, pi. How to do this without altering y-axis?

• tmax is undefined in your code May 24 at 8:06
• Edited the question May 24 at 8:07

## 1 Answer

I think that the range of values of the x-axis is too large compared to how small the step of the ticks you want is. I am mentioning this since I have not been able to produce a nice plot.

Some toy-examples (with comparable ranges) follow:

The most straightforward way is:

Plot[Sin[t]^2, {t, 0, 2 Pi},
Ticks -> {Range[0, 2 Pi, Pi/4], Automatic}]


Another way is shown below:

ticks = Union @@ Table[Range[0, 2 Pi, dt], {dt, {Pi/4, Pi/4}}];
Plot[{Sin[t]^2}, {t, 0, 2 Pi}, Ticks -> {ticks, Automatic},
PlotRange -> All]


Both of the above produce

For your values, it would be something like

ticks = Union @@ Table[Range[0, 955 Pi, dt], {dt, {Pi/4, Pi/4}}];

Plot[{Sin[t]^2}, {t, 0, 955 Pi}, Ticks -> {ticks, Automatic},
PlotRange -> All]


but the ticks are not visible at all.

Hopefully, using the above you can either manipulate the plot-range, or the width of the ticks for your plots, or perhaps keep everything as it is.

• That's the reason why I have converted the x axis to 1/902*[Pi]/4 without altering y axis. After this first rescaling I asked for the pi/4 gapping rescale May 25 at 1:03