whitphx's picture
whitphx HF staff
Copy https://github.com/whitphx/stlite/tree/main/packages/sharing-editor/public/samples/011_component_gallery
dd0ef30
raw history blame
No virus
268 Bytes
import streamlit as st
import numpy as np
import matplotlib.pyplot as plt
@st.experimental_memo
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)