Out of the box, without requiring any additional packages, matplotlib offers primitives to add controllers on a figure so that a user can interact with it. In this recipe, we are going to see how to plot a famous parametric curve: the SuperShape curve. This curve is controlled by six parameters: A, B, M, N1, N2, and N3. These parameters determine the shape of the curve. They can be set interactively by the user by moving the cursor on the figure.
The following code will display a curve using
pyplot.plot(), which at this point should be simple. However, we now use user interface elements (more commonly called widgets), that is, sliders. This can be done with the following steps: