whitphx's picture
whitphx HF staff
Copy sample files from streamlit/docs/python/api-examples-source/* (4e54057)
9c1ffe9
raw
history blame contribute delete
263 Bytes
import matplotlib.pyplot as plt
import numpy as np
import streamlit as st
@st.cache_data
def load_fig():
arr = np.random.normal(1, 1, size=100)
fig, ax = plt.subplots()
ax.hist(arr, bins=20)
return fig, ax
fig, ax = load_fig()
st.pyplot(fig)