フィルターのクリア

Executing 'datetick' shifts plot, no longer lines up with x-axis

2 ビュー (過去 30 日間)
Grant
Grant 2017 年 8 月 9 日
回答済み: Star Strider 2017 年 8 月 9 日
I plot a graph with plotyy, which should line up against an x-axis from the 8th Nov 2016 to 25 Jan 2017. The variable Datenum_8Nov_25Jan is a list of datenums for each day in that range. However, after I apply datetick, the variable DailyMeanTC_RiftTip shifts and no longer lines up (it runs til 29th Jan instead of 25th).
id1 = ~isnan(waterarea_2016_17);
plotyy(Datenum_8Nov_25Jan(id1),waterarea_2016_17(id1),Datenum_8Nov_25Jan,DailyMeanTC_RiftTip)
datetick('x','dd/mm')
I've attached imgs of before/after datetick

採用された回答

Star Strider
Star Strider 2017 年 8 月 9 日
The datetick (link) function has 'keeplimits' and 'keepticks' arguments that could do what you want.
Try them!

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTwo y-axis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by