Skip to content

Figure.plot(T=True) fails #253

Closed
Closed

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.

Activity

  1. leouieda commented on Jan 16, 2019

    @leouieda
    Member

    This is one of those weird quirks of GMT that are very unintuitive. Why would we call plot to move the cursor? We should implement a new module for this instead of allowing the T argument. Something like Figure.shift_origin(xoffset, yoffset).

  2. seisman commented on Jan 16, 2019

    @seisman
    MemberAuthor

    Totally agree with you. Do you think it's better if GMT itself have a module like gmt shift.

  3. leouieda commented on Jan 16, 2019

    @leouieda
    Member

    Maybe. I'm not sure we should be adding so many new modules to GMT at this point. Particularly with the division increasing between modern and classic mode.

  4. added
    bug
    on Jan 22, 2019
  5. leouieda commented on Jan 22, 2019

    @leouieda
    Member

    Created #267 to add a shift_origin method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions