The x-axis of a particular graph is from 0 to 100 whereas the y axis is from 0 to 3.5. I want to zoom a particular portion of the x-axis say from 0 to 20 and plot it in the top right corner of the same graph. How do I do it?

댓글 수: 3

subho
subho 2011년 10월 22일
I am sorry for the fact that I am not able to make you understand the question. My question is, suppose I have the following plot
x=[0 20 40 60 100];
y1=[1 2 3 4 5];
y2=[6 7 8 9 10];
plot(x,y1);
hold on
plot (x,y2);
Now the x-axis of a particular graph is from 0 to 100 whereas the y axis is from 0 to 10. I want to zoom a particular portion of the x-axis say from 0 to 20 and plot it in the top right corner of the same graph. How do I do it?
Grzegorz Knor
Grzegorz Knor 2011년 10월 22일
I still don't understand. Could you upload an image which will help my understand it.
Image Analyst
Image Analyst 2011년 10월 22일
I don't understand why his suggestion of xlim() doesn't do what you want. Are you perhaps looking for the user to somehow interactively draw a box around the part of the graph that they want to zoom in on?

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

 채택된 답변

Grzegorz Knor
Grzegorz Knor 2011년 10월 22일

0 개 추천

x = rand(100,1)*3.5;
axes('Units','normalized','Position',[.1 .1 .8 .8])
plot(x)
axes('Units','normalized','Position',[.6 .6 .3 .3])
plot(x)
xlim([0 20])

댓글 수: 1

subho
subho 2011년 10월 22일
I am very thankful to you for this answer. It solved my problem. Thanks again.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Graphics Performance에 대해 자세히 알아보기

태그

질문:

2011년 10월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by