필터 지우기
필터 지우기

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 (최근 30일)
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.

답변 (1개)

Saarthak Gupta
Saarthak Gupta 2023년 9월 12일
편집: Saarthak Gupta 2023년 9월 12일
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:

카테고리

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