I ran into a problem trying to save 920 pixels wide png from numpy data. One column is missing. It seems that only this width causes the problem (I tried some others and the problem did not occur). MWE:
import matplotlib.pyplot as plt
import numpy as np
a1 = np.zeros((919, 100))
a2 = np.zeros((920, 100))
a3 = np.zeros((921, 100))
plt.imsave('test1.png', a1)
plt.imsave('test2.png', a2)
plt.imsave('test3.png', a3)
The resulting images are 100 in height, but in width:
- test1: 919
- test2: 919
- test3: 921
What's going on here?
Versions:
- matplotlib: 1.4.3
- numpy: 1.9.2
source
share