[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] Dot labels with newlines
From: |
Tamás Nepusz |
Subject: |
Re: [igraph] Dot labels with newlines |
Date: |
Sun, 5 Feb 2012 23:50:28 +0100 |
Hi Justin,
This bug has been fixed in the most recent revision. The fix will be included
in the next minor release of igraph.
Cheers,
Tamas
On 2 Feb 2012, at 18:03, Justin McCann wrote:
> Does anyone have any recommendations for putting newlines (\n) into
> labels in a way that will make dot happy?
>
> Whenever I call g.write_dotfile(filename) with a graph that contains
> labels with newlines, the string formatting gets in the way a little
> bit.
>
> For example
> v['label'] = "foo\nbar"
>
> Ends up getting rendered in the dot file as
> 1 [label="foo
> bar"]
>
> which Dot doesn't like, and truncates at the end of the line (just
> "foo" gets rendered).
>
> If I try
> v['label'] = r"foo\nbar"
> or
> v['label'] = "foo\\nbar"
>
> the dotfile ends up with
> 1 [label="foo\\nbar"]
>
> Which dot renders as the string "foo\nbar" in the resulting graph image file.
>
> I've also tried HTML-formatted labels, but igraph puts them into the
> dotfile in double-quotes, and it needs to be in curly braces for HTML
> rendering.
>
> Any ideas?
>
> Thanks!
> Justin
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>