Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User-specified axis ranges #14

Open
JeroenDelcour opened this issue Jan 11, 2022 · 0 comments
Open

User-specified axis ranges #14

JeroenDelcour opened this issue Jan 11, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@JeroenDelcour
Copy link
Owner

Currently, the axis range is determined by the range of the input data, i.e. min(x), max(x) for the X axis. It would be nice to be able to override that, e.g. when plotting percentages you often want the range to be from 0 to 1.

Proposed syntax:

fig = tplot.Figure(xlim=(0, None), ylim=(0,1))

xlim and ylim each take a (min, max) tuple. None means the value should be taken from the input data. So in the above example, the X axis range would be from 0 to max(x) and the Y axis range would be from 0 to 1.

This may seem like a simple feature, but it affects the code in a bunch of different places. Care should also be taken to handle values in the input data that fall outside the specified range.

@JeroenDelcour JeroenDelcour added the enhancement New feature or request label Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant