Creating tick marks on a plot

조회 수: 3 (최근 30일)
Truman Cassady
Truman Cassady 2018년 6월 3일
답변: Star Strider 2018년 6월 3일
I can't find any previous question that is similar to mine somehow. All I need to show is an x-axis that consists of 1 to 24 with the tick marks shown for 1, 2, 3, 4, and so on until 24. Currently the plot is giving me tick marks for every five integers.
Thank you for any help

답변 (1개)

Star Strider
Star Strider 2018년 6월 3일
Try this:
x = 1:24;
y = rand(1,24);
figure
plot(x, y)
set(gca, 'XTick',x) % Define Specific X-Tick Locations

카테고리

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