-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[ENH]: Add id attribute to top level svg tag #28535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What do you mean by "consistent"? |
As in, an |
It is changed by setting the matplotlib/lib/matplotlib/backends/backend_svg.py Lines 649 to 655 in 6b7b999
so when we open a group either we use |
This is where we call matplotlib/lib/matplotlib/figure.py Line 3156 in 6b7b999
|
Problem
I would like to link Matplotlib SVGs directly and fully in another SVG using the
<use>
tag:This allows one to export the linked SVGs as vectors to PDF in Inkscape. However, including a full SVG file requires the presence of an
id
attribute in the top<svg>
tag. Currently, the first tag with a consistentid
attribute is thefigure_1
group, but using this leads to scaling issues.Proposed solution
I propose to include a fixed
id="svg1"
in the top level<svg>
tag:Which can be accomplished with a small addition to
__init__()
of theRendererSVG
class:The text was updated successfully, but these errors were encountered: