gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-04 04:35:27 25 4
gpt4 key购买 nike

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

from matplotlib.pyplot import show, plot_date
plot_date(time_info, np.arange(3), linestyle='-')
show()
print time_info

打印出来的是

[datetime.datetime(2018, 8, 13, 16, 41, 2), 
datetime.datetime(2018, 8, 13, 16, 41, 7),
datetime.datetime(2018, 8, 13, 16, 41, 13)]

生成的图是:

enter image description here

如何去掉圆点?

最佳答案

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

plot_date(time_info, np.arange(3), linestyle='-', marker='')

或者markersize=0:

plot_date(time_info, np.arange(3), linestyle='-', markersize=0)

@Bazingaa 建议的另一个选项:

plot_date(time_info, np.arange(3), '-') # or '-b'

关于python - 如何从使用 plot_date 生成的图形中删除点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51841679/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com