What is the best way of combining two independent plots with matplotlib?

Viewed 1924

I keep asking this question to myself: how to combine easily different plots with matplotlib, in a modular way?

Let's say for instance that I wrote a function displaying the positions of the nodes of a graph. In parallel, I made another function which plots some polygons. Now, what is the right way of combining the outputs, so the nodes appear to be inside the polygons? What about the possibility to change the transparency, positions, etc, of the entire individual plots? What should be the structure of the two initial functions?

Is there a smart and general way of doing this?

1 Answers
Related