【发布时间】:2021-06-10 21:14:13
【问题描述】:
注意:这就是我的代码的样子,我不断收到粗体部分的错误,我希望能够绘制一条直线,其坐标从 1,1 开始并以 (1+lineLength) 结束, 1, 这样我就有了一条水平线。我对 python 不太熟悉,所以非常感谢您的意见。
lineLengthQuestion = input("What size would you like your line? (Numbers Only)")
lineLengthQuestion = int(lineLengthQuestion)
lineLength = [1 + lineLengthQuestion]
print (f'You entered {lineLengthQuestion}')
x = [1,1]
y = [lineLength, 1]
plt.plot(x, y, color = "black", linewidth = 3)
【问题讨论】:
标签: python matplotlib jupyter-notebook jupyter matplotlib-animation