Closed
Description
The imshow command in 2.0.0b4 and current master (07adcde) don't export images with colormaps correctly. The colormap is not scaled correctly:
This bug is not present in 1.5.1:
Some precisions:
- version 1.5.1 from ubuntu 16.04 repository
- git master (07adcde) #installed from source on ubuntu 16.04
Code to reproduce this behavior:
#!/usr/bin/env python2.7
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
print(matplotlib.__version__)
cmap = plt.cm.jet
# coordinates
bbox=20
resolution = 100
xcoords = np.linspace(0, bbox, resolution)
ycoords = np.linspace(-bbox, bbox, 2*resolution)
# evaluate
xnb = len(xcoords)
ynb = len(ycoords)
dat = np.zeros((ynb,xnb))
for i in range(xnb):
for j in range(ynb):
dat[j][i] = np.sqrt(xcoords[i]**2+ycoords[j]**2)
# export to png
plt.imsave("imshow.png", dat, cmap=cmap, vmin=0, vmax=None)
Metadata
Metadata
Assignees
Labels
For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.