How to add different texts in xline, when using arrayfun ?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sim
am 17 Mär. 2023
Kommentiert: Star Strider
am 17 Mär. 2023
2 Kommentare
Antoni Garcia-Herreros
am 17 Mär. 2023
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.
Akzeptierte Antwort
Star Strider
am 17 Mär. 2023
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!