Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for i in range(1):
- import matplotlib.pyplot as plt
- import matplotlib.animation as animation
- import pylab
- from tkinter import *
- import numpy as np
- fig=plt.figure()
- ax1=fig.add_subplot(1,1,1)
- def animate(i):
- bb=[]
- a=0
- #Координата начала отрезка
- x_0 = 0.0
- y_0 = 0.0
- #Координата конца отрезка
- x_1 = 0.0
- y_1 = 1.0
- # Ожидание нажатия клавиши
- a = input()
- # Если нажата кнопка, присваиваем y_1=1
- if len(a) > 0:
- y_1 = 1.0
- bb.append([x_0,x_1])
- bb.append([y_0,y_1])
- ax1.clear()
- animation1=ax1.plot(*bb,color='grey')
- ani=animation.FuncAnimation(fig,animate,interval=10)
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement