April 2018
Beginner
238 pages
7h 13m
English
We can use the following code:
%matplotlib inlinefrom ipywidgets import interactiveimport matplotlib.pyplot as pltimport numpy as npdef f(r): plt.axes() circle = plt.Circle((0, 0), radius=r, fc='y') plt.gca().add_patch(circle) plt.axis('scaled') plt.show()interactive_plot = interactive(f, r=(0.0, 1.0))output = interactive_plot.children[-1]output.layout.height = '350px'interactive_plot
The display looks like is:
