대화형 플롯을 얻으려면 Figure를 활성화해야 합니다. plt.ioff() 사용 및 plt.ion() , 우리는 플롯으로 대화형 작업을 수행할 수 있습니다.
Ipython 열기 쉘에 다음 명령을 입력하십시오.
예시
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 출력
