Skip to content

Issue when trying to plot points with transform that requires more/fewer coordinates than it returns #3983

Closed
@astrofrog

Description

@astrofrog

Let's say we have a transform tr that takes 2-dimensional input and returns 2-dimensional input. If I do:

plt.plot(x, y, transform=tr)

x and y will get passed to tr.transform. Now in some cases the transformation may require 3 coordinates and return 2 'final' coordinates to be plotted (e.g. astrofrog/wcsaxes#148).

For example I might have a transformation that takes longitude, latitude, and altitude and translates these into a 2-d position in a satellite image. In this case if I want to plot points I'd like to be able to do:

plt.plot(longitude, latitude, altitude, transform=tr)

However this doesn't work (and I tried a few other ways to). Is there a way to get this to work, and if not, could it be considered as a feature request? Just to be clear, the transform would always return two coordinates, but could take any arbitrary number of inputs.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions