Skip to content

fig.coast() with just dcw kwarg fails #903

@liamtoney

Description

@liamtoney

Description of the problem

Using fig.coast(dcw=...) fails, asking for additional kwargs. I have to add another kwarg, like water='white', to get things to plot. I believe that dcw alone should be enough.

Full code that generated the error

import pygmt

fig = pygmt.Figure()
fig.coast(region='US', projection='S232.7435/90/8i', frame=['af', 'EWSn'], dcw='US+gred')
fig.show()

Expected output

out

Full error message

---------------------------------------------------------------------------
GMTInvalidInput                           Traceback (most recent call last)
<ipython-input-10-bd3570a700d7> in <module>
      2 
      3 fig = pygmt.Figure()
----> 4 fig.coast(region='US', projection='S232.7435/90/8i', frame=['af', 'EWSn'], dcw='US+gred')
      5 fig.show()

/opt/miniconda3/envs/roses/lib/python3.7/site-packages/pygmt/helpers/decorators.py in new_module(*args, **kwargs)
    279                 if alias in kwargs:
    280                     kwargs[arg] = kwargs.pop(alias)
--> 281             return module_func(*args, **kwargs)
    282 
    283         new_module.aliases = aliases

/opt/miniconda3/envs/roses/lib/python3.7/site-packages/pygmt/helpers/decorators.py in new_module(*args, **kwargs)
    423                         kwargs[arg] = separators[fmt].join(f"{item}" for item in value)
    424             # Execute the original function and return its output
--> 425             return module_func(*args, **kwargs)
    426 
    427         return new_module

/opt/miniconda3/envs/roses/lib/python3.7/site-packages/pygmt/src/coast.py in coast(self, **kwargs)
    191         raise GMTInvalidInput(
    192             """At least one of the following arguments must be specified:
--> 193             lakes, land, water, rivers, borders, Q, or shorelines"""
    194         )
    195     with Session() as lib:

GMTInvalidInput: At least one of the following arguments must be specified:
            lakes, land, water, rivers, borders, Q, or shorelines

System information

Please paste the output of python -c "import pygmt; pygmt.show_versions()":

PyGMT information:
  version: v0.0.0
System information:
  python: 3.7.9 | packaged by conda-forge | (default, Feb 13 2021, 19:53:10)  [Clang 11.0.1 ]
  executable: /opt/miniconda3/envs/roses/bin/python
  machine: Darwin-20.3.0-x86_64-i386-64bit
Dependency information:
  numpy: 1.16.2
  pandas: 1.1.5
  xarray: 0.15.0
  netCDF4: 1.5.3
  packaging: 20.9
  ghostscript: 9.53.3
  gmt: 6.1.1
GMT library information:
  binary dir: /opt/miniconda3/envs/roses/bin
  cores: 8
  grid layout: rows
  library path: /opt/miniconda3/envs/roses/lib/libgmt.dylib
  padding: 2
  plugin dir: /opt/miniconda3/envs/roses/lib/gmt/plugins
  share dir: /opt/miniconda3/envs/roses/share/gmt
  version: 6.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedHelping hands are appreciatedupstreamBug or missing feature of upstream core GMT

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions