-
Notifications
You must be signed in to change notification settings - Fork 102
Closed
Labels
Description
Description
I set up a subplots layout the way I need it for my figure and the subplots look good. But as soon as I start filling the axes with image-data using matshow
or imshow
, the layout is completely changed. It appears, the axes change their aspect ratio to one, resulting in large margins in the final plot.
Steps to reproduce
import proplot as plot
import numpy as np
f, axes = plot.subplots(nrows=2, ncols=5, aspect=4/3, wspace='3mm', hspace='3mm')
axes[0].matshow(np.random.randn(3,4))
Expected behavior: I expect to see a nicely aligned grid of axes with the given aspect ratio, the first axes should be completely filled with the random data, roughly like this (except for the missing data):
Actual behavior: The matshow command changes the layout:
Equivalent steps in matplotlib
Not sure whether this applies here, but with the matplotlib subplots
, the layout is not changed after the first matshow
.
import matplotlib.pyplot as plt
import numpy as np
f, axes = plt.subplots(2, 5, figsize=(4*5, 3*2))
axes[0, 0].matshow(np.random.randn(3,4))
f.subplots_adjust(hspace=0.1, wspace=0.1, left=0.02, right=0.98, top=0.98, bottom=0.02)
Proplot version
0.6.4
CatNofishing