필터 지우기
필터 지우기

I am plotting (x,y) coordinates in a simple plot and the plotted values lies in 1st Quadrant.However, I want to see all the 4 quadrants , how to customize it?

조회 수: 18 (최근 30일)
Lets say my cordinates are as follows x= [0 1 2 3 4 5] y= [0 1 2 3 4 5]
However, i want to set my axis from : x= (-20 ,20) y= (-20, 20) so that I can just see all the 4 quadrants , while my plotted values lies in first quadrant.

채택된 답변

Birdman
Birdman 2018년 4월 20일

Try this:

x=0:5;y=0:5;
plot(x,y);grid on;
set(gca,'XLim',[-20 20]);
set(gca,'YLim',[-20 20]);
  댓글 수: 4
Walter Roberson
Walter Roberson 2018년 4월 20일

Continue on with

xlim([-20 20]); ylim([-20 20])

... but for that range of values I would suggest

xlim([-2 2]); ylim([-2 2])
Sagar  Saxena
Sagar Saxena 2018년 4월 20일
편집: Sagar Saxena 2018년 4월 20일
It worked.I had it before as well but the sequence was wrong. Thanks!

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

추가 답변 (1개)

Walter Roberson
Walter Roberson 2018년 4월 20일
xlim([-20 20]);
ylim([-20 20]);

카테고리

Help CenterFile Exchange에서 Axis Labels에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by