[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: |
Thu, 2 Feb 2012 23:23:45 +0100 |
Further to my previous email: you can follow the progress of this bug here:
https://bugs.launchpad.net/igraph/+bug/925768
--
T.
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
>