gsplot.style.label#
Deprecated forwarding shim for gsplot.style.label.
Functions
|
Set publication labels and optional panel geometry on explicit Axes. |
|
Translate legacy panel-index labels to canonical panel text artists. |
- label(target, xlabel='', ylabel='', xlim=None, ylim=None, *, xscale='linear', yscale='linear', xticks=None, yticks=None, minor=True, xminor=None, yminor=None, pad=5, xpad=None, ypad=None, margin=None, xmargin=None, ymargin=None, top=None, bottom=None, left=None, right=None, direction=None, square=False, index=False, index_offset=None, index_xoffset=None, index_yoffset=None)#
Set publication labels and optional panel geometry on explicit Axes.
- Parameters:
target (Axes | _AxesBase | Sequence[Axes | _AxesBase] | Mapping[Any, Axes | _AxesBase] | ndarray[tuple[int, ...], dtype[Any]]) β One Axes or a deterministic same-Figure collection of Axes.
xlabel (str | Sequence[tuple[str, str] | tuple[str, str, Any, Any] | Sequence[Any]] | Mapping[Any, tuple[str, str] | tuple[str, str, Any, Any] | Sequence[Any]]) β Shared axis labels.
xlabelmay instead contain ordered or exact-key two- or four-field label records.ylabel (str) β Shared axis labels.
xlabelmay instead contain ordered or exact-key two- or four-field label records.xlim (tuple[float | str | None, float | str | None] | Sequence[float | str | None] | None) β Optional finite, unequal limits; inverted limits are preserved. Endpoints set to
Noneor wildcard placeholders use automatic smart margins.ylim (tuple[float | str | None, float | str | None] | Sequence[float | str | None] | None) β Optional finite, unequal limits; inverted limits are preserved. Endpoints set to
Noneor wildcard placeholders use automatic smart margins.xscale (Literal['linear', 'log', 'symlog', 'logit']) β Shared
linear,log,symlog, orlogitscales.yscale (Literal['linear', 'log', 'symlog', 'logit']) β Shared
linear,log,symlog, orlogitscales.xticks (Sequence[float] | None) β Optional shared finite tick locations.
yticks (Sequence[float] | None) β Optional shared finite tick locations.
minor (bool) β Minor-tick controls. Coordinate-specific
Noneinheritsminor.xminor (bool | None) β Minor-tick controls. Coordinate-specific
Noneinheritsminor.yminor (bool | None) β Minor-tick controls. Coordinate-specific
Noneinheritsminor.pad (float) β Label padding in points. Coordinate-specific
Noneinheritspad.xpad (float | None) β Label padding in points. Coordinate-specific
Noneinheritspad.ypad (float | None) β Label padding in points. Coordinate-specific
Noneinheritspad.margin (float | tuple[float, float] | None) β Margin ratios for auto-determined limits (defaults to
0.05/ 5%). Coordinate-specificNoneinheritsmargin.xmargin (float | None) β Margin ratios for auto-determined limits (defaults to
0.05/ 5%). Coordinate-specificNoneinheritsmargin.ymargin (float | None) β Margin ratios for auto-determined limits (defaults to
0.05/ 5%). Coordinate-specificNoneinheritsmargin.top (bool | None) β Optional boolean flags for edge tick and label visibility.
bottom (bool | None) β Optional boolean flags for edge tick and label visibility.
left (bool | None) β Optional boolean flags for edge tick and label visibility.
right (bool | None) β Optional boolean flags for edge tick and label visibility.
direction (Literal['in', 'out', 'inout'] | None) β Optional tick direction:
"in","out", or"inout".square (bool) β Apply the same unit box aspect as
square()when true.index (bool | Literal['in', 'out']) β Add generated panel indexes outside, or at the selected
in/outlocation.index_offset (tuple[float, float] | float | None) β Optional point shift relative to baseline panel index placement. Accepts a scalar for equal shift in x/y or a 2-tuple
(dx, dy)in points.index_xoffset (float | None) β Optional direct point shift along the x-axis for panel indexes.
index_yoffset (float | None) β Optional direct point shift along the y-axis for panel indexes.
- Returns:
The supplied Axes are changed in place.
- Return type:
None- Raises:
LayoutError β If targets, records, domains, ticks, padding, or controls are invalid.
Notes
Every target and value is validated before mutation. The operation never executes a Figure layout engine, resizes a Figure, or inspects pyplotβs current Figure.
Examples
>>> import gsplot as gs >>> figure, ax = gs.subplots() >>> gs.line(ax, [0, 1], [0, 1]) [<matplotlib.lines.Line2D object ...>] >>> gs.label(ax, "time", "signal", xlim=(0, 1), square=True) >>> ax.get_xlabel() 'time' >>> figure.clear()
- label_add_index(loc='out', x_offset=0, y_offset=0, ha='center', va='center', fontsize='large', glyph='alphabet', capitalize=False, **options)#
Translate legacy panel-index labels to canonical panel text artists.
- Parameters:
loc (str)
x_offset (float)
y_offset (float)
ha (str)
va (str)
fontsize (float | str)
glyph (str)
capitalize (bool)
options (Any)
- Return type:
None