How to add different texts in xline, when using arrayfun ?
1 次查看(过去 30 天)
显示 更早的评论
2 个评论
Antoni Garcia-Herreros
2023-3-17
Hello Sim,
You could try something like this for each case:
a(3).Label='M';a(3).Color='k'; % Maybe change FontName and FontSize
Although I'm sure there must be a better way of doing it.
I cannot find a way to have different color for the text and the lines.
采纳的回答
Star Strider
2023-3-17
Perhaps something like this —
fig = figure();
ax = axes(fig);
ax.XTick = 1:14;
dy = ["S","S","M","T","W","T","F"];
hxl = xline(ax.XTick-1,'-k',repmat(dy,1,fix(max(ax.XTick)/7)), 'LabelOrientation','horiz');
.
4 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!