From b54f46f895de7cf979876b03ee9797297802729d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Sat, 3 Oct 2026 20:32:54 +0200 Subject: [PATCH 1/3] Add inline example for wiggle --- pygmt/src/wiggle.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/pygmt/src/wiggle.py b/pygmt/src/wiggle.py index e18464b89cc..5fe8dee0e13 100644 --- a/pygmt/src/wiggle.py +++ b/pygmt/src/wiggle.py @@ -129,6 +129,31 @@ def wiggle( $perspective $transparency $wrap + + Examples + -------- + import numpy as np + import pygmt + + x = np.arange(-7, 7, 0.01) + y = np.zeros(x.size) + z = np.exp(-((x / 2) ** 2)) * np.sin(2 * np.pi * x) + + fig = pygmt.Figure() + fig.basemap(region=[-8, 10, -1, 1], projection="X10c/5c", frame=True) + fig.wiggle( + x=x, + y=y, + z=z, + scale="0.5c", + length=1, + position="RM", + pen="0.5p,", + positive_fill="lightorange", + negative_fill="lightgray", + track="0.5p,red", + ) + fig.show() """ position = _parse_position( position, From bbb13b50158029ffc9c70da0103cfa73e2f01f94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Sat, 3 Oct 2026 20:46:46 +0200 Subject: [PATCH 2/3] Skipt inline example in doc tests --- pygmt/src/wiggle.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pygmt/src/wiggle.py b/pygmt/src/wiggle.py index 5fe8dee0e13..f71b20e64bf 100644 --- a/pygmt/src/wiggle.py +++ b/pygmt/src/wiggle.py @@ -12,6 +12,8 @@ from pygmt.params import Axis, Frame, Pattern, Position from pygmt.src._common import _parse_position +__doctest_skip__ = ["wiggle"] + @fmt_docstring @use_alias( From baf7beedfd8332e0479e24bebd75b10b3fcd6dce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Sat, 3 Oct 2026 22:25:40 +0200 Subject: [PATCH 3/3] Write code as inline example --- pygmt/src/wiggle.py | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/pygmt/src/wiggle.py b/pygmt/src/wiggle.py index f71b20e64bf..9bee4b56a7d 100644 --- a/pygmt/src/wiggle.py +++ b/pygmt/src/wiggle.py @@ -134,28 +134,28 @@ def wiggle( Examples -------- - import numpy as np - import pygmt - - x = np.arange(-7, 7, 0.01) - y = np.zeros(x.size) - z = np.exp(-((x / 2) ** 2)) * np.sin(2 * np.pi * x) - - fig = pygmt.Figure() - fig.basemap(region=[-8, 10, -1, 1], projection="X10c/5c", frame=True) - fig.wiggle( - x=x, - y=y, - z=z, - scale="0.5c", - length=1, - position="RM", - pen="0.5p,", - positive_fill="lightorange", - negative_fill="lightgray", - track="0.5p,red", - ) - fig.show() + >>> import numpy as np + >>> import pygmt + >>> + >>> x = np.arange(-7, 7, 0.01) + >>> y = np.zeros(x.size) + >>> z = np.exp(-((x / 2) ** 2)) * np.sin(2 * np.pi * x) + >>> + >>> fig = pygmt.Figure() + >>> fig.basemap(region=[-8, 10, -1, 1], projection="X10c/5c", frame=True) + >>> fig.wiggle( + ... x=x, + ... y=y, + ... z=z, + ... scale="0.5c", + ... length=1, + ... position="RM", + ... pen="0.5p,", + ... positive_fill="lightorange", + ... negative_fill="lightgray", + ... track="0.5p,red", + ... ) + >>> fig.show() """ position = _parse_position( position,