python - 在 Julia 中使用点绘制球体

标签 python plot julia points

我想在球体上采样 N 个点(假设 N = 10000)。
我知道如何绘制 3D 球体。但是,我不确定如何使用球坐标来表示点。
(下面是我用于球体的代码)


using PyPlot
n = 100
u = range(0,stop=2*π,length=n);
v = range(0,stop=π,length=n);

x = cos.(u) * sin.(v)';
y = sin.(u) * sin.(v)';
z = ones(n) * cos.(v)';


surf(x,y,z, rstride=4, cstride=4)

Sphere

最佳答案

这将完成这项工作:

scatter3D(vec(x),vec(y),vec(z);c="red",s=2)
surf(x,y,z, rstride=4, cstride=4)

enter image description here

关于python - 在 Julia 中使用点绘制球体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68071231/

相关文章:

python - 即使我没有打印,jupyter 也会打印太多输出

r - 如何调整ggplot直方图的时间刻度轴

matlab - 绘图在 matlab 中自动以绘图对象命名

python - seaborn中hue、color、edgecolor、facecolor的使用方法

julia - UndefVar错误: Model not defined

python - 用户在python中输入信息时如何选择光标的位置?

python - 基于列索引的 Sort_values

python - Pandas :如果列 'E' 的值为 'C',则更新列 'x' 的值

julia - 错误: LoadError: UndefVarError: type not defined

csv - 将 CSV 读入数组