Skip to content

Commit cf6775e

Browse files
Figure.plot: Add an inline example (#4932)
Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com>
1 parent 8484ada commit cf6775e

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎pygmt/src/plot.py‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
from pygmt.params import Axis, Frame
2020
from pygmt.src._common import _data_geometry_is_point
2121

22+
__doctest_skip__ = ["plot"]
23+
2224

2325
@fmt_docstring
2426
@use_alias(
@@ -249,6 +251,20 @@ def plot( # ruff: ignore[too-many-branches]
249251
Plot horizontal lines.
250252
pygmt.Figure.vlines
251253
Plot vertical lines.
254+
255+
Examples
256+
--------
257+
Plot a blue line connecting the data points and then plot the data points as
258+
red circles on top:
259+
260+
>>> import pygmt
261+
>>> x = [1, 3, 5, 7, 9]
262+
>>> y = [2, 6, 4, 8, 5]
263+
>>> fig = pygmt.Figure()
264+
>>> fig.basemap(region=[0, 10, 0, 10], projection="X10c", frame=True)
265+
>>> fig.plot(x=x, y=y, pen="1p,blue")
266+
>>> fig.plot(x=x, y=y, style="c0.3c", fill="cyan", pen="0.5p,black")
267+
>>> fig.show()
252268
"""
253269
# TODO(GMT>6.5.0): Remove the note for the upstream bug of the "straight_line"
254270
# parameter.

0 commit comments

Comments
 (0)