Fractional Pi Tick Labels

Version 1.0.1 (3.97 KB) by Mike Heinz
Format axis tick labels as fractions of pi.
7 Downloads
Updated 17 Nov 2024

View License

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 (2025). Fractional Pi Tick Labels (https://in.mathworks.com/matlabcentral/fileexchange/175883-fractional-pi-tick-labels), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2024b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.1

Added image to FileExchange description.

1.0.0