通过Python在For循环中迭代绘图

2024-06-07 14:36:31 发布

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

for k in range(10):
        rtpi = (pratio / float(math.pi)) + x*0
        plt.plot(x,rtpi,'r')

这会产生一条平直的线。我该怎么做:

for k in range(10):
        rtpi = (pratio / float(math.pi)) + x*0
        plt.scatter(x,rtpi,'r')

基本上,对于每一个点,我希望在x轴上每1个点在图上表示一个点


Tags: inforplotpirangepltmathfloat

热门问题