美文网首页
Matplotlib: Scatter plot, 3D

Matplotlib: Scatter plot, 3D

作者: LET149 | 来源:发表于2023-09-05 09:36 被阅读0次
    1. 模块:matplotlib.pyplot
    1. 方法:scatter()

1. 基础绘图

import matplotlib.pyplot as plt
import numpy as np

plt.style.use('_mpl-gallery')

# Make data
np.random.seed(19680801)
n = 100
rng = np.random.default_rng()
xs = rng.uniform(23, 32, n)
ys = rng.uniform(0, 100, n)
zs = rng.uniform(-50, -25, n)

# Plot
fig, ax = plt.subplots(subplot_kw={"projection": "3d"})
ax.scatter(xs, ys, zs)

ax.set(xticklabels=[],
       yticklabels=[],
       zticklabels=[])

plt.show()   #绘图,示例一
示例一

Matplotlib 给出一个可以交互式调整的绘图窗口,可以根据需求进行调整查看和选择性导出

2. 参数

相关文章

网友评论

      本文标题:Matplotlib: Scatter plot, 3D

      本文链接:https://www.haomeiwen.com/subject/dnylpdtx.html