This is related to (or rather a follow-up) to new pythonic style for shared axes square subplots in matplotlib?.
I want to have subplots sharing one axis just like in the question linked above. However, I also want no space between the plots. This is the relevant part of my code:
f, (ax1, ax2) = plt.subplots(1, 2, sharex=True, sharey=True)
plt.setp(ax1, aspect=1.0, adjustable='box-forced')
plt.setp(ax2, aspect=1.0, adjustable='box-forced')
# Plot 1
ax1.matshow(pixels1, interpolation="bicubic", cmap="jet")
ax1.set_xlim((0,500))
ax1.set_ylim((0,500))
# Plot 2
ax2.matshow(pixels2, interpolation="bicubic", cmap="jet")
ax2.set_xlim((0,500))
ax2.set_ylim((0,500))
f.subplots_adjust(wspace=0)
And this is the result:
If i comment out the two plt.setp() commands, I get some added white borders:
How can I make the figure look like my first result, but with axes touching like in the second result?