How can I use datetick with more than x, y, z in input and on Y-axis?
2 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I am using datenum to convert time txt in MM:SS.FFF in serial date number. The next step is to change those numbers in MM:SS.FFF with datetick when I am ploting.
My problem is that I have more than just 3 inputs (in datetick there is just 'x','y','z' in possibilities)to put in my plot and I would like to have the time Format in Y-axis.
I have :
Format = 'MM:SS.FFF';
x= datenum(txt,Format);
x1= datenum(txt2,Format);
x2= datenum(txt3,Format);
x3= datenum(txt4,Format);
x4= datenum(txt5,Format);
plot(y,x,y,x1,y,x2,y,x3,y,x4)
datetick('x',Format,'keepticks');
datetick('x1',Format,'keepticks');
datetick('x2',Format,'keepticks');
datetick('x3',Format,'keepticks');
datetick('x4',Format,'keepticks');
So I have 2 errors in this case: x1, x2, x3, x4 are not considering in input argument and x should be in X-axis.
How can I do it with datetick or with something else from my serial numbers from datenum ?
Thank you
Martin
0 件のコメント
採用された回答
dpb
2018 年 2 月 2 日
Syntax for datetick is
datetick(tickaxis)
not
datetick(wanteddateaxisvariablename)
Just need
datetick('y',Format,'keepticks')
However, I'd strongly suggest unless you're running a version of Matlab prior to R2014b to convert from datenum to the datetime class. plot and friends have subsequently been made datetime aware so don't need klunky datetick any longer.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Dates and Time についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!