Info

This question is closed. Reopen it to edit or answer.

Moving inside a graph/plot

4 views (last 30 days)
Francesco Carraro
Francesco Carraro on 18 Feb 2020
Closed: MATLAB Answer Bot on 20 Aug 2021
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

Answers (1)

Francesco Carraro
Francesco Carraro on 18 Feb 2020
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)

This question is closed.

Products

Community Treasure Hunt

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

Start Hunting!