I am using the svgwrite module in my Python code and I would like to set a background color. So far I have not been able to find anything. Is there a way to do it?
I was hoping for something during the initialization:
import svgwrite
canvas = svgwrite.drawing.Drawing(fill="#225566") # or background="#225566", or sth similar
canvas.save('image.png')
Or I could probably draw rectangle all over the place, but that's just weird.
<svg>
(but not nested SVGs) for displaying in a browser, but that probably wouldn't work with an SVG-to-PNG converter. Nothing wrong with drawing a background coloured rectangle as your first element in the graphic. – Transmarine