I'm starting working with graphviz and I have problem with creating new nodes with this same label. For example for word "sentence" I would like to create graph with 8 nodes: s -> e -> n -> t -> e -> n -> c -> e Now I'm receiving graph with only 5 nodes (one "e" instead of 3 and one "n" instead of 2). I need to create more nodes with this same label (value).
Example of my problem may be this image http://rdftwig.sourceforge.net/paper/diagrams/bfsdeep.png where there are 2 nodes with value "C", "E" and "D".
Is it possible? If it is possible how can I access in my example with word "sentence" first, second or third "e" node?
You could define your nodes explicitly and set the label for them. Then each node has an unique id, but can have the same labels. Consider this example:
strict graph G {
1 [label="A"];
2 [label="B"];
3 [label="B"];
4 [label="A"];
1 -- 2;
2 -- 3;
3 -- 4;
}
which will output (with dot
):
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