-
Notifications
You must be signed in to change notification settings - Fork 572
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
Incorrect conversion of matplotlib SVG plots #1849
Comments
This is related to #1836 |
@adl Yes, I guess |
The encoding expains the >>> from lxml.html import clean
>>> icon = '''
... <?xml version="1.0" encoding="UTF-8"?>
... <!-- Created with Inkscape (http://www.inkscape.org/) -->
... <svg id="svg3196" width="16" height="16" version="1.0" xmlns="http://www.w3.org/2000/svg">
... <rect id="rect2388" transform="rotate(-90)" x="-15.5" y="3.5" width="14" height="9" rx="0" ry="0" style="fill:none;stroke-linecap:square;stroke:#969696"/>
... <path id="rect3160" d="m6.5 0.5h3" style="fill:none;stroke-linecap:square;stroke:#969696"/>
... <rect id="rect3162" transform="rotate(-90)" x="-14" y="5" width="4" height="6" style="fill:#878787"/>
... </svg>'''
>>> clean.clean_html(icon)
'<svg id="svg3196" width="16" height="16">\n \n \n \n</svg>' |
I guess that can be fixed by using a custom |
An additional point. Looking at the templates, I find weird that HTML is conditionally passed through
where |
@martinRenou and @SylvainCorlay this |
With #1854 the implementation of |
Any changes/updates? Or, when will |
Urgh -- I wasted loads of time trying to make a high-res png plot "look" like an svg, and I finally gave up and used: #1836 (comment) |
Thanks for the comments and help! Isn't then this simple enough that somebody implements it in |
This should be fixed by #1890 ... |
Yes, I am seeing the same issue as @luboshanus and just seeing black canvases. |
Running |
I posted a workaround here if you are using nbconvert programmatically. |
Steps to reproduce:
Notebook showing the issue
nbconvert output
Screenshot of the notebook:
Screenshot of the HTML output:
Nbconvert version: 7.0.0
The text was updated successfully, but these errors were encountered: