Creating tick marks on a plot

5 visualizaciones (últimos 30 días)
Truman Cassady
Truman Cassady el 3 de Jun. de 2018
Respondida: Star Strider el 3 de Jun. de 2018
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

Respuestas (1)

Star Strider
Star Strider el 3 de Jun. de 2018
Try this:
x = 1:24;
y = rand(1,24);
figure
plot(x, y)
set(gca, 'XTick',x) % Define Specific X-Tick Locations

Categorías

Más información sobre Grid Lines, Tick Values, and Labels en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by