Modifying y axis division

조회 수: 6 (최근 30일)
JPS
JPS 2021년 2월 7일
댓글: Adam Danz 2021년 2월 7일
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
JPS
JPS 2021년 2월 7일
Okay folks, I went through the documentation and got the answer.
You got to do
axis equal
Sorry for wasting your time.
Cheers!
Adam Danz
Adam Danz 2021년 2월 7일
That step is necessary but you may also have to explicitly set the yticks
ax = gca();
ax.YTick = ax.Xtick;

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by