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 个评论

请先登录,再进行评论。

更多回答(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