6

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.

user1251007
  • 15,891
  • 14
  • 50
  • 76
  • The SVG question has been asked [here](http://stackoverflow.com/q/24026618/873282). – koppor Jan 08 '16 at 22:51
  • Possible duplicate of [Exporting figures from Bokeh as svg or pdf?](https://stackoverflow.com/questions/24026618/exporting-figures-from-bokeh-as-svg-or-pdf) – bigreddot Jun 15 '17 at 16:02
  • As already pointed out, the other question specifically asked for svg files. This question is broader with png or svg files. – user1251007 Jun 30 '17 at 20:43

1 Answers1

1

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.

bigreddot
  • 33,642
  • 5
  • 69
  • 122
  • 2
    I am also using the same technique but it increases disk bytes in my VM to very high and the VM hangs. Is there any lightweight version or workaround? – Bhanuday Birla Mar 29 '19 at 05:31