Skip to content

Setting frame=None gives unexpected results #1665

@jbusecke

Description

@jbusecke

Description of the problem

I am just getting started with pygmt and ran through the first example in the docs.

I wanted to play a bit with the example and tried to deactivate the frame

Full code that generated the error
When I modify

fig.basemap(region=[-90, -70, 0, 20], projection="M15c", frame=True)

to

fig.basemap(region=[-90, -70, 0, 20], projection="M15c", frame=None)

I get this rather cryptic error

Full error message

basemap [ERROR]: Must specify at least one of -A, -B, -D, -L, -T
---------------------------------------------------------------------------
GMTCLibError                              Traceback (most recent call last)
/tmp/ipykernel_493/1135014409.py in <module>
----> 1 fig.basemap(region=[-90, -70, 0, 20], projection="M15c", frame=None)

/srv/conda/envs/notebook/lib/python3.8/site-packages/pygmt/helpers/decorators.py in new_module(*args, **kwargs)
    584                     )
    585                     warnings.warn(msg, category=SyntaxWarning, stacklevel=2)
--> 586             return module_func(*args, **kwargs)
    587 
    588         new_module.aliases = aliases

/srv/conda/envs/notebook/lib/python3.8/site-packages/pygmt/helpers/decorators.py in new_module(*args, **kwargs)
    724                         kwargs[arg] = separators[fmt].join(f"{item}" for item in value)
    725             # Execute the original function and return its output
--> 726             return module_func(*args, **kwargs)
    727 
    728         return new_module

/srv/conda/envs/notebook/lib/python3.8/site-packages/pygmt/src/basemap.py in basemap(self, **kwargs)
     82         )
     83     with Session() as lib:
---> 84         lib.call_module("basemap", build_arg_string(kwargs))

/srv/conda/envs/notebook/lib/python3.8/site-packages/pygmt/clib/session.py in call_module(self, module, args)
    498         )
    499         if status != 0:
--> 500             raise GMTCLibError(
    501                 f"Module '{module}' failed with status code {status}:\n{self._error_message}"
    502             )

GMTCLibError: Module 'basemap' failed with status code 72:
basemap [ERROR]: Must specify at least one of -A, -B, -D, -L, -T

Since None is the default for the frame kwarg I am a bit confused here. Is frame=True always required?

System information

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

PyGMT information:
  version: v0.5.0
System information:
  python: 3.8.12 | packaged by conda-forge | (default, Sep 29 2021, 19:52:28)  [GCC 9.4.0]
  executable: /srv/conda/envs/notebook/bin/python
  machine: Linux-5.4.120+-x86_64-with-glibc2.10
Dependency information:
  numpy: 1.21.2
  pandas: 1.3.3
  xarray: 0.19.0
  netCDF4: 1.5.7
  packaging: 21.0
  ghostscript: 9.54.0
  gmt: 6.2.0
GMT library information:
  binary dir: /srv/conda/envs/notebook/bin
  cores: 4
  grid layout: rows
  library path: /srv/conda/envs/notebook/lib/libgmt.so
  padding: 2
  plugin dir: /srv/conda/envs/notebook/lib/gmt/plugins
  share dir: /srv/conda/envs/notebook/share/gmt
  version: 6.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfeature requestNew feature wanted

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions