# How can I set an axes scale on $x$ in terms of $\pi$? [duplicate]

If I plot a function

Plot[Sin[x], {x, 0, 3Pi}]


I'll get a plot with the x between 0 and 10. I'll like to know how I can modify the x axis to have it in terms of Pi. i.e. to have 0, Pi/2, Pi on the x axis instead of 1,2,3....

## marked as duplicate by bbgodfrey, corey979, Johu, m_goldberg, J. M. is away♦ plotting StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Oct 19 '18 at 0:00

• If you look in the help page for Ticks you should find an example that shows almost exactly what you are describing. You might be able to guess how to modify that example like this Plot[Sin[x], {x, 0, 10}, Ticks -> {{0, Pi/2, Pi, 3 Pi/2, 2 Pi, 5 Pi/2, 3 Pi}, {-1, 1}}] and you should be done – Bill Oct 18 '18 at 3:24
• @Bill This could be further simplified (by some definition of simplification) to solutions like Plot[Sin[x], {x, 0, 10}, Ticks -> {FindDivisions[{0, 10, Pi/2}, 10], Automatic}] – kirma Oct 18 '18 at 6:04
• @kirma When dealing with what appear to be very new users I have found the definition of simplification being "introduce no more than trivial typo fixes and no more than one new concept in any response" seems to work best for me. I hope that it works best for them too. – Bill Oct 18 '18 at 7:29
• – kglr Oct 18 '18 at 19:23
• @kirma in terms of computing time is there any difference between use the list or use the FindDivisions comand? – Heberley Tobón Maya Oct 20 '18 at 0:14

An easy way to do what you ask is to add a Ticks option that places $$x$$-axis ticks at intervals of Pi/2.

Plot[Sin[x], {x, 0, 3 Pi}, Ticks -> {Subdivide[0, 3 Pi, 3 Pi/(Pi/2)], Automatic}]


• The number of intervals in Ticks can be specified as an integer: Plot[Sin[x], {x, 0, 3 Pi}, Ticks -> {Subdivide[0, 3 Pi, 6], Automatic}] – Syd Geraghty Oct 19 '18 at 4:15