Datetick on Appdesigner doesn't work?

1 回表示 (過去 30 日間)
Birtan Derin
Birtan Derin 2018 年 7 月 13 日
回答済み: Birtan Derin 2018 年 7 月 13 日
Hi, I am building a GUI on App Designer. I have a 2-D plot on the application with some numeric values on y axis. and dates on the x axis. X variable is a datenum, and I use datetick to display my plot with the actual dates as the tick labes. Currently I have this:
plot(app.UIAxes,TradeDateUnique,SpreadUnique)
datetick('x','dd-mm-yyyy')
Chart works perfectly fine (although sometimes it opens up a new figure which I don't really care about). However, I still have datenum values on my x axis. Datetick doesn't work.
This is my UIAxes object
% Create UIAxes
app.UIAxes = uiaxes(app.ChartingTab);
title(app.UIAxes, 'Title');
xlabel(app.UIAxes, 'X');
ylabel(app.UIAxes, 'Y');
app.UIAxes.Position = [0 87 1214 450];
I didn't come across any resources online about this issue. Anyone knows how?

採用された回答

Birtan Derin
Birtan Derin 2018 年 7 月 13 日
Solved. Use datetick like this: datetick(app.UIAxes,'x','mm-yyyy')
Where UIAxes is the name of the 2-D Plot object.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGrid Lines, Tick Values, and Labels についてさらに検索

製品


リリース

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by