133 / 5.000 Resultados de traducción Hello everyone, I want to know how the values of the X axis and Y axis can be further divided. I want the values on the x axis to be by ye
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Juan David Parra Quintero
el 4 de Ag. de 2022
Editada: Saarthak Gupta
el 12 de Sept. de 2023
133 / 5.000
Resultados de traducción
star_border
Hello everyone, I want to know how the values of the X axis and Y axis can be further divided. I want the values on the x axis to be by years.
Respuestas (1)
Saarthak Gupta
el 12 de Sept. de 2023
Editada: Saarthak Gupta
el 12 de Sept. de 2023
I understand you are trying to provide custom tick values for the x-axis of your plot. You need to use the ‘xticks’ function for the plot to achieve the desired result.
Please refer to the following example:
x=1:100;
y=x.^2;
plot(x,y);
The ticks are separated by 20 units. To plot the ticks 10 units apart (or at any other distance for that matter), you can do the following:
x=1:100;
y=x.^2;
plot(x,y);
xticks(0:10:100);
The ‘xticks’ function creates 10 ticks, spaced 10 units apart, in the x-axis. You can specify any other set of ticks as a row/column vector, which can be supplied as input to the ‘xticks’ function.
Please refer to the following MATLAB documentation for more details:
0 comentarios
Ver también
Categorías
Más información sobre Grid Lines, Tick Values, and Labels 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!