【发布时间】:2018-01-01 15:33:38
【问题描述】:
我不明白以下脚本中“line”一词后逗号的用途。
import matplotlib.pyplot as plt
x = [0,1]
y = [0,1]
line, = plt.plot(x, y)
plt.show()
我曾尝试在official documentation website 中理解它,但没有成功
【问题讨论】:
-
@cdarke 是正确的。我不确定为什么 plot 方法返回任何值,也许是为了得到插值的结果。
标签: python matplotlib