MacOS + streamlit + Python 3.9.
I have an issue using seaborn.
import seaborn as sns nb_currentprovider = plt.figure(figsize=(10,6)) sns.countplot(x="current_provider",data=df_ventes) plt.title("Répartition des ventes selon l'opérateur actuel du client", fontsize=14) plt.xlabel("Volume de ventes", fontsize=12) plt.ylabel("Opérateur actuel", fontsize=12); st.pyplot(nb_currentprovider) My app is blank, I had the same problem with matplotlib but now it is working with:
from matplotlib.backends.backend_agg import RendererAgg _lock = RendererAgg.lock Does a similar solution exist for seaborn?
31 Answer
Here is an example on windows 10 using seaborn.
Code
import seaborn as sns import matplotlib.pyplot as plt import streamlit as st titanic = sns.load_dataset("titanic") fig = plt.figure(figsize=(10, 4)) sns.countplot(x="class", data=titanic) st.pyplot(fig)
