-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Axis limits are set badly with small values in scatter(). #9979
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
Comments
Yes, it's scatter's specialness. I bet plot doesn't do that. |
No, plot() doesn't do that. |
I have been trying to see why scatter is behaving in a different way. I realized that some of the code used by scatter is in _path.h. The get_path_collection_extents method gets called from path.py to figure out the dimensions to give to the bounding box. I would be interested in pursuing this further, but I am just not sure how to debug the c++ part of the library, any tips would be appreciated. |
@Lusura My knee jerk reaction is that the bug is not in the c++ layer, but in how we massage the returns of those calls in python. One of the things scatter tries to take into account is that the size of the markers can vary in size which may be related to this. Agree is in related to #7413. |
Here's a trivial demo which doesn't do what anyone would expect: https://stackoverflow.com/questions/53536688/matplotlib-automatically-sets-insane-datetime-x-axis-range The code:
Summary: The simplest possible scatter plot of a time series on a single date chooses nonsensically huge x bounds, making the plot useless for visualization by default. |
AFAICT this (both examples) has been fixed by #13642. Feel free to reopen if something is missing. |
I'm not sure if this is related to #7413
Bug report
Example:
produces this:

It should really produce something more like this:
There's not an obvious way to do this, other than manually getting the min/max x and y values and adding a little bit and using
ax.set_x/ylim()
Using conda on kubuntu:
The text was updated successfully, but these errors were encountered: