【发布时间】:2021-04-19 19:45:20
【问题描述】:
我想绘制像这个图这样的节点,这些节点随机分布在一个尺寸为 10×10×10 mm 的三维隔间区域中。 如何在 Python 中做到这一点?
更多信息:这里,(*) 节点将被称为目标节点,(·) 节点将被称为源节点。使用特定的SINRmin要求评估两个节点之间的可用通信链路,并用黑色虚线绘制,称为段。这里,SINRmin 的值为 8 dB。
这是我的代码,我做了什么:
import numpy as np
import matplotlib.pyplot as plt
n = 50
x1, x2 = 0.01, 0.1
y1, y2 = 0.01, 0.1
z1, z2 = 0.01, 0.1
xs = (x2 - x1)*np.random.rand(n) + x1
ys = (y2 - y1)*np.random.rand(n) + y1
zs = (z2 - z1)*np.random.rand(n) + z1
fig = plt.figure()
ax = fig.add_subplot(111,projection='3d')
ax.plot(xs, ys, zs, "go")
ax.plot(xs, ys, zs, "k--")
ax.set_xlabel('X Label')
ax.set_ylabel('Y Label')
ax.set_zlabel('Z Label')
plt.show()
我的输出:
【问题讨论】:
-
这篇文章不清楚。您的问题与您成功的范围内的绘图有关,您具体要求什么?绘制方向图?看看 FancyArrowPatch
标签: python matplotlib graph 3d