Help!!! Can't figure out this error
1 回表示 (過去 30 日間)
古いコメントを表示
I'm getting this error when I run the plot. "There is no DatetimeTickFormat property on the Line class." I'm trying to have x axis show the dates rather than the serial date number. Please Help
MATLAB code
if
fts1 = fints(Time,Data,{'Open','High','Low','Close'})
high = fts2mat(fts1.High)
dates=datenum(Time,'yyyy/mm/dd')
window_size=20;
output=tsmovavg(high,'s',window_size,1);
plot(dates,output,'DatetimeTickFormat','dd-MMM-yyyy');
end
0 件のコメント
回答 (1 件)
dbmn
2016 年 11 月 25 日
There are two solutions to your problem
a) choose a format other than datenum for your dates variable, f.ex.
dates = datetime(Time,'InputFormat','yyyy/MM/dd');
b) keep the data the same but fiddle with the xlabel property
myAx = gca; % or via plothandle.Parent
n = 5; % user each n-th element
myAx.XTick = dates(1:n:end);
myAx.XTickLabel = datestr(dates(1:n:end), 'yyyy/MM/dd');
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!