sysplot.set_major_ticks#

set_major_ticks(label, unit=1.0, axis=None, mode='repeating', numerator=1, denominator=1)[source]#

Set major tick labels as reduced fractions of a unit.

Places ticks at step = unit * numerator / denominator and formats labels as fractions (e.g., 1/2 π, 3/4 π). Labels are reduced to their simplest form automatically.

The mode controls where ticks are placed:

  • "repeating": all integer multiples of step within the axis range.

  • "single": only 0 and step.

  • "symmetric": only -step, 0, and step.

If insufficient ticks fall within the visible range, the denominator is automatically increased until at least two ticks are visible or a maximum denominator is reached.

Note

In the current implementation, the tick labels are generated with a “/” to symbolize a fraction. No LaTeX rendering is used.

Parameters:
  • label (str) – Base label text (e.g., r"$\pi$" or "$T_0$").

  • unit (float) – Physical value for one label unit (e.g., np.pi).

  • axis (XAxis | YAxis | None) – Axis to modify. Defaults to the current x-axis.

  • mode (Literal['single', 'symmetric', 'repeating']) – Tick placement strategy.

  • numerator (int) – Numerator of the fractional step. Must be a positive int.

  • denominator (int) – Denominator of the fractional step. Must be a positive int.

Return type:

None

Examples using sysplot.set_major_ticks#

Quick Start Example

Quick Start Example

Set Major Ticks

Set Major Ticks
rtype:

None