Label with several lines, each line one color

Hi all!
I have been trying to define different colors for each part of a concatenated label in my graph. I tried HTML-like labels but could not achieve it. Here follows my graph and the dot file. In my code the colors are generated automatically so I need to assign one color for each line. I have tried concatenating strings with pandas aggregation / join.
The error I get regarding the dot file is: syntax error in line 1 \n… …\n’]
Or: graphviz_cnet: syntax error in line 163 near ‘{’\n"]
The character varies depending on what I try to concatenate.

All the best,
graphviz_cnet_ONECOLOR.pdf (377.8 KB)
graphviz_cnet.dot (38.6 KB)

For multiple text colors (or sizes or fonts), you need html-text (Node Shapes | Graphviz)

digraph threecolors {

	o_10 -> i_10 [
	  label=<<font color="#bb0101">freq = 38 dep = 0.97</font><br align="left"/><font color="#01cc01">freq = 1 dep = 0.50</font><br align="left"/><font color="#ee02ee">freq = 24 dep = 0.96</font>>
		       arrowhead=none color=black fontcolor="#d758dd" fontname="sans-serif" labeldistance=10 minlen=4.0 penwidth=None]

}

Giving:
3colors

Yeah, that is what I tried to do based on the documentation. One thing I observed in your code is the double << and >> encapsulating the font attribute to contain all three lines. Maybe that is the reason. Thanks!

It worked! It was exactly this. My code was capable of joining the labels in one with respective colors, but the whole needed to be encapsulated in additional <…> so that Graphviz would consider them as one.