-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Closed
Description
Bug report
Bug summary
- The set_position() seems to be ignored if using tight_layout()
- A similar effect is observed when putting subplots_adjust() after set_position (see the code comment).
Code for reproduction
# Paste your code here
import matplotlib.pyplot as plt
import numpy.random as random
data = random.randn(255,255)
plt.close()
fig,axes = plt.subplots(2,1)
ax=axes[0]
im=ax.imshow(data, aspect='auto')
cb=plt.colorbar(im, ax=ax)
ax.set_xlabel('X data')
ax.set_ylabel('Y data')
pos0 = ax.get_position()
ax=axes[1]
pos1 = ax.get_position()
ax.set_position([pos1.x0, pos1.y0, pos0.width, pos1.height])
ax.plot([0,1])
ax.set_xlabel('Big')
ax.set_ylabel('Small')
plt.tight_layout() # put plt.subplots_adjust(left=0.2) here produces similar results
plt.show()Actual outcome
Expected outcome
Matplotlib version
- Matplotlib version, Python version and Platform (Windows, OSX, Linux ...)
Matplotlib 2.0.0, OSX - How did you install Matplotlib and Python (pip, anaconda, from source ...)
MacPorts
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels

