Plot - move data on top

조회 수: 67 (최근 30일)
Tom
Tom 2011년 4월 19일
댓글: Carlos Borau 2021년 5월 25일
I have various lines in some MATLAB plots, and wish to move one set of data so it's shown at the top. I realise this should have been done before , but it was quite painstaking creating the graphs and wondered is there a way to move data on top?

답변 (1개)

Teja Muppirala
Teja Muppirala 2011년 4월 19일
Use uistack
figure
h(1) = plot([1 0 1 0 1],'r','linewidth',20);
hold on; h(2) = plot([0 1 0 1 0],'b','linewidth',20);
for n = 1:5
pause(0.5);
uistack(h(1),'top');
pause(0.5);
uistack(h(2),'top')
end
  댓글 수: 2
Teja Muppirala
Teja Muppirala 2011년 4월 19일
One very fun way to make use of uistack and windowbuttonmotionfcn...
figure
plot(rand(10,10),'linewidth',10);
set(gcf,'windowbuttonmotionfcn','uistack(hittest,''top'')')
Carlos Borau
Carlos Borau 2021년 5월 25일
awesome!

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

카테고리

Help CenterFile Exchange에서 Just for fun에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by