-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Semilog plots with zero values #3998
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
attn @jbmohler |
Retagged this as 1.5.x as this commit is not on the 1.4.x branch phew. |
Good, I'm also glad to see this is not on the 1.4.x branch. I looked at this a bit, but it's not obvious to me how the optimized constructor is in-equivalent from the normal Path init relevant to this bug. My general comment is that looking at this reminded me how expensive the transform code is in the drawing. In fact, it appears that the transform is run separately/redundantly for the vertices and the path. It seems there are two performance issues -- this transform could be cached for later screen updates (e.g. resizing the window doesn't require recomputing the log transform) and the redundancy alleged in this paragraph. It may make sense to revert the change and look at the transform code altogether. Certainly that's a daunting prospect. Perhaps here is as good as any place to make my next mildly outrageous claim. There's a 4-fold (or more) rendering speed improvement for interactive applications (e.g. qtagg backend) to be had by doing the following 3 things:
These things are in order of speed gain so it's difficult for me to get enthusiastic about attacking transform code. |
example from PR matplotlib#3998
@jbmohler I have also been looking at it and am also not seeing what is different. Can you send an email to the devel list re fastaxes? I am glad some one is looking into ways to make mpl more efficient/better for interactive work! |
example from PR matplotlib#3998
Fixes matplotlib#3998. The issue is that some transfroms sometimes returned masked arrays from `transform_non_affine` (ex Log10transform). The `Path` constructor fills masked arrays to full arrays with `np.nan`, but the `_fast_from_codes_and_verts` does not (as it assumes the verts have been fully validated on the way in). This adds the maskedarray -> np.nan filled array normalization into `transform_path_non_affine`.
example from PR matplotlib#3998
Fixed by #4050 |
Consider the following test code:
Correct Plot (the value y=0 at x=0 is masked out from y-log plot):

Wrong Plot (spurious point at x=0 with y=1e-1):

A
git bisect
tells me that:The commit diff introduces the use of
_fast_from_codes_and_verts
,so the issue is probably somewhere deeper inside this function.
The text was updated successfully, but these errors were encountered: