Skip to content

Commit

Permalink
Add parameter for pen
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed Nov 11, 2024
1 parent a833194 commit 8d7f744
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion pygmt/src/scatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def scatter( # noqa: PLR0913
intensity: float | Sequence[float] | None = None,
transparency: float | Sequence[float] | None = None,
cmap: str | None = None,
pen: str | float | None = None,
no_clip: bool = False,
perspective=None,
):
Expand Down Expand Up @@ -85,16 +86,35 @@ def scatter( # noqa: PLR0913
cmap
The colormap to map scalar values in ``fill`` to colors. In this case,
``fill`` must be a sequence of numbers.
pen
The pen property of the symbol outline.
no_clip
If True, do not clip the points that fall outside the frame boundaries.
{perspective}
Examples
--------
Plot three points with the same symbol and size.
>>> import pygmt
>>> fig = pygmt.Figure()
>>> fig.basemap(region=[0, 3, 0, 3], projection="X10c/5c", frame=True)
>>> fig.scatter(x=[0, 1, 2], y=[0, 1, 2], symbol="c", size=0.5)
>>> fig.scatter(x=[0, 1, 2], y=[0, 1, 2], symbol="c", size=0.3, fill="red")
>>> fig.show()
Plot three points with different sizes and transparencies.
>>> fig = pygmt.Figure()
>>> fig.basemap(region=[0, 3, 0, 3], projection="X10c/5c", frame=True)
>>> fig.scatter(
... x=[0, 1, 2],
... y=[0, 1, 2],
... symbol="c",
... size=[0.5, 0.3, 0.2],
... fill="blue",
... transparency=[50, 70, 90],
... )
>>> fig.show()
"""
self._preprocess()
Expand All @@ -116,6 +136,7 @@ def scatter( # noqa: PLR0913
intensity=intensity,
transparency=transparency,
cmap=cmap,
pen=pen,
no_clip=no_clip,
perspective=perspective,
)

0 comments on commit 8d7f744

Please sign in to comment.