I have the attached code to great a pydot graph and I would like one of the labels to have subscript. I tried the following but it just renders it as Y<SUB>2</SUB>
. How can I obtain it with subscript?
import pydot
graph = pydot.Dot(graph_type='digraph', rankdir="LR")
# add node
graph.add_node(pydot.Node('X', label='X'))
graph.add_node(pydot.Node('Y', label='Y<SUB>2</SUB>'))
# add edege
graph.add_edge(pydot.Edge('X', 'Y'))
graph.write_png("mygraph.png")