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

Automatic (x-)range too narrow #1070

Closed
brechmos-stsci opened this issue Oct 24, 2016 · 3 comments
Closed

Automatic (x-)range too narrow #1070

brechmos-stsci opened this issue Oct 24, 2016 · 3 comments
Labels
bug something broken

Comments

@brechmos-stsci
Copy link

Related code pen https://codepen.io/brechmos/pen/JRxVJg.

I have 3 scatter plots of data, each of a single point. Two of them are locked on the far left which is not what I would have expected. I would have expected to see all 3 points on the screen more centered within the plot figure.

I could set the range explicitly in order to get the plot that I was expecting, but it seems like there is a bug in the automatic range code.

@etpinard
Copy link
Contributor

Yeah, that looks like a bug to me too.

Thanks for posting.

@etpinard etpinard added the bug something broken label Oct 24, 2016
@alexcjohnson
Copy link
Collaborator

@brechmos-stsci late reply here, I'm just combing through old bugs.

You've got two points with identical x values and one with a slightly different x. What we try to do in this case is use the full x range (1.9743192951795587 - 1.9743192951795583 = 4e-16) to scale the x axis, then here because there are markers we add 5% to the range on either side so nothing is squished on the edge. But you're really close to the limit of javascript's double precision floating point here, so that we can't actually change the range by 5% - that rounds down to no change at all. This is also why the tick labels fail on that plot.

I suppose we could do something like limit the minimum fractional span of an axis (range[1] - range[0]) / ((range[1] + range[0]) / 2) > 1e-14. That would probably be better than letting things break like this. See also #1320.

@gvwilson
Copy link
Contributor

gvwilson commented Jun 5, 2024

Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson

@gvwilson gvwilson closed this as completed Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

No branches or pull requests

4 participants