Plot - move data on top

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?

Antworten (1)

Teja Muppirala
Teja Muppirala am 19 Apr. 2011

4 Stimmen

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 Kommentare

Teja Muppirala
Teja Muppirala am 19 Apr. 2011
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 am 25 Mai 2021
awesome!

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Just for fun finden Sie in Hilfe-Center und File Exchange

Produkte

Gefragt:

Tom
am 19 Apr. 2011

Kommentiert:

am 25 Mai 2021

Community Treasure Hunt

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

Start Hunting!

Translated by