Skip to content

Figure.plot(T=True) fails #253

@seisman

Description

@seisman

Description of the problem

Figure.plot() always need an input file. However, if -T option is used, no input file is needed. This case needs special handling.

Full code that generated the error

import gmt
fig = gmt.Figure()
fig.basemap(projection="X10c", region="0/10/0/10", frame=True)
fig.plot(X='10c', T=True)
fig.show()

Full error message

~/Gits/gmt/gmt-python/gmt/base_plotting.py in plot(self, x, y, data, sizes, direction, **kwargs)
    314         kwargs = self._preprocess(**kwargs)
    315
--> 316         kind = data_kind(data, x, y)
    317

~/Gits/gmt/gmt-python/gmt/helpers/utils.py in data_kind(data, x, y, z)
     70     """
     71     if data is None and x is None and y is None:
---> 72         raise GMTInvalidInput("No input data provided.")
     73     if data is not None and (x is not None or y is not None or z is not None):
     74         raise GMTInvalidInput("Too much data. Use either data or x and y.")

GMTInvalidInput: No input data provided.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions