exporting graph to svg fails
Hi, I cannot export graphs to svg files with graph_draw(). Exporting to pdf or png works fine. With svg, it raises an ExpatError: File "/home/alex/graphtoolenv/lib/python3.6/site-packages/graph_tool/draw/cairo_draw.py", line 1197, in graph_draw img = IPython.display.SVG(data=out.getvalue()) File "/home/alex/graphtoolenv/lib/python3.6/site-packages/IPython/core/display.py", line 599, in __init__ self.data = data File "/home/alex/graphtoolenv/lib/python3.6/site-packages/IPython/core/display.py", line 717, in data x = minidom.parseString(svg) File "/usr/lib64/python3.6/xml/dom/minidom.py", line 1968, in parseString return expatbuilder.parseString(string) File "/usr/lib64/python3.6/xml/dom/expatbuilder.py", line 925, in parseString return builder.parseString(string) File "/usr/lib64/python3.6/xml/dom/expatbuilder.py", line 223, in parseString parser.Parse(string, True) ExpatError: no element found: line 1, column 0 Any idea of the reason why it fails? My graph-tool version is ''2.26 (commit b89e6b4e, Thu Nov 9 14:55:43 2017 +0000)'' manually compiled with Python3.6 on arch linux with "core/expat 2.2.5-1" and "multilib/lib32-expat 2.2.2-1". Thanks Regards, Alex
On 09.03.2018 14:24, Alexandre Bovet wrote:
Hi,
I cannot export graphs to svg files with graph_draw(). Exporting to pdf or png works fine. With svg, it raises an ExpatError:
File "/home/alex/graphtoolenv/lib/python3.6/site-packages/graph_tool/draw/cairo_draw.py", line 1197, in graph_draw img = IPython.display.SVG(data=out.getvalue())
File "/home/alex/graphtoolenv/lib/python3.6/site-packages/IPython/core/display.py", line 599, in __init__ self.data = data
File "/home/alex/graphtoolenv/lib/python3.6/site-packages/IPython/core/display.py", line 717, in data x = minidom.parseString(svg)
File "/usr/lib64/python3.6/xml/dom/minidom.py", line 1968, in parseString return expatbuilder.parseString(string)
File "/usr/lib64/python3.6/xml/dom/expatbuilder.py", line 925, in parseString return builder.parseString(string)
File "/usr/lib64/python3.6/xml/dom/expatbuilder.py", line 223, in parseString parser.Parse(string, True)
ExpatError: no element found: line 1, column 0
Any idea of the reason why it fails?
Without a minimal and self-contained example that shows the problem is impossible to say anything. Just an error message without context is unhelpful. (E.g. from the error message I can infer that you are using a Python notebook. This is important information that you failed to mention). Best, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>
Sure, Your comment made me think about the IPython aspect. I found that the issue was due to the usage of both the inline=True and svg format at the same time. If I use inline=False, the svg export works fine. Thanks, Best, Alex On Fri, Mar 9, 2018 at 3:38 PM, Tiago de Paula Peixoto <tiago@skewed.de> wrote:
On 09.03.2018 14:24, Alexandre Bovet wrote:
Hi,
I cannot export graphs to svg files with graph_draw(). Exporting to pdf or png works fine. With svg, it raises an ExpatError:
File "/home/alex/graphtoolenv/lib/python3.6/site-packages/graph_ tool/draw/cairo_draw.py", line 1197, in graph_draw img = IPython.display.SVG(data=out.getvalue())
File "/home/alex/graphtoolenv/lib/python3.6/site-packages/ IPython/core/display.py", line 599, in __init__ self.data = data
File "/home/alex/graphtoolenv/lib/python3.6/site-packages/ IPython/core/display.py", line 717, in data x = minidom.parseString(svg)
File "/usr/lib64/python3.6/xml/dom/minidom.py", line 1968, in parseString return expatbuilder.parseString(string)
File "/usr/lib64/python3.6/xml/dom/expatbuilder.py", line 925, in parseString return builder.parseString(string)
File "/usr/lib64/python3.6/xml/dom/expatbuilder.py", line 223, in parseString parser.Parse(string, True)
ExpatError: no element found: line 1, column 0
Any idea of the reason why it fails?
Without a minimal and self-contained example that shows the problem is impossible to say anything. Just an error message without context is unhelpful. (E.g. from the error message I can infer that you are using a Python notebook. This is important information that you failed to mention).
Best, Tiago
-- Tiago de Paula Peixoto <tiago@skewed.de>
_______________________________________________ graph-tool mailing list graph-tool@skewed.de https://lists.skewed.de/mailman/listinfo/graph-tool
participants (2)
-
Alexandre Bovet -
Tiago de Paula Peixoto