I'm wondering if it is possible to split a node into two different colours. I'm using graphviz's dot (http://www.graphviz.org/).
Perhaps a verticle, or diagonal line could split the node into two colours. I want to do this because I have many nodes which belong to two different categories (colours) with some nodes belonging to both.
Many thanks, James
Gradient functionality was only added to Graphviz on January 26, 2012; until the new 2.30.0 stable version of Graphviz is released, you'll need to download Graphviz development version 2.29.20120127.0545 or newer.
In addition, gradients seem to only be implemented for the Cairo/Pango renderer so far; in my tests, the Quartz (Mac) and GD renderers fall back to using just the first color. In particular, this means if you're on a Mac and are using the Graphviz.app GUI viewer, you won't see gradients there (yet).
digraph G {
Gradient [style="filled", fillcolor="orange:yellow"]
}
I don't think there is an out-of-the-box solution to have 2 background colors.
The best solution would be to use gradient fills (fillcolor="orange:yellow"
) - but though this is in the documentation, I wasn't able to make it work on my box.
You could use HTML-like labels as a workaround. You may need to split the label to have it centered, depending on your needs:
a[shape="none", label=<
<table cellpadding="0" cellborder="0" cellspacing="0" border="0">
<tr>
<td bgcolor="orange">abc</td>
<td bgcolor="yellow">def</td>
</tr>
</table>
>]
It is possible, if you use the image
attribute of a label and provide a suitable background image:
digraph G {
i1 [shape=none, image="range.png", label=""];
i2 [shape=none, image="range.png", label="Image w label", imagescale=true];
i1 -> i2;
}
This gives the following output:
using the range.png
file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With