如何从使用plot_date生成的图中删除点?

Gid*_*gan 6 python matplotlib

我正在尝试使用plot_date 创建一个带有实线的图形。

from matplotlib.pyplot import show, plot_date
plot_date(time_info, np.arange(3), linestyle='-')
show()
print time_info
Run Code Online (Sandbox Code Playgroud)

打印输出是

[datetime.datetime(2018, 8, 13, 16, 41, 2), 
 datetime.datetime(2018, 8, 13, 16, 41, 7), 
 datetime.datetime(2018, 8, 13, 16, 41, 13)]
Run Code Online (Sandbox Code Playgroud)

产生的数字是:

在此输入图像描述

如何去除斑点?

Joe*_*Joe 4

您可以添加marker=''marker='None'

plot_date(time_info, np.arange(3), linestyle='-', marker='')
Run Code Online (Sandbox Code Playgroud)

或者markersize=0

plot_date(time_info, np.arange(3), linestyle='-', markersize=0)
Run Code Online (Sandbox Code Playgroud)

@Bazingaa 建议的另一种选择:

plot_date(time_info, np.arange(3), '-') # or '-b'
Run Code Online (Sandbox Code Playgroud)