How do you remove x-axis tick marks and keep the numbers?

조회 수: 18 (최근 30일)
Elham
Elham 2022년 6월 29일
답변: Walter Roberson 2022년 6월 30일
If I want to delete the tick marks on an x-axis only meanwhile keep the digits, what can I use? I tried set(gca,'TickLength'.[0 0.1]) but that removed the tickmarks for both the y and x-axis. I also tried set(gca,'XTick', []) but that removed the x-axis and all the digits.

답변 (1개)

Walter Roberson
Walter Roberson 2022년 6월 30일
plot(rand(1,20))
ax = gca;
ax.XAxis.TickLength = [0 0.1];

카테고리

Help CenterFile Exchange에서 Grid Lines, Tick Values, and Labels에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by