0

As a follow up to this question, how can I specify the order of components in a 3D plot in Julia using PyPlot?

Here's the MWE that produces my issue. zorder doesn't seem to work.

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()
jjjjjj
  • 1,152
  • 1
  • 14
  • 30
  • I'm getting an error. xgrid is 100x100 and ygrid 1000x1. Should both be matrices? Also, consider switching to `Plots.jl` and start using `range()` instead of `linspace()` – Germán Barletta Oct 27 '18 at 15:09
  • @Bazingaa: I needed the `'` on `yy` to make the dimensions appropriate as @German Barletta mentioned. Re-editing. – jjjjjj Oct 27 '18 at 16:40

0 Answers0