plot x-axis data with discretize

2 visualizaciones (últimos 30 días)
Ali Najem
Ali Najem el 18 de Mayo de 2021
Comentada: Star Strider el 19 de Mayo de 2021
Hello experts,
simple question ..
x = 0:2:24;
y= rand(1,13);
plot(x,y)
How can I plot x-axis where it would be like this (0,2,4,6,8 .......etc)?
thanks indeed..

Respuesta aceptada

Star Strider
Star Strider el 18 de Mayo de 2021
Perhaps something like this —
x = 0:2:24;
y= rand(1,13);
plot(x,y)
xticks(0:2:24) % 'xticks' Function Introduced In R2016b
xlim([min(x) max(x)]) % Optional
.
  2 comentarios
Ali Najem
Ali Najem el 19 de Mayo de 2021
thanks alot, it worked.
Star Strider
Star Strider el 19 de Mayo de 2021
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by