필터 지우기
필터 지우기

What's the Default Light from Figure Toolbar > Insert Light

조회 수: 3 (최근 30일)
Shaun VanWeelden
Shaun VanWeelden 2013년 4월 23일
When I plot something and create a surface object, and then I go to figure > Insert > Light, it adds like the best lighting ever. I want to replicate the lighting that is added without obviously going through the menu bar. I am assuming this is something simple, but even copying the light object position and color properties exactly can't seem to replicate it.
Any advice would be appreciated!

답변 (1개)

Sean de Wolski
Sean de Wolski 2013년 4월 23일
surf(peaks)
Interactively add light
hLight = findobj(gcf,'type','light');
get(hLight)
And of course for more info:
doc light
BTW, while looking for this, I just learned about material: learn something new every day.
  댓글 수: 3
Sean de Wolski
Sean de Wolski 2013년 4월 23일
How it determines it appears to be undocumented. You can dig into the figure uimenu properties to figure out the callbacks:
surf(peaks)
h = findall(gcf,'Type','uimenu')
get(h,'Callback')
The easiest way to replicate this would be to call the same thing in one of the callbacks of the GUI. I'll update tomorrow or the next day with more thoughts on this.
Sean de Wolski
Sean de Wolski 2013년 4월 23일
편집: Sean de Wolski 2013년 4월 23일
figure('WindowButtonDownFcn','insertmenufcn Light;plottools off');
surf(peaks);
Now click down on the figure. As far as doing this automatically, I have a few other things on my mind. Will update tomorrow.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by