使用pyplot在Julia中进行3d图排序/分层

时间:2018-10-26 23:22:24

标签: matplotlib julia

作为对this问题的跟进,我如何使用PyPlot在Julia的3D图中指定组件的顺序?

这是产生问题的MWE。 zorder似乎无效。

using PyPlot  ## Julia v0.6.4
n = 100
xx = linspace(0,1,n)
yy = linspace(1,2,n)
xgrid = repeat(xx, outer=[1, n])
ygrid = repeat(yy', outer=[n, 1])
zvals = zeros(n,n)
for i in 1:n
        for j in 1:n
            zvals[i,j] = xx[i] + yy[j]
        end
    end
x = 0.5
y = 1.5
z = 2.0
fig, ax = subplots()
plot_surface(xgrid, ygrid, zvals, color="blue", alpha=0.8, zorder=0)
scatter3D(x, y, z, color="red", s=10, zorder=10, label="point")
legend()
xlabel("x")
ylabel("y")
title("test")
show()

0 个答案:

没有答案