how to set the limit of x axis and y axis as per the required range for the following code

16 ビュー (過去 30 日間)
jaah navi
jaah navi 2021 年 1 月 8 日
コメント済み: Rik 2021 年 3 月 2 日
y=[11 3 9 6 6 8 8 10 9 8 10 11];
when i run the code i am getting the graph but the x axis values and y axis values are not in the required range.Could anyone please help me on this.
  2 件のコメント
Rik 2021 年 3 月 2 日
There is a nuance here: xlim and ylim need an existing axes object and will not create one. That means you have to make sure an axes object exists, which you can do with plot, but also with many other functions. The order you proposed in your answer (which you posted as comment) makes the most sense, as plot will (under some conditions) modify the limits.



Community Treasure Hunt

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

Start Hunting!

Translated by