'Plotting an algorithm with interactive figure in Python
I want to visualise the effect of an algorithm that takes a 2d vector as input and delivers an array of 2d vectors as output (where the array has the k-th iteration value at index k).
The way I would like this to work is by having a 2d plot of a certain range of numbers on the left that represents the input vector, and a similar 2d plot on the right that plots the connected output vectors.
For an individual input point I know I could do this with matplotlib's plt.subplots() like this loosely adapted example from the documentation:
fig, axs = plt.subplots(2)
fig.suptitle('Vertically stacked subplots')
axs[0].plot(in_x, in_y)
axs[1].plot(out_array_x, out_array_y, 'o-')
But what I would like to do is to move the point on the input side with the mouse and get the resulting output on the right interactively. How could this be done?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
