My question is in Pydot how can I set the node order in a cluster?
My code is
import pydot
graph = pydot.Dot(graph_type='digraph', rankdir="LR")
graphlegend = pydot.Cluster(graph_name="legend", label="Legend", fontsize="15", color="red", style="filled", fillcolor="lightgrey")
legend1 = pydot.Node("Sample", style="filled", fillcolor="Tomato", shape="diamond", rank="same"); graphlegend.add_node(legend1)
legend2 = pydot.Node('a', style="filled", fillcolor="LightGoldenrod", shape="Mrecord", label="Protein", rank="same"); graphlegend.add_node(legend2)
node_c = pydot.Node("ff", style="filled", fillcolor="#9ACEEB", shape="square"); graph.add_node(node_c)
graph.write_png('Sample_diagraph.png')
I would like to have the cluster "legend" and the "node_c" in vertical order but the 2 nodes (legend1 and legend2) in the "graphlegend" cluster organized horizontally in line. I have tried to use rank=same but doesn't work Can you help me please?