Resizing a subplot after removing ticks and labels

In a figure consisting of two vertically aligned subplots, is there a way to resize the first subplot, which doesn’t have ticks and labels, so it uses the full width of the figure?

import matplotlib.pyplot as plt
import numpy as np

fig = plt.figure(figsize=(2, 1.5), dpi=300)
ax1 = fig.add_subplot(2,1,1, aspect='equal')
ax2 = fig.add_subplot(2,1,2)


ax2.plot(np.arange(0,10), np.random.rand(10), linewidth=1)
ax2.plot(np.arange(0,10), np.random.rand(10), linewidth=1)

Preformatted text

Perhaps post the original code versus a gist which may be ephemeral.

You can just set the position manually using set_position.