Rendering Matplotlib AxesSubplots in Streamlit

I figured it out - you can do this with something like this:

_ = math.ceil(math.sqrt(len(df.columns)))
fig, axs = plt.subplots(_, _, sharey=True)

for i, _c in enumerate(df.columns):
  ax = axs.flat[i]
  ax.hist(df[[_c]], bins=20)
  ax.set_title(_c)

st.pyplot(fig)
1 Like