-1
$\begingroup$

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?

$\endgroup$
2
  • $\begingroup$ tmax is undefined in your code $\endgroup$ May 24 at 8:06
  • $\begingroup$ Edited the question $\endgroup$
    – Jasmine
    May 24 at 8:07
1
$\begingroup$

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

enter image description here

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.

$\endgroup$
1
  • $\begingroup$ 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 $\endgroup$
    – Jasmine
    May 25 at 1:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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