小编Ali*_*e F的帖子

如何在 matplotlib 中创建图钉图

如何在 matplotlib 中创建“图钉图”,或者是否需要另一个库?我必须绘制点的代码如下。上面的图是我的代码的输出,第二个是理想的输出。

def getData(n):
    data = []
    for i in range(n):
        data.append(i)
    return data

fig, axs = plt.subplots(2, 2)
n = 10
axs[0, 0].scatter([i for i in range(n)], getData(n))
plt.show()
Run Code Online (Sandbox Code Playgroud)

输出

引脚图

python matplotlib python-3.x

2
推荐指数
1
解决办法
869
查看次数

标签 统计

matplotlib ×1

python ×1

python-3.x ×1