Repository navigation
Open
Labels
feature requestNew feature wantedNew feature wanted
Milestone
Description
This issue serves as the central place for discussing and tracking the implementation of the coast method in PyGMT. The issue will be closed when the initial implementation is complete. Progress is tracked at PyGMT: Wrapping GMT modules.
Documentation
- GMT: https://docs.generic-mapping-tools.org/dev/coast.html
- GMT.jl: https://www.generic-mapping-tools.org/GMTjl_doc/documentation/modules/coast
- PyGMT: https://www.pygmt.org/dev/api/generated/pygmt.Figure.coast.html
GMT Option Flags and Modifieres
☑️: Implemented; ⬜: To be implemented/discussed; Strikethrough: Won't implement.
-
-R:region -
-J:projection -
-A -
-B:frame -
-C:lakes/river_lakesBREAKING: Figure.coast: Add parameter river_lakes for setting fills of river-lakes separately #4376 -
-D:resolutionFigure.coast/pygmt.grdlandmask/pygmt.select: Refactor to use the new alias system for parameter 'resolution' #4013 -
-E -
-G:land -
-F:box. No longer needed after Add Figure.scalebar to plot a scale bar on maps #4015, Figure.directional_rose: Add a directional rose on map #4164, Add Figure.magnetic_rose to plot a magnetic rose on map #4051 -
-I:riversFigure.coast: Migrate the rivers parameter to the new alias system and improve docstrings #4242 -
-L: Add a map scale. Will be implemented in Add Figure.scalebar to plot a scale bar on maps #4015 -
-M -
-N:bordersFigure.coast: Migrate the borders parameter to the new alias system and improve docstrings #4257 -
-Q -
-S:water -
-Td: Add a directional rose. Will be implemented in Figure.directional_rose: Add a directional rose on map #4164 -
-Tm: Add a magnetic rose. Will be implemented in Add Figure.magnetic_rose to plot a magnetic rose on map #4051 -
-W:shorelinesFigure.coast: Migrate the shorelines parameter to the new alias system and improve docstrings #4258 -
: Use-UFigure.timestampinstead. -
-V: verbose -
: Use-X/-YFigure.shift_origininstead. -
-bo -
-c: panel -
-do -
-p:perspective -
-t:transparency -
-: -
: Use--PAR=valuepygmt.configinstead.
Linked Pull Requests
- Initial feature implementation
- Add a tutorial or gallery example
Related Issues and Discussions
*Add links to related wrapper discussions, API design threads, or upstream GMT changes here.
Metadata
Metadata
Assignees
Labels
feature requestNew feature wantedNew feature wanted
Type
Projects
- StatusShow more project fieldsNo status
Activity
seisman commentedon Aug 10, 2026
Implementation of the
-EOptionThe
coastmodule’s-Eoption paints or fills country polygons using the DCW dataset, rather than the GSHHG dataset. As a result, manycoastoptions, such as-A,-C,-D,-F,-G,-I,-L,-N,-S,-T, and-W, do not affect-E.The
-Eoption is also quite flexible and complex. See the GMT documentation for details. Common examples include:-EJP+p1p+gblue-EJP,CN+p1p+gblue-EJP,CN+p1p+gblue -EAU,NZ+p1p+gred1. Current Syntax
Figure.coast(dcw="JP+p1p+gblue")Figure.coast(dcw="JP,CN+p1p+gblue")Figure.coast(dcw=["JP,CN+p1p+gblue", "AU,NZ+p1p+gred"])This syntax is simple, but not very Pythonic.
2. Dictionary-Like Syntax
Figure.coast(dcw={"code": "JP", "pen": "1p", "fill": "blue"})Figure.coast(dcw={"code": ["JP", "CN"], "pen": "1p", "fill": "blue"})Figure.coast(dcw=[ {"code": ["JP", "CN"], "pen": "1p", "fill": "blue"}, {"code": ["AU", "NZ"], "pen": "1p", "fill": "red"}, ])This syntax is more readable, but still somewhat complicated because users need to carefully combine lists and dictionaries. The dict-like syntax also doesn't support auto-completion well.
3. A Separate
Figure.dcwMethodFigure.dcw(code="JP", pen="1p", fill="blue")Figure.dcw(code=["JP", "CN"], pen="1p", fill="blue")To keep the method simple, users should call
Figure.dcwmultiple times when applying different pen or fill settings to different country codes.I prefer the separate
Figure.dcwmethod for several reasons:coastoptions do not affect DCW painting, soFigure.dcwwould only need a small number of parameters.Figure.coastdocstring much shorter.-Eoption itself has many advanced modifiers, such as+ffor specifying a different DCW file;+l,+L, and+nfor listing country codes; and+e,+r, and+Rfor adjusting the region. Implementing these options Pythonically would require adding several parameters toFigure.coast, whereas adding them toFigure.dcwwould be cleaner and easier.@GenericMappingTools/pygmt-maintainers What do you think? If OK with a separate
Figure.dcwmethod, I'll open a separate issue for tracking the wrapper and discuss the implementation details there.Also see #2646 (comment).