Fractional Pi Tick Labels

Format axis tick labels as fractions of pi.

You are now following this Submission

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 .

Tags

Add Tags

Add the first tag.

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.1

Added image to FileExchange description.

1.0.0