I have a figure in restructured text using a scale directive as follows:
.. figure:: images/my_image.svg
:scale: 150 %
The the image is perfectly OK in the HTML output of sphinx, except that it is not scaled. (The svg image has width and height information and a viewBox)
It is strange, that in contrast to png figures, the <img>
tag in the HTML file does not contain width and height attributes of the image (hm, can't sphinx determine width and height of the svg for some reason?).
What is the reason for this? Does sphinx support the :scale:
directive for svg figures?
You may try setting the width. This can also be assigned a percentage of the current line width as value.
.. figure:: images/my_image.svg
:width: 100%
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With