Skip to content

BUG: Fix NonUniformImage with nonlinear scale #27964

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

Merged
merged 2 commits into from
Apr 17, 2024

Conversation

trananso
Copy link
Contributor

@trananso trananso commented Mar 22, 2024

PR summary

Fixes a bug with NonUniformImage, where the image distorts when panning with a
nonlinear scale. Also addresses #13442, so the image correctly renders when the axes
scale changes.

Closes #27820.

PR checklist

@trananso trananso changed the title Fix non uniform image if x or y axis are log scale Fix NonUniformAxis if x or y axis are log scale Mar 22, 2024
@trananso trananso changed the title Fix NonUniformAxis if x or y axis are log scale [BUG] Fix NonUniformAxis if x or y axis are log scale Mar 22, 2024
@trananso trananso changed the title [BUG] Fix NonUniformAxis if x or y axis are log scale BUG: Fix NonUniformAxis if x or y axis are log scale Mar 22, 2024
@trananso trananso changed the title BUG: Fix NonUniformAxis if x or y axis are log scale BUG: Fix NonUniformImage if x or y axis are log scale Mar 22, 2024
@trananso trananso force-pushed the fix-logscale-axis branch from ec55244 to 3c581ad Compare March 26, 2024 18:15
@trananso trananso changed the title BUG: Fix NonUniformImage if x or y axis are log scale BUG: Fix NonUniformImage with nonlinear scale Mar 26, 2024
@trananso trananso marked this pull request as ready for review March 26, 2024 18:48
@trananso
Copy link
Contributor Author

Hi, would appreciate having someone look over this PR whenever you have the chance. Thanks!

ax.set_yscale("log")
if i == 2:
ax.set_xscale("log", base=2)
ax.set_yscale("log", base=3)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now it seems like the two bottom figures are identical?

Can you change so that the x-scale has base 3 instead? In that way it may be easier to see that it actually makes a difference?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't change the logic for picking pixel centers in this PR, so changing the base doesnt alter the image visually

@trananso trananso force-pushed the fix-logscale-axis branch from 3c581ad to 68ba589 Compare April 15, 2024 14:13
@tacaswell tacaswell requested a review from ksunden April 15, 2024 14:25
@tacaswell tacaswell added this to the v3.10.0 milestone Apr 15, 2024
@trananso trananso force-pushed the fix-logscale-axis branch from 68ba589 to 919a6cb Compare April 17, 2024 14:15
@ksunden ksunden merged commit 98506d0 into matplotlib:main Apr 17, 2024
28 of 33 checks passed
@trananso trananso deleted the fix-logscale-axis branch April 17, 2024 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Logscale Axis + NonUniformImage + GUI move tool = Distortion
4 participants