StreamClosedError when displaying Seaborn plots

Hi Community,

I am getting a weird StreamClosedError when displaying Seaborn Plots. The app runs locally but I get a connection timed out error and does not display the plot.

Code causing the error :
diamonds_data = diamonds_data[:1000] #Taking a subset of our data
fig = sns.pairplot(diamonds_data)
st.pyplot(fig)

The complete code can be found here :

The error:
2021-03-03 11:13:41.466 Task exception was never retrieved
future: <Task finished coro=<WebSocketProtocol13.write_message..wrapper() done, defined at c:\users\vedanth\appdata\local\programs\python\python36\lib\sitTraceback (most recent call last):
File “c:\users\vedanth\appdata\local\programs\python\python36\lib\site-packages\tornado\websocket.py”, line 1102, in wrapper
await fut
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “c:\users\vedanth\appdata\local\programs\python\python36\lib\site-packages\tornado\websocket.py”, line 1104, in wrapper
raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError

Hi @vedanthv, where did you deploy this to, Streamlit sharing?

Yes @randyzwitch . But sometimes the plot does not render on localhost also