diff --git a/examples/gallery/symbols/patterns.py b/examples/gallery/symbols/patterns.py index e27167c17f4..c8286476e62 100644 --- a/examples/gallery/symbols/patterns.py +++ b/examples/gallery/symbols/patterns.py @@ -5,20 +5,6 @@ In addition to colors, PyGMT also allows using bit and hachure patterns to fill symbols, polygons, and other areas, via the ``fill`` parameter or similar parameters. -Example method parameters that support bit and hachure patterns include: - -- :meth:`pygmt.Figure.coast`: Land and water masses via ``land`` and ``water`` -- :meth:`pygmt.Figure.histogram`: Histogram bars via ``fill`` -- :meth:`pygmt.Figure.meca`: Focal mechanisms via ``compression_fill`` and - ``extension_fill`` -- :meth:`pygmt.Figure.plot`: Symbols and polygons via ``fill`` -- :meth:`pygmt.Figure.rose`: Histogram sectors via ``fill`` -- :meth:`pygmt.Figure.solar`: Day-light terminators via ``fill`` -- :meth:`pygmt.Figure.ternary`: Symbols via ``fill`` -- :meth:`pygmt.Figure.velo`: Uncertainty wedges and velocity error ellipses via - ``uncertainty_fill`` -- :meth:`pygmt.Figure.wiggle`: Anomalies via ``positive_fill`` and ``negative_fill`` - GMT provides 90 predefined 1-bit patterns, which are numbered from 1 to 90. In addition, custom 1-, 8-, or 24-bit image raster files can also be used as patterns. diff --git a/pygmt/src/fill_between.py b/pygmt/src/fill_between.py index 37ce5330ab2..48c89c91cdc 100644 --- a/pygmt/src/fill_between.py +++ b/pygmt/src/fill_between.py @@ -10,7 +10,7 @@ from pygmt.clib import Session from pygmt.exceptions import GMTValueError from pygmt.helpers import build_arg_list, fmt_docstring -from pygmt.params import Axis, Frame +from pygmt.params import Axis, Frame, Pattern __doctest_skip__ = ["fill_between"] @@ -22,8 +22,8 @@ def fill_between( y: Sequence[float], y2: float | Sequence[float] = 0, x2: Sequence[float] | None = None, - fill: str | None = None, - fill2: str | None = None, + fill: str | Pattern | None = None, + fill2: str | Pattern | None = None, pen: str | None = None, pen2: str | None = None, label: str | None = None, diff --git a/pygmt/src/grdview.py b/pygmt/src/grdview.py index cfe715384da..e1df76a1674 100644 --- a/pygmt/src/grdview.py +++ b/pygmt/src/grdview.py @@ -17,7 +17,7 @@ is_given, use_alias, ) -from pygmt.params import Axis, Frame +from pygmt.params import Axis, Frame, Pattern from pygmt.src.grdinfo import grdinfo __doctest_skip__ = ["grdview"] @@ -127,10 +127,10 @@ def grdview( nan_transparent: bool = False, monochrome: bool = False, contour_pen: str | None = None, - mesh_fill: str | None = None, + mesh_fill: str | Pattern | None = None, mesh_pen: str | None = None, plane: float | bool = False, - facade_fill: str | None = None, + facade_fill: str | Pattern | None = None, facade_pen: str | None = None, projection: str | None = None, smooth: int | None = None, diff --git a/pygmt/src/histogram.py b/pygmt/src/histogram.py index 95e8de682a8..02296493db7 100644 --- a/pygmt/src/histogram.py +++ b/pygmt/src/histogram.py @@ -16,7 +16,7 @@ kwargs_to_strings, use_alias, ) -from pygmt.params import Axis, Frame +from pygmt.params import Axis, Frame, Pattern __doctest_skip__ = ["histogram"] @@ -44,7 +44,7 @@ def histogram( bar_offset: float | str | None = None, cmap: str | bool = False, pen: str | None = None, - fill: str | None = None, + fill: str | Pattern | None = None, horizontal: bool = False, center: bool = False, out_range: Literal["first", "last", "both"] | None = None, diff --git a/pygmt/src/meca.py b/pygmt/src/meca.py index a2c84cd641a..68515738398 100644 --- a/pygmt/src/meca.py +++ b/pygmt/src/meca.py @@ -17,7 +17,7 @@ fmt_docstring, use_alias, ) -from pygmt.params import Axis, Frame +from pygmt.params import Axis, Frame, Pattern from pygmt.src._common import _FocalMechanismConvention @@ -129,8 +129,8 @@ def meca( plot_latitude: float | Sequence[float] | None = None, event_name: str | Sequence[str] | None = None, cmap: str | None = None, - extension_fill: str | None = None, - compression_fill: str | None = None, + extension_fill: str | Pattern | None = None, + compression_fill: str | Pattern | None = None, pen: str | None = None, no_clip: bool = False, projection: str | None = None, diff --git a/pygmt/src/paragraph.py b/pygmt/src/paragraph.py index ca31af96148..82c87a0cc0d 100644 --- a/pygmt/src/paragraph.py +++ b/pygmt/src/paragraph.py @@ -18,6 +18,7 @@ is_nonstr_iter, non_ascii_to_octal, ) +from pygmt.params import Pattern __doctest_skip__ = ["paragraph"] @@ -33,7 +34,7 @@ def paragraph( font: str | None = None, angle: float | None = None, justify: AnchorCode | None = None, - fill: str | None = None, + fill: str | Pattern | None = None, pen: str | None = None, alignment: Literal["left", "center", "right", "justified"] = "left", tab_width: int = 4, diff --git a/pygmt/src/solar.py b/pygmt/src/solar.py index 7b51dd02a2b..dc2f902099e 100644 --- a/pygmt/src/solar.py +++ b/pygmt/src/solar.py @@ -10,7 +10,7 @@ from pygmt.clib import Session from pygmt.exceptions import GMTValueError from pygmt.helpers import build_arg_list, fmt_docstring -from pygmt.params import Axis, Frame +from pygmt.params import Axis, Frame, Pattern __doctest_skip__ = ["solar"] @@ -20,7 +20,7 @@ def solar( self, terminator: Literal["astronomical", "civil", "day_night", "nautical"] = "day_night", terminator_datetime=None, - fill: str | None = None, + fill: str | Pattern | None = None, pen: str | None = None, projection: str | None = None, region: Sequence[float | str] | str | None = None, diff --git a/pygmt/src/ternary.py b/pygmt/src/ternary.py index e828fbda854..b249bec3f78 100644 --- a/pygmt/src/ternary.py +++ b/pygmt/src/ternary.py @@ -10,7 +10,7 @@ from pygmt.clib import Session from pygmt.exceptions import GMTValueError from pygmt.helpers import build_arg_list, fmt_docstring, use_alias -from pygmt.params import Axis, Frame +from pygmt.params import Axis, Frame, Pattern from pygmt.params.frame import _Axes @@ -113,7 +113,7 @@ def ternary( self, data: PathLike | TableLike, cmap: str | bool = False, - fill: str | None = None, + fill: str | Pattern | None = None, width: float | str | None = None, pen: str | None = None, alabel: str | None = None, diff --git a/pygmt/src/text.py b/pygmt/src/text.py index 3b5e8c90274..a7d82c8f318 100644 --- a/pygmt/src/text.py +++ b/pygmt/src/text.py @@ -19,7 +19,7 @@ non_ascii_to_octal, use_alias, ) -from pygmt.params import Axis, Frame +from pygmt.params import Axis, Frame, Pattern @fmt_docstring @@ -40,7 +40,7 @@ def text( # ruff: ignore[too-many-branches, too-many-statements] text: str | StringArrayTypes | None = None, angle: float | Sequence[float] | bool = False, font: str | StringArrayTypes | bool = False, - fill: str | None = None, + fill: str | Pattern | None = None, pen: str | None = None, justify: bool | AnchorCode | Sequence[AnchorCode] | None = None, offset: Sequence[float | str] | str | None = None, diff --git a/pygmt/src/wiggle.py b/pygmt/src/wiggle.py index cb4eb24a399..e18464b89cc 100644 --- a/pygmt/src/wiggle.py +++ b/pygmt/src/wiggle.py @@ -9,7 +9,7 @@ from pygmt.alias import Alias, AliasSystem from pygmt.clib import Session from pygmt.helpers import build_arg_list, fmt_docstring, use_alias -from pygmt.params import Axis, Frame, Position +from pygmt.params import Axis, Frame, Pattern, Position from pygmt.src._common import _parse_position @@ -34,8 +34,8 @@ def wiggle( position: Position | Sequence[float | str] | AnchorCode | None = None, length: float | str | None = None, label_alignment: Literal["left", "right"] | None = None, - positive_fill: str | None = None, - negative_fill: str | None = None, + positive_fill: str | Pattern | None = None, + negative_fill: str | Pattern | None = None, projection: str | None = None, region: Sequence[float | str] | str | None = None, frame: Frame | Axis | Literal["none"] | str | Sequence[str] | bool = False,