Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bokeh: save plot (as HTML) but don't show it

I am using Bokeh to produce HTML code including figures with show method This method ends on opening default browser with HTML opened in it.

I want to save the HTML code, without showing it. How can I do that ?

like image 551
RandomCoder Avatar asked Jul 22 '15 12:07

RandomCoder


People also ask

How do you show Bokeh plot in HTML?

Bokeh creates the HTML file when you call the show() function. This function also automatically opens a web browser to display the HTML file. If you want Bokeh to only generate the file but not open it in a web browser, use the save() function instead.

How do I save a Bokeh plot as a PNG?

Exporting PNG images Bokeh can generate RGBA-format Portable Network Graphics (PNG) images from layouts using the export_png() function. This functionality renders the layout in memory and then captures a screenshot. The output image will have the same dimensions as the source layout.

How do you add a Bokeh plot to a website?

You can achieve this with the server_document() function. This function accepts the URL to a Bokeh server application and returns a script that embeds a new session from that server every time the script executes. You can add this tag to an HTML page to include the Bokeh application at that point.


1 Answers

Solution is to replace calls to show by calls to save.

like image 67
RandomCoder Avatar answered Sep 26 '22 10:09

RandomCoder