-1

are there any tools or examples for how to visualize things like linked lists and decisions trees using matplotlib?

I ask because I wrote a linked list type of class (each node can have multiple inputs/outputs, and there's a class variable that stores node names), and want to visualize it. Unfortunately, my computer at work is locked down so much that I can't download other packages, so I've got to use whatever is on hand- which is matplotlib

I've started reading it, and if I do it by hand, I can probably make something that visualizes one-directional linked lists (just give it the root node, and plop down a square with text for each operation). But if there's branching, or multiple inputs into a node things get a bit more complicated- for example is it possible to expand a figure after creating it?

ImportanceOfBeingErnest
  • 321,279
  • 53
  • 665
  • 712
Mohammad Athar
  • 1,953
  • 1
  • 15
  • 31

1 Answers1

1

Yes, you can use networkx library and the draw_networkx method. There are plenty of examples on Stack Overflow. Here is one example: https://stackoverflow.com/a/52683100/6361531

Scott Boston
  • 147,308
  • 15
  • 139
  • 187