I was drawing a surface plot of some configuration of a quantum system, using the following code:
using Makie
l = w = 30.0
p = m = 120
x=l*[(i-0.5)/p-0.5 for i = 1:p] #x ranges in (-15,15)
y=w*[(i-0.5)/m-0.5 for i = 1:m] #y ranges in (-15,15)
scene = Scene()
limits = FRect3D((-1.5, -1.5, 0), (3.0, 3.0, 2.5))
update_limits!(scene, limits)
z = … data of the configuration stored in a (120,120) array z, ranging in (0, 2.25)
surf = surface!(scene, x/10, y/10, z, colorrange=(-150,50))[end]
wf = wireframe!(scene, x/10, y/10, lift(x->x, surf[3]), transparency=true, color=(:black, 0.1))
Here I divided x and y by 10 because the ranges of x and y are much larger than z, and I didn’t know how to use the scale! method at that time. Then the output was the following image, with a very nice shining effect:
Later I knew the scale! method, so I revised the above code to the following one:
scene = Scene()
scale!(scene, (1,1,10))
limits = FRect3D((-15, -15, 0), (30, 30, 2.5))
update_limits!(scene, limits)
z = … data of the configuration stored in a (120,120) array z, ranging in (0, 2.25)
surf = surface!(scene, x, y, z, colorrange=(-150,50))[end]
wf = wireframe!(scene, x, y, lift(x->x, surf[3]), transparency=true, color=(:black, 0.1))
In this way, I can get the correct ticks on the x and y axes, but now the output becomes:
The shining effect is gone. I realized that this result may be caused by an improper lightposition parameter, and I saw from somewhere that the default lightposition is Vec3f0(1,2,3), so maybe I should set a lightposition=Vec3f0(10,20,3) in the latter code? However, that proved to have no help (actually made the case even worse). I also tried various kinds of lightposition parameters, without any success. Any solutions suggested?