I am using Julia to plot two cubes next to each other. I am doing this by simpling ploting straight line between the corners of the cubes. This is my current code:
p = Plots.scatter(camera=(-240,10), legend=false) #axis=([], false))
plot!([7.5, 6.5, 6.5, 7.5, 7.5, 7.5, 7.5, 6.5, 6.5, 7.5], [1.5, 1.5, 1.5, 1.5, 1.5, 2.5, 2.5, 2.5, 2.5, 2.5], [1.0, 1.0, 2.0, 2.0, 1.0, 1.0, 2.0, 2.0, 1.0, 1.0], linewidth=1, lc=:black)
plot!([6.5, 6.5], [1.5, 2.5], [1.0, 1.0], linewidth=1, lc=:black)
plot!([6.5, 6.5], [1.5, 2.5], [2.0, 2.0], linewidth=1, lc=:black)
plot!([7.5, 7.5], [1.5, 2.5], [2.0, 2.0], linewidth=1, lc=:black)
plot!([7.5, 6.5, 6.5, 7.5, 7.5, 7.5, 7.5, 6.5, 6.5, 7.5], [2.5, 2.5, 2.5, 2.5, 2.5, 3.5, 3.5, 3.5, 3.5, 3.5], [1.0, 1.0, 2.0, 2.0, 1.0, 1.0, 2.0, 2.0, 1.0, 1.0], linewidth=1, lc=:black)
plot!([6.5, 6.5], [2.5, 3.5], [1.0, 1.0], linewidth=1, lc=:black)
plot!([6.5, 6.5], [2.5, 3.5], [2.0, 2.0], linewidth=1, lc=:black)
plot!([7.5, 7.5], [2.5, 3.5], [2.0, 2.0], linewidth=1, lc=:black)
display(p)
I have included a screenshot of the outcome at the end. As you can see, the axis length skeq the cube into looking more like two rectangular prism's rather than cube's. What would be the easiest way create a more geometrically convincing axis spacing?
With 2D plots, you use aspect_ratio = :equal, but with 3D plots you may need to tweak xlims, ylims, and zlims until they look right to you (it may depend on your display screen and the angle of your view of your screen):
using Plots
p = Plots.scatter(camera=(-240,10), legend=false, xlims=(6.5, 8.5), ylims=(1.5, 3.5), zlims=(1, 3)) #axis=([], false))
plot!([7.5, 6.5, 6.5, 7.5, 7.5, 7.5, 7.5, 6.5, 6.5, 7.5], [1.5, 1.5, 1.5, 1.5, 1.5, 2.5, 2.5, 2.5, 2.5, 2.5], [1.0, 1.0, 2.0, 2.0, 1.0, 1.0, 2.0, 2.0, 1.0, 1.0], linewidth=1, lc=:black)
plot!([6.5, 6.5], [1.5, 2.5], [1.0, 1.0], linewidth=1, lc=:black)
plot!([6.5, 6.5], [1.5, 2.5], [2.0, 2.0], linewidth=1, lc=:black)
plot!([7.5, 7.5], [1.5, 2.5], [2.0, 2.0], linewidth=1, lc=:black)
plot!([7.5, 6.5, 6.5, 7.5, 7.5, 7.5, 7.5, 6.5, 6.5, 7.5], [2.5, 2.5, 2.5, 2.5, 2.5, 3.5, 3.5, 3.5, 3.5, 3.5], [1.0, 1.0, 2.0, 2.0, 1.0, 1.0, 2.0, 2.0, 1.0, 1.0], linewidth=1, lc=:black)
plot!([6.5, 6.5], [2.5, 3.5], [1.0, 1.0], linewidth=1, lc=:black)
plot!([6.5, 6.5], [2.5, 3.5], [2.0, 2.0], linewidth=1, lc=:black)
plot!([7.5, 7.5], [2.5, 3.5], [2.0, 2.0], linewidth=1, lc=:black)
display(p)