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

Direct all to imshow fails when calling with a byte format image #9

Open
cwgamma opened this issue Jun 19, 2017 · 1 comment
Open

Comments

@cwgamma
Copy link

cwgamma commented Jun 19, 2017

I create an image, mapping data in the range 0->1.0 through the colormap

import matplotlib as mpl
cmap = mpl.cm.get_cmap('jet')
img_rgba = cmap(dt, bytes=True)
The shape of the array is (2687,2456,4), then I scale the RGB values so that the array is then reduced to (2687,2456,3)
then:
fig = plt.figure(figsize(fw,fh)
ax1 - fig.add_axes([0.0,0.0,1. 0.95])
cax modest_image.imshow(ax1, img_rgba, interpolation=imode, vmin=0, vmax=255, cmap=cmap)

but at the end, when I call plt.show()
I get this error:

/Users/cw/anaconda3/lib/python3.5/site-packages/matplotlib/image.py:328: RuntimeWarning: divide by zero encountered in double_scalars
in_bbox.height / A.shape[0])
Floating point exception: 8

What could be the problem?

@cwgamma
Copy link
Author

cwgamma commented Jun 19, 2017

The previous version of modest image, worked in my progam however nearest-neighbor interpolation (subsampling) was not working correctly while the matplotlib imshow was working correctly, just excruciatingly slow. The test program in the new modest_image package appears to work correctly. I tried using the updated modest_image on both python2 and 3.

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

No branches or pull requests

1 participant