☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Unable to update the same plot like plt.clf is used in matplotlib to overcome this and what can be used in bokeh?

Community Support
Bryan
Bryan

@kkr You need to describe your situation in more detail. Do you expect to be able to do this from python code (i.e. a Bokeh server app), or from javascript? Is this in a notebook (in which case push_notebook is an option)? What do you actually need to accomplish? If you are “clearing” to redraw the same glyphs with new data, you should just update the data. Bokeh is very good for updating data sources. If you are “clearing” to make a completely different kind of plot, you should just make a new plot and hide or remove the old plot entirely. Doing “surgery” to remove glyphs and their data sources from an existing plot (i.e. the direct analogue to clf) may work but would be discouraged and not idiomatic for Bokeh. But we can’t offer guidance until we know more about your use case.

⌁   Link to post

End of archived discussion · Replies are disabled