Add the ability invert the X and/or Y axis #125
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
By "invert" I mean to change the default direction of the axis. The standard convention for plots is for +X to go to the right and +Y to go up. In some scenarios, particularly working with images or camera coordinates, +Y should point down.
There's already an existing strategy for inverting the Y axis in the
PlotTransform
struct, since screen coordinates have +Y pointing down and plots conventionally have +Y pointing up. That strategy was expanded upon and made configurable fromPlot
.A few questions:
PlotTransform::new
by providingPlotTransform::new_with_invert_axis
which is a bit cumbersome to write out. Would we rather break the API by just adding a parameter tonew
?