フィルターのクリア

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 Center および File ExchangeGrid 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