gpt4 book ai didi

没有标记的 Python matplotlib.stem 图

转载 作者:太空狗 更新时间:2023-10-30 00:28:00 26 4
gpt4 key购买 nike

如何在没有标记(仅 Steam 线)的情况下绘制 Steam 图?。它在绘制非常长的信号阵列时特别有用。

谢谢!

最佳答案

您可以简单地将标记设置为空:

enter image description here

import matplotlib.pyplot as plt
import numpy as np

x = np.linspace(0, 6*np.pi, 200)
y = np.sin(x)

plt.stem(x, y, markerfmt=" ")

plt.show()

在matplotlib中,有a few ways使用“无”作为标记,每个都会给出不同的结果。例如,使用 "" 而不是 "" 将用一条线连接词干的末端:

enter image description here

此外,顺便说一句,我首先尝试使用由 "," 指定的像素标记,但这个像素最终没有与词干很好地对齐并且看起来不太好。

关于没有标记的 Python matplotlib.stem 图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26042735/

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