Skip to content

Commit

Permalink
Add inline example for coast (#2142)
Browse files Browse the repository at this point in the history
* Update coast.py to include inline example in docstring

Co-authored-by: Dongdong Tian <[email protected]>
Co-authored-by: Yvonne Fröhlich <[email protected]>
  • Loading branch information
3 people authored Oct 7, 2022
1 parent 6f70d22 commit de984aa
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions pygmt/src/coast.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
use_alias,
)

__doctest_skip__ = ["coast"]


@fmt_docstring
@use_alias(
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit de984aa

Please sign in to comment.