How can I add and delete nodes to a figure?