How to display only grid on axes (without values)?

조회 수: 6 (최근 30일)
Csanad Levente Balogh
Csanad Levente Balogh 2021년 2월 14일
답변: Walter Roberson 2021년 2월 14일
Hi All!
I want to do a plot, where the grid of the y axes in displayed, but there is no y values. I tried:
set(gca,'ytick',[]);
With that command the y values disappear. Then I use:
ax = gca;
ax.YGrid = 'on';
But the grid doesn't reappear. I soppose that with the sirt command, I make the y axes grid and values invisible, and than if I make a change to them, they still won't appear? But I'm just guessing. Is there a way to show the grid, but hide the values?

채택된 답변

Walter Roberson
Walter Roberson 2021년 2월 14일
plot(rand(1,20))
yticklabels([])
grid on

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Object Properties에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by