如何使用MATPLOTLIB进行数字阈值保持

2024-05-01 21:58:50 发布

您现在位置:Python中文网/ 问答频道 /正文

我想让代码只看图表中的某个区域。图表不会根据图表的线条而改变。我知道有办法,但我可以用Matplotlib找到

xl = len(x)
zlx = int(xl) + 1
x.append(zlx)
y22 = current_stock # Other parts of my code 
y.append(y22)

plt.plot(x, y, linewidth = 2, 
    marker='o', markerfacecolor='blue', markersize=7)  
# Here I want is so that the y is constant
plt.draw() 
plt.pause(1)
plt.clf()

Tags: 代码区域lenmatplotlibis图表pltcurrent