Skip to content
Merged
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
22 changes: 11 additions & 11 deletions pygmt/src/colorbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,17 @@

from pygmt.alias import Alias, AliasSystem
from pygmt.clib import Session
from pygmt.helpers import build_arg_list, fmt_docstring, kwargs_to_strings, use_alias
from pygmt.helpers import build_arg_list, fmt_docstring, use_alias
from pygmt.params import Box

__doctest_skip__ = ["colorbar"]


@fmt_docstring
@use_alias(
C="cmap", D="position", G="truncate", L="equalsize", Q="log", W="scale", Z="zfile"
)
@kwargs_to_strings(G="sequence", I="sequence")
def colorbar(
@use_alias(C="cmap", D="position", L="equalsize", Q="log", W="scale", Z="zfile")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR also removes I="sequence" which should have been removed in PR #4197.

def colorbar( # noqa: PLR0913
self,
truncate: Sequence[float] | None = None,
shading: float | Sequence[float] | bool = False,
projection: str | None = None,
box: Box | bool = False,
Expand Down Expand Up @@ -59,6 +57,7 @@ def colorbar(
{aliases}
- B = frame
- F = box
- G = truncate
- I = shading
- J = projection
- R = region
Expand Down Expand Up @@ -99,11 +98,11 @@ def colorbar(
rectangular box is drawn using :gmt-term:`MAP_FRAME_PEN`. To customize the box
appearance, pass a :class:`pygmt.params.Box` object to control style, fill, pen,
and other box properties.
truncate : list or str
*zlo*/*zhi*.
Truncate the incoming CPT so that the lowest and highest z-levels are
to *zlo* and *zhi*. If one of these equal NaN then we leave that end of
the CPT alone. The truncation takes place before the plotting.
truncate
(*zlow*, *zhigh*).
Truncate the incoming CPT so that the lowest and highest z-levels are to *zlow*
and *zhigh*. If one of these equal NaN then we leave that end of the CPT alone.
The truncation takes place before the plotting.
scale : float
Multiply all z-values in the CPT by the provided scale. By default,
the CPT is used as is.
Expand Down Expand Up @@ -161,6 +160,7 @@ def colorbar(

aliasdict = AliasSystem(
F=Alias(box, name="box"),
G=Alias(truncate, name="truncate", sep="/", size=2),
I=Alias(shading, name="shading", sep="/", size=2),
).add_common(
B=frame,
Expand Down
Loading