Is it possible to set the svg width and height 100% in matplotlib/seaborn

Viewed 547

I have a pipeline which is generating 30 individual boxplots svgs using matplotlib + seaborn. I want to visualize them in a 5*6 grid. Since I want to be able to zoom on specific plots I thought about something like that:https://codepen.io/arminsolecki/pen/xERZZb

It works but unfortunately the svg does not fit in the iframe.

I learned from another stackoverflow question Why don't my SVG images scale using the CSS "width" property?

that I have to modify the following line in the svg.

<svg height="720pt" version="1.1" viewBox="0 0 720 720" width="720pt" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">

I know I can do it using a xml parser but I am wondering if there is no better way? Like setting width/height to 100% when doing plt.savefig?

0 Answers
Related