fig = plt.figure()
fig.add_subplot(2, 2, 1)
fig.add_subplot(2, 2, 2)
fig.add_subplot(3, 2, (3, 4))
draws as expected

but the animation
import matplotlib.animation as animation
class Animation(animation.TimedAnimation):
def __init__(self):
fig = plt.figure()
fig.add_subplot(2, 2, 1)
fig.add_subplot(2, 2, 2)
fig.add_subplot(3, 2, (3, 4))
animation.TimedAnimation.__init__(self, fig, blit=True)
def _draw_frame(self, frame_idx): pass
def new_frame_seq(self): return iter(range(2))
ani = Animation()
ani.save('test.mp4')
inserts much padding

This can be remedied via fig.subplots_adjust(left=0, right=1, bottom=-.5, top=1)
(note negative bottom
), but it changes the originally intended proportions. Additionally, plt.show()
at end of animation draws same as direct plot (without subplots_adjust
), but it's only the last frame.
How to make animation
pad same as direct plot, or otherwise remove this padding? matplotlib 3.4.3
, Windows 10