draw more date in the axis
1 回表示 (過去 30 日間)
古いコメントを表示
I would like to report more dates: for example every month or every week
I use plot to draw it..(
plot(Ax_Sys,XDates(locs(:,i)),sig,'DisplayName',STR_name{i},'Color',SumCTR_color(i,:),'LineWidth',1);)

0 件のコメント
採用された回答
Walter Roberson
2025 年 1 月 20 日
移動済み: Walter Roberson
2025 年 1 月 20 日
load matlab_Xdates
load matlab_TeStrum
load matlab_fig
Ax_Eq.Parent
Somehow, you have an axes that has no Parent, so gca is creating a new axes, and that new axes defaults to numeric.
You should also be specific about the axes to parent graphics operations to.
legend_lines(1)=plot(Ax_Eq,XDates,TE_strum(:,1));
xtickformat(Ax_Eq, 'MMM u' );% DA SISTEMARE
xticks(Ax_Eq, XDates(1):calmonths(1):XDates(end));% DA SISTEMARE
3 件のコメント
Walter Roberson
2025 年 1 月 20 日
The last line,
___ = xticks(ax,___)
is indicating that you can pass an axes as the first parameter.
その他の回答 (1 件)
Walter Roberson
2025 年 1 月 17 日
Use xticks
If you must report every week, then you will probably want to use xtickangle
9 件のコメント
Cris LaPierre
2025 年 1 月 20 日
編集済み: Cris LaPierre
2025 年 1 月 20 日
I can't duplicate your error, and I show an example that works with the expected data.
Please share all the data used to create your figure. Consider saving your variables to a mat file and attaching it to your post using the paperclip icon. Since you are specifiying a target axis, it would be insightful to see all relevant code.
参考
カテゴリ
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!