In the ax.hist docs, there is a related example of reusing np.histogram output:
The weights parameter can be used to draw a histogram of data that has already been binned by treating each bin as a single point with a weight equal to its count.
counts, bins = np.histogram(data)
plt.hist(bins[:-1], bins, weights=counts)
We can use the same approach with ax.hist since it also returns counts and bins (along with a bar container):
x = np.random.default_rng(123).integers(10, size=100)
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 3))
counts, bins, bars = ax1.hist(x) # original hist
ax2.hist(bins[:-1], bins, weights=counts) # rebuilt via weights params

Alternatively, reconstruct the original histogram using ax.bar and restyle the width/alignment to match ax.hist:
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 3))
counts, bins, bars = ax1.hist(x) # original hist
ax2.bar(bins[:-1], counts, width=1.0, align='edge') # rebuilt via ax.bar
