Hi all,
Thanks from the help of people in this discourse, I have plotted with GLMakie with this code:
using GLMakie
using ColorSchemes
# Torus equation to plot
# R - sqrt(x^2 + y^2) + z^2 = r^2
# r -> a (r is the radius of the smaller circle / innertube)
cmap3 = get(colorschemes[:plasma], LinRange(0,1,100))
cmap4 = [(cmap3[i],0.65) for i in 1:100]
ξ = -50:1:50
c = 25
a = 5
torus = [((hypot(X,Y)-c)^2+Z^2-a^2) for X in ξ, Y in ξ, Z in ξ]
volume(torus, algorithm = :iso,isovalue =100,isorange =50, colormap=cmap4)
current_figure()
and with PlotlyJS
using Plots; plotlyjs()
Θ = ϕ = range(-π,π,300)
X = [(2 + cos(v)) * cos(u) for u in Θ, v in ϕ]
Y = [(2 + cos(v)) * sin(u) for u in Θ, v in ϕ]
Z = [1.5*sin(v) for u in Θ, v in ϕ]
surface(X, Y, Z, lims=(-3,3), size=(600,600), cbar=:none, legend=false, )
why is the plot of PlotlyJS is better? They are showing the x,y,z axis as well when I point at the torus.Anyone who opposes PlotlyJS and want to brag about GLMakie are welcome to convince me about GLMakie.
PlotlyJS left, GLMakie right.
I want to plot a lot of 3-d objects and perhaps I want to fix with PlotlyJS backend to be more focus.