diff --git a/treelib/tree.py b/treelib/tree.py index c687ec1..7bc4e7e 100644 --- a/treelib/tree.py +++ b/treelib/tree.py @@ -1097,8 +1097,8 @@ def to_graphviz( sorting=sorting, ): nid = self[n].identifier - tag = str(self[n].tag).translate(str.maketrans({'"': r"\""})) - state = '"{0}" [label="{1}", shape={2}]'.format(nid, tag, shape) + label = str(self[n].tag).translate(str.maketrans({'"': r"\""})) + state = '"{0}" [label="{1}", shape={2}]'.format(nid, label, shape) nodes.append(state) for c in self.children(nid):