PlotlyJS has an option for orthographic projection rather than the default “perspective” projection. It is described in the docs here:
https://docs.juliaplots.org/stable/gallery/plotlyjs/generated/plotlyjs-ref060/
The orthographic example is actually using perspective.
The options work as intended with GR.
Code to reproduce (based on the example in the docs):
x = [[-1, 1], [-1, -1], [-1, 1], [1, 1], [1, 1], [-1, -1], [-1, -1], [1, 1], [-1, 1], [-1, -1], [-1, 1], [1, 1]]
y = [[1, 1], [-1, 1], [-1, -1], [-1, 1], [1, 1], [1, 1], [-1, -1], [-1, -1], [1, 1], [-1, 1], [-1, -1], [-1, 1]]
z = [[1, 1], [1, 1], [1, 1], [1, 1], [-1, 1], [-1, 1], [-1, 1], [-1, 1], [-1, -1], [-1, -1], [-1, -1], [-1, -1]]
kw = (aspect_ratio = :equal, label = :none, xlabel = "x", ylabel = "y", zlabel = "z", xlims = (-1.1, 1.1), ylims = (-1.1, 1.1), zlims = (-1.1, 1.1))
plotlyjs()
plot(plot(x, y, z; proj_type = :ortho, title = "PlotlyJS incorrect ortho", camera = (45, round(atand(1 / √2); digits = 3)), kw...),
plot(x, y, z; proj_type = :persp, title = "PlotlyJS perspective", camera = (45, round(atand(1 / √2); digits = 3)), kw...))
gr()
plot(plot(x, y, z; proj_type = :ortho, title = "GR correct orthographic", camera = (45, round(atand(1 / √2); digits = 3)), kw...),
plot(x, y, z; proj_type = :persp, title = "GR perspective", camera = (45, round(atand(1 / √2); digits = 3)), kw...))
(Am trying to figure out how to add graphics files…)
In the absence of graphics, the orthogonal projection of a cube at this angle should yield a regular hexagon, whereas perspective projection yields a hexagon that is appropriately distorted. PlotlyJS produces similar irregular hexagons for both cases, whereas GR does it right.