Open
Description
I have been trying to plot spheres but there are cases when the aspect_ratio=:equal
command just doesn't work, example:
using Plots
function plotCC(pos, rad, n = 16) # Function to spheres
u = collect(range(0,stop=2,length=n));
v = collect(range(0,stop=1,length=n));
x = pos * ones(n) * ones(n)' + rad * cospi.(u) * sinpi.(v)';
y = rad * sinpi.(u) * sinpi.(v)';
z = rad * repeat(cospi.(v)',outer=[n, 1])
surface!(x,y,z, aspect_ratio=:equal)
end
plotlyjs(dpi=1500)
x = -15:0.1:10
y = -2:0.1:2
plot(x,y,(x,y) -> sin(x)*cos(y)*0.5, linetype=:surface, aspect_ratio=:equal, color=:magma)
plotCC(1,2,32)
plotCC(-15,3,32)
gui()
but if I plot the second sphere with rad=5
then this is the result:
Is this some kind of limitation of Plots.jl ? It looks like it is deciding not to do aspect_ratio=:equal
just because the data is too stretched, but I need to plot it with equally scaled axis (or the spheres won't look like it). Any advise?