Modifying y axis division

Hi,
I wrote some code and got the following graph.
My Problem is the y axis has only 4 points i.e [0 , 5 , 10 , 15] bu the x axis has 9 values [0 : 2 : 16]. Therefore, when I say grid on I am getting rectangular grids, which is kinda not good looking.
What should I do so that the y-axis will also have 9 values and the graph has some nice looking square grids?
Thank You!

2 个评论

Okay folks, I went through the documentation and got the answer.
You got to do
axis equal
Sorry for wasting your time.
Cheers!
That step is necessary but you may also have to explicitly set the yticks
ax = gca();
ax.YTick = ax.Xtick;

请先登录,再进行评论。

回答(0 个)

类别

帮助中心File Exchange 中查找有关 2-D and 3-D Plots 的更多信息

产品

版本

R2020a

标签

提问:

JPS
2021-2-7

评论:

2021-2-7

Community Treasure Hunt

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

Start Hunting!

Translated by