publiplots.invert_axis¶
- publiplots.invert_axis(ax, axis='y')[source]¶
Invert an axis direction.
Useful for heatmaps or other visualisations where reversed order is more intuitive (e.g., placing the origin at the top-left).
- Parameters:
ax (matplotlib.axes.Axes) – Axes to modify in place.
axis ({‘x’, ‘y’}, default
'y') – Which axis to invert.
- Raises:
ValueError – If
axisis not'x'or'y'.
Examples
Invert y-axis (common for heatmaps):
>>> pp.invert_axis(ax, axis='y')Invert x-axis:
>>> pp.invert_axis(ax, axis='x')