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

ImagePlot panning issue at edge when zoomed in #198

Open
tangobravo opened this issue May 23, 2014 · 2 comments · May be fixed by #199
Open

ImagePlot panning issue at edge when zoomed in #198

tangobravo opened this issue May 23, 2014 · 2 comments · May be fixed by #199

Comments

@tangobravo
Copy link

After zooming in an image and panning so that image is almost outside the plot region, but only has 2 rows or columns visible, the image is drawn incorrectly, so the first row or column is duplicated across the entire plot region. Attached 2 screenshots to show when the problem appears - a Pan that makes 2.5 pixel columns visible is fine, but when the plot region contains >0 and <2 pixel columns the first column is stretched to fill the plot.

The plot in the screenshots was simply imshow('capitol.jpg') but seems to affect all ImagePlots.

panok
panbug

I'm currently investigating. The problem appears to be in _calc_zoom_coords in image_plot.py as the gc_rect it returns does look spurious in these cases.

Working through the maths now and will submit a pull request when I get to the bottom of it.

@tangobravo
Copy link
Author

This is an issue for my use as I'll be overlaying lots of small image patches on a larger base image and will want to zoom and pan around the whole plot.

@tangobravo
Copy link
Author

I've added a pull request with the fix for this. The "really, really, subpixel cases" assumed the extremes of the computed subimage_coords were always outside the plot bounds, which is not the case when panning to an edge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant