Help!!! Can't figure out this error
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
dbmn
el 25 de Nov. de 2016
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 comentarios
Ver también
Categorías
Más información sobre Annotations 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!