You may set the intensity values yourself using the vmin
and vmax
arguments of the imshow
function:
for j in xrange(windows_a.shape[0]):
print j
vmin, vmax = windows_b[j].min(), windows_b[j].max()
pl.imshow(windows_a[j], vmin=vmin, vmax=vmax, interpolation='nearest')
pl.xticks(np.arange(0,window_size_1,1))
pl.yticks(np.arange(0,window_size_1,1))
pl.gray()
pl.grid( color = 'y' )
pl.savefig('./IW_small/IW_small_' + str("%05d" %i) + "_" + str("%05d" %j) + '.png')
pl.close()
pl.imshow(windows_b[j], vmin=vmin, vmax=vmax, interpolation='nearest')
pl.xticks(np.arange(0,window_size_2,1))
pl.yticks(np.arange(0,window_size_2,1))
pl.gray()
pl.grid( color = 'y' )
pl.savefig('./IW_big/IW_big_' + str("%05d" %i) + "_" + str("%05d" %j) + '.png')
pl.close()
Additionally, I would recommend to use the interpolation='none'
argument, since that usually works better with vector graphics. This doesn't make a difference for you PNG file, though.