From de984aa8fec45ceb8c6c6d0f024b2f8b483a6887 Mon Sep 17 00:00:00 2001 From: Will Schlitzer Date: Fri, 7 Oct 2022 18:45:44 -0400 Subject: [PATCH] Add inline example for coast (#2142) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update coast.py to include inline example in docstring Co-authored-by: Dongdong Tian Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com> --- pygmt/src/coast.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/pygmt/src/coast.py b/pygmt/src/coast.py index 403d89b7d18..ce869689e1a 100644 --- a/pygmt/src/coast.py +++ b/pygmt/src/coast.py @@ -12,6 +12,8 @@ use_alias, ) +__doctest_skip__ = ["coast"] + @fmt_docstring @use_alias( @@ -180,6 +182,29 @@ def coast(self, **kwargs): {perspective} {transparency} {verbose} + + Example + ------- + >>> import pygmt + >>> # Create a new plot with pygmt.Figure() + >>> fig = pygmt.Figure() + >>> # Call the coast method for the plot + >>> fig.coast( + ... # Set the projection to Mercator, and plot size to 10 cm + ... projection="M10c", + ... # Set the region of the plot + ... region=[-10, 30, 30, 60], + ... # Set the frame of the plot + ... frame="a", + ... # Set the color of the land to "darkgreen" + ... land="darkgreen", + ... # Set the color of the water to "lightblue" + ... water="lightblue", + ... # Draw national borders with a 1-point black line + ... borders="1/1p,black", + ... ) + >>> # Show the plot + >>> fig.show() """ kwargs = self._preprocess(**kwargs) # pylint: disable=protected-access if not args_in_kwargs(args=["C", "G", "S", "I", "N", "E", "Q", "W"], kwargs=kwargs):