Skip to content Skip to sidebar Skip to footer

How To Make Matplotlibs Nbagg Backend Generate Svgs?

Currently, I'm using the following at the start of my notebook to generate SVG plots: %matplotlib inline %config InlineBackend.figure_format = 'svg' When using the nbagg backend i

Solution 1:

The Agg backend in matplotlib uses the Anti-Grain Geometry 2D graphics library to generate bitmap graphics. The documentation for the backend states:

Output to RGBA and PNG, optionally JPEG and TIFF

The NbAgg backend wraps the Agg backend (via WebAgg core) and so is also limited to those output types.

Note that this simply defines the backend used to generate figures for viewing. Regardless of backend, you can still save figures to SVG format using figure.savefig('<filename'> format='svg') (or using a filename ending in .svg).

Post a Comment for "How To Make Matplotlibs Nbagg Backend Generate Svgs?"