How do I create a diagram of an array to demostrate my algorithm?

As title. I want to draw an array using matplotlib so that I can show something like this:

+----+----+ ...
+ v1 + v2 + ...
+----+----+ ...

For sure it will be great if I can draw some arrows pointing from one box/cell to another. Could anyone show me some simple example code or provide the link to some tutorials? I have browsed the example on the documentation but I didn’t see anything related to my case.

It is extremely hard to help because this question is very vague.

I would look at Annotations — Matplotlib 3.7.1 documentation and Arrow Demo — Matplotlib 3.7.1 documentation

If you have runnable code that gets close to what you want it is much easier to help.

1 Like