Having used st.placeholder to go back to the 'default' chart and settings, is there a way to make the transition more smooth?

The below Gif is a result of the placeholder being applied. The issue is when I select a new option from the available options, the graph goes ‘off’ and then re-appears. Is there a way to make this more smooth?

Code is here

Based on your code, I think this is less about using st.empty() as a placeholder, but the fact that matplotlib/seaborn re-draw the entire scene each time the graph changes. For the original use case, where people created publication-quality graphics, the render time was acceptable, but for web, it can be a bit broken.

The best solution I can suggest for now would be to use one of the web-based plotting libraries if you can: plotly, altair, bokeh. All of these are built with the web use case in mind, and as such, as much more selective about which elements are common between runs and which ones need to be re-drawn.

Best,
Randy

Thanks for your response, will try this later today. :slight_smile: