pandoc-pyplot turns Python code present in your documents into embedded figures via Matplotlib or Plotly.
If function returns matplotlib.pyplot.Figure object, it cannot be cached with st.cache. While caching the return value of mk_figure(), Streamlit encountered an object of type matplotlib.spines.Spines, ...