You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
Change the x or y axis tick labels to be formatted a fractions of pi. Separate functions are provided for adjusting each axis independently.
xlabel_pi_fractions;
ylabel_pi_fractions;
You can specify the maximum divisor, N, for which all ticks will be multiples of
. If not specified, the default divisor is 4.
h = axes;
axis(h, [-pi pi 0 2*pi]);
xlabel_pi_fractions(5);
ylabel_pi_fractions(2);
Similar to other graphics commands, you can optionally provide a handle to the axes object as the first argument.
h = axes;
axis(h, [-pi pi 0 2*pi]);
xlabel_pi_fractions(h, 5);
ylabel_pi_fractions(h, 2);
Cite As
Mike Heinz (2026). Fractional Pi Tick Labels (https://in.mathworks.com/matlabcentral/fileexchange/175883-fractional-pi-tick-labels), MATLAB Central File Exchange. Retrieved .
General Information
- Version 1.0.1 (3.97 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
