fig = plt.figure()
ax = fig.add_subplot(111)
ticks_at = [-abs(data).max(), 0, abs(data).max()]
cax = ax.imshow(data, interpolation='nearest', origin='lower', extent=[0.0,
    0.1, 0.0, 0.1], vmin=ticks_at[0], vmax=ticks_at[-1])
cbar = fig.colorbar(cax, ticks=ticks_at, format='%1.2g')
fig.savefig('out.png')
Modifying axes on matplotlib colorbar plot of 2D array