# Weird interplay between scale and lightposition in Makie

**URL:** <https://discourse.julialang.org/t/weird-interplay-between-scale-and-lightposition-in-makie/39363>\
**Category:** Visualization\
**Tags:** plotting\
**Created:** [May 12, 2020, 7:52pm UTC](https://discourse.julialang.org/t/weird-interplay-between-scale-and-lightposition-in-makie/39363 "2020-05-12T19:52:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![photor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/photor/32/14343_2.png) [@photor](https://discourse.julialang.org/u/photor)\
**Post date:** [May 12, 2020, 7:52pm UTC](https://discourse.julialang.org/t/weird-interplay-between-scale-and-lightposition-in-makie/39363/1 "2020-05-12T19:52:32Z")

</div>

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:

 ![shine](https://global.discourse-cdn.com/julialang/original/3X/f/b/fbf808cebe86df432b511de67ba7b875032c7402.png)  
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:

 ![no_shine](https://global.discourse-cdn.com/julialang/original/3X/1/9/19b2e0cb8b2c372fddbe172944b4d48d9b3d7630.png)  
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?

---

<div class="post-metadata">

**Author:** ![Dustin\_Hess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dustin_hess/32/11957_2.png) [@Dustin\_Hess](https://discourse.julialang.org/u/Dustin_Hess)\
**Post date:** [May 13, 2020, 4:33pm UTC](https://discourse.julialang.org/t/weird-interplay-between-scale-and-lightposition-in-makie/39363/2 "2020-05-13T16:33:12Z")

</div>

@photor Hi I just asked a question here on Makie as well. I was told that here doesn’t get much visibility to Makie issues. It was suggested that I join the slack channel for Makie. That said I did get an answer here. I would join the slack channel and if you get and answer post it back here so other user’s can view Q’s and solutions. You can request to join [here](https://slackinvite.julialang.org/),
