pythonmatplotlib

Interactively arranging matplotlib subplots


let’s say we have four subplots with a shared X axis. Would it be possible in matplotlib to move (or drag) these subplots interactively, that is, with a mouse click? In other words, to arrange them dynamically using mouse events?


Solution

  • I was able to do this a bit crudely with dynamically swapping get_position and set_position for the axes objects depending on the data from the mouse events. Matlab is kinda cool :)