I would like to plot a 3D cube in Plots.jl and I have not been able to.
I know that there are solutions in Makie but I would like to use the Plots.jl interface because I want to combine this with other things plotted with Plots.jl.
So far I can get wireframe working with:
Plots_jl.plot!(ax, [x, x + w1, x+w1, x, x], [y, y, y+w2, y+w2, y], [z, z, z, z, z], aspect_ratio=1.0) # bottom
Plots_jl.plot!(ax, [x, x + w1, x+w1, x, x], [y, y, y+w2, y+w2, y], [z+w3, z+w3, z+w3, z+w3, z+w3],) # top
Plots_jl.plot!(ax, [x, x, x, x, x], [y, y+w2, y+w2, y, y], [z, z, z+w3, z+w3, z]) # back left
Plots_jl.plot!(ax, [x, x+w1, x+w1, x, x], [y+w2, y+w2, y+w2, y+w2, y+w2], [z, z, z+w3, z+w3, z]) # back right
Plots_jl.plot!(ax, [x, x+w1, x+w1, x, x], [y, y, y, y, y], [z, z, z+w3, z+w3, z]) # front left
Plots_jl.plot!(ax, [x+w1, x+w1, x+w1, x+w1, x+w1], [y, y+w2, y+w2, y, y], [z, z, z+w3, z+w3, z])
But I have tried to create solid surfaces with:
# Plots_jl.plotly()
x,y,z = 0.,0.,0.
w1,w2,w3 = 1.0,1.0,1.0
xrange = range(x, stop=x+w1, length=10)
yrange = range(y, stop=y+w2, length=10)
zrange = range(z, stop=z+w3, length=10)
Plots_jl.surface(xrange, yrange, (a1,a2)-> z, xlabel="x", ylabel="y", zlabel="z") # bottom
Plots_jl.surface!(repeat([x], length(xrange)), yrange, (a1,a2)->zrange[findfirst(a -> a == a2, yrange)]) # back left
# back right
# front left
# front right
Plots_jl.surface!(x:.1:x+w1, y:.1:y+w2, (a1,a2)-> z+w3) # top
and it does not work.