python绘制动态散点图
from matplotlib import pyplot as plt
import numpy as np
import math
fig=plt.figure()
ax=fig.add_subplot(1,1,1)
plt.ion()
for i in range(10):
x=i
y = math.sin(x)
ax.plot(x,y,marker="*")
plt.pause(0.1)
python绘制动态折线图
from matplotlib import pyplot as plt
import numpy as np
import math
fig=plt.figure()
ax=fig.add_subplot(1,1,1)
plt.ion()
mid_x=[]
mid_y=[]
for i in range(10):
x=i
y = math.sin(x)
mid_x.append(x)
mid_y.append(y)
ax.plot(mid_x,mid_y,ls='-',marker="*")
plt.pause(0.1)