Summary
Using the code below, the matplotlib fig vanishes every time streamlit reruns if I leave the parameter the same.
If I change the parameter of the fig, it shows up again.
The function is inside a class.
Steps to reproduce
Code snippet:
class FigureView:
#some code
@st.cache_resource
def risk_analysis_1_dot(_self, probability:str, impact:str, title:str):
#some code
return plt
If applicable, please provide the steps we should take to reproduce the error or specified behavior.
Expected behavior:
Fig matplotlib fig shows even if parameter were not chanched
Actual behavior:
.matplotlib fig vanishes if other values get updated but not matplotlib fig input data
Debug info
- Streamlit version: streamlit==1.21.0
- Python version: 3.10
- Using local venv