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