Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/tutorials/advanced/subplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@

# %%
# You can also manually override the ``autolabel`` for each subplot using for
# example, ``fig.set_panel(..., fixedlabel="b) Panel 2")`` which would allow
# example, ``fig.set_panel(..., tag="b) Panel 2")`` which would allow
# you to manually label a single subplot as you wish. This can be useful for
# adding a more descriptive subtitle to individual subplots.

Expand Down
20 changes: 11 additions & 9 deletions pygmt/src/subplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,12 @@ def subplot(

@fmt_docstring
@contextlib.contextmanager
@use_alias(A="fixedlabel", C="clearance")
@deprecate_parameter("fixedlabel", "tag", "v0.19.0", remove_version="v0.23.0")
@use_alias(C="clearance")
def set_panel(
self,
panel: int | Sequence[int] | None = None,
tag: str | None = None,
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
| bool = False,
**kwargs,
Expand All @@ -220,6 +222,7 @@ def set_panel(
``projection="X"`` will fill the subplot by using unequal scales].

$aliases
- A = tag
- V = verbose

Parameters
Expand All @@ -234,13 +237,10 @@ def set_panel(
GMT maintains information about the current figure and subplot. Also, you may
give the one-dimensional *index* instead which starts at 0 and follows the row
or column order set via ``autolabel`` in :meth:`pygmt.Figure.subplot`.

fixedlabel : str
Overrides the automatic labeling with the given string. No modifiers
are allowed. Placement, justification, etc. are all inherited from how
``autolabel`` was specified by the initial :meth:`pygmt.Figure.subplot`
command.

tag
Tag for the current subplot. It overrides the automatic tag set by the
:meth:`pygmt.Figure.subplot` method. To not set any tag for this panel, use
``tag="-"``.
clearance : str or list
[*side*]\ *clearance*.
Reserve a space of dimension *clearance* between the margin and the
Expand All @@ -257,7 +257,9 @@ def set_panel(
"""
self._activate_figure()

aliasdict = AliasSystem().add_common(
aliasdict = AliasSystem(
A=Alias(tag, name="tag"),
).add_common(
V=verbose,
)
aliasdict.merge(kwargs)
Expand Down
Loading