I just got to know Makie.jl
and I am enjoying its consistency. I am trying to plot points on the sphere, where the sphere should be a little transparent, since the points on the opposite side should be a little visible. My approach
MWE reads as
using Makie
using Colors
using GeometryTypes
n = 33
u = range(0,stop=2*π,length=n);
v = range(0,stop=π,length=n);
x = zeros(n,n); y = zeros(n,n); z = zeros(n,n)
for i in 1:n
for j in 1:n
x[i,j] = cos.(u[i]) * sin(v[j]);
y[i,j] = sin.(u[i]) * sin(v[j]);
z[i,j] = cos(v[j]);
end
end
scene = surface( x,y,z, show_axis=false, alpha=0.8,
color = fill(RGBA(1.,1.,1.,0.8),n,n),
limits=HyperRectangle(Vec(-1.01,-1.01,-1.01),Vec(1.01,1.01,1.01)) )
wireframe!( scene,x,y,z, show_axis=false,
linewidth=1.2,color=RGBA(0.0,0.0,0.2,0.8) )
scatter!( scene,
Point3f0.([ [1.,0.,0.], 1/sqrt(2)*[1.,1.,0], 1/sqrt(3)*[1.,1.,1.], [-1.,0.,0.], [0.,0.,1.] ]),
color=:blue, markersize=0.05, show_axis=false )
and produces.
I tried both
alpha=
and an RGBA
for the surface, but somehow the white sphere is not transparent. How can I get the surface transparent?
Further in Jupyter this code produces both an (rendered) image (basically the one above), and a window that is interactive (Julia-Window). Is there an embedded interactive way for Jupyter? And can I deactivate one of the two outputs?