modify axis in time series

3 ビュー (過去 30 日間)
Anastasia Anastasiadou
Anastasia Anastasiadou 2019 年 2 月 1 日
編集済み: Aquatris 2019 年 2 月 1 日
hello, I would like to modify the axis of a time series. I would like to put a specific row of a cell array as labels instead of the predefined containg only years. tes.jpg

回答 (1 件)

Aquatris
Aquatris 2019 年 2 月 1 日
編集済み: Aquatris 2019 年 2 月 1 日
You are not clear on what you want to do but from what I understand, you want to change the x labels from 0-2-4-6.. to something else. Below is such an example;
x = 1:1e-2:2*pi; % sample x data
y = sin(x); % sample y data
plot(x,y)
set(gca,'XTick',[1:1:7]) % shows 1 2 3 .. 7 in x axis
str1 = {'a','b','c','x','y','z','q'}; % cell array to replace 1 2 3 .. 7
set(gca,'XTickLabel',str1) % replace x axis values

カテゴリ

Help Center および File ExchangeElementary Math についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by