-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Scatter autoscaling still has issues with log scaling and zero values #16552
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
Hey, I'm new to matplotlib and I am willing to contribute. Would this be a good first issue? If so what are some first steps in tackling this issue? |
@JadinLuong yes, this is suitable as a first issue. First steps:
If you have technical trouble or want to learn the development workflow and conventions for Matplotlib, check the developers guide. Since this is quite lengthy, you may also ask if you have a particular question. |
The problem here is that Updating using the On log scales, any view limit <= 0 is set to To fix this, there would need to be some change in |
So this would need some coordination to say that This is perhaps not difficult, but might require some carefulness and thorough testing, so I'm not too sure it'll be fixed for 3.2.2. |
Surprisingly, this works and does not break any tests: diff --git a/lib/matplotlib/collections.py b/lib/matplotlib/collections.py
index 51c6c50a03..e785ceb462 100644
--- a/lib/matplotlib/collections.py
+++ b/lib/matplotlib/collections.py
@@ -290,9 +290,7 @@ class Collection(artist.Artist, cm.ScalarMappable):
# note A-B means A B^{-1}
offsets = np.ma.masked_invalid(offsets)
if not offsets.mask.all():
- points = np.row_stack((offsets.min(axis=0),
- offsets.max(axis=0)))
- return transforms.Bbox(points)
+ return offsets
return transforms.Bbox.null()
def get_window_extent(self, renderer): It just happens to work because If we added a second method that returned the points, while |
This test is a distilled out of matplotlib#16552.
This test is a distilled out of matplotlib#16552.
This test is a distilled out of matplotlib#16552.
This test is a distilled out of matplotlib#16552.
Hello!! Is this issue still open? I'd like to try it! |
Looks like #18642 has been opened to try to fix this one. Might not be a good starting point. |
I installed the 3.2.0rc3 package, and I can confirm that this fixes almost all the issues with autoscaling and
scatter
. However, if you have points with 0 for the y-axis and enable log scaling there is still an issue with the scatter plot auto scaling (that doesn't show up with the standardplot
function).Originally posted by @moloney in #6015 (comment)
The text was updated successfully, but these errors were encountered: