Help with plot axis
13 次查看(过去 30 天)
显示 更早的评论
I have a piece of code that goes through a loop 1000 times determining the values of x and y. I then plot these coordinates.
I want the x and y axis to be the same so I tried axis equal however I obtained a graph with the axises as so. Can anyone explain why the x and y axis aren't equal? The x axis ranges from -300 to 300 and the y axis from 0 to 450.
0 个评论
采纳的回答
Star Strider
2017-3-7
The axis equal call uses the same length for the data units along each axis. It does not affect the range of values. If you want to change those, use the axis call as:
axis([xmin xmax ymin ymax])
You can also combine that call with an axis equal call, so one does not cancel or override the other.
2 个评论
Star Strider
2017-3-7
My pleasure.
‘I would like the x axis to range from 0 to 450 as the y axis does.’
Use the ‘ymin’ and ‘ymax’ values for both in your axis call:
axis([ymin ymax ymin ymax])
That should do what you want.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!