Info

此问题已关闭。 请重新打开它进行编辑或回答。

Moving inside a graph/plot

1 次查看(过去 30 天)
Francesco Carraro
Francesco Carraro 2020-2-18
关闭: MATLAB Answer Bot 2021-8-20
Hello everyone,
I can't figure out how to moving and selecting a specific area of a graphic:
Let's say I have a main graphic where are plotted x coordinates of a subject in a space of time of 1 minute;
what I'm looking for , is a function that plot the main graphic with a cursor that can select a specific portion, let's say 10 sec.
and plotting that portion on to another graphic. Many thanks for everyone will help me out.
Francesco

回答(1 个)

Francesco Carraro
Francesco Carraro 2020-2-18
I'll show a simple example with the "sin" function:
In the bottom graphic I want to show the full plot from 0 to 100s, with a selector that can be moved and can select a specif part of the plot ( 10 second in the example).
In the top graphic, I want to show the portion of the bottom graphic selected with the moving cursor ( form 10s to 20s in the example), a sort of a zoom that can be moved back and fourth around the bottom graphic
Maybe the red lines in the picture will help explain better what I'm looking for.
x = 0:0.1:100;
time = 0:0.1:100;
y1 = sin(x);
y2 = sin(time);
figure
subplot(2,1,1);
plot(x,y1)
subplot(2,1,2);
plot(x,y2)

此问题已关闭。

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by