इंटरेक्टिव प्लॉट प्राप्त करने के लिए, हमें आकृति को सक्रिय करने की आवश्यकता है। plt.ioff() . का उपयोग करना और plt.ion() , हम एक प्लॉट के साथ परस्पर क्रिया कर सकते हैं।
आईपीथॉन खोलें खोल और खोल पर निम्न आदेश दर्ज करें।
उदाहरण
In [1]: %matplotlib auto
Using matplotlib backend: GTK3Agg
In [2]: import matplotlib.pyplot as
In [3]: fig, ax = plt.subplots() # Diagram will pop up. Let’s interact.
In [4]: ln, = ax.plot(range(5)) # Drawing a line
In [5]: ln.set_color("orange") # Changing drawn line to orange
In [6]: plt.ioff() # Stopped interaction
In [7]: ln.set_color("red")
# Since we have stopped the interaction in the last step
In [8]: plt.ion() # Started interaction आउटपुट
