I am trying to color a box on a plot.
Ältere Kommentare anzeigen
i have a box with text in it that moves along a line on a plot. i need there to be background color in the box under the text. Right now I can only get it to show on top of the text.
Akzeptierte Antwort
Weitere Antworten (1)
Chunru
am 6 Mär. 2024
Try the following
figure;
an = annotation("textbox", "Color", "r", "BackgroundColor", "g", "String", "Text Box");
for i=0:0.01:0.9
an.Position= [i, 0.5, 0.1, 0.1];
drawnow
end
Kategorien
Mehr zu Characters and Strings finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
