Matplotlib问题:plt.绘图(x,y,'.r')从原点连接每个点,而不是每个点

2024-06-03 07:24:34 发布

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

x = [Timestamp ('03-01-2011 00:00:00'), Timestamp ('09-01-2014 00:00:00'), ... ]

y = [144, 23, ...]

plt.plot(x, y, '.r')
plt.plot(x, y, marker = 'o', linestyle = '--')

enter image description here

什么样子plt.绘图(x,y,'.r'),仅散点图。在

enter image description here

当我添加行的时候。。。在

数据类型: x=2008年至2014年的时间戳。 y=每个时间戳的整数值。在

如何将散点图从一点连接到另一点,而不是从原点连接它们?在


Tags: 绘图plot时间plt整数markertimestamp数据类型