Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate high resolution figures with Bokeh?

Tags:

plot

svg

bokeh

Is it possible to generate high resolution PNG figures or even scalable vector graphics/SVG files with Bokeh? If yes, how?

From what I could see from the example gallery, it is only possible to save low resolution PNG files.

like image 290
user1251007 Avatar asked Mar 12 '15 16:03

user1251007


1 Answers

This is a duplicate, but in case is it not deleted:

As of Bokeh 0.12.6, it is now possible to export PNG and SVG directly from Python code.

Exporting PNGs looks like this

export_png(plot, filename="plot.png")

And exporting SVGs looks like this

plot.output_backend = "svg"
export_svgs(plot, filename="plot.svg")

There are some optional dependencies that need to be installed. You can find more information in the Exporting Plots section of the User Guide.

like image 187
bigreddot Avatar answered Oct 04 '22 09:10

bigreddot