I am trying to color a box on a plot.
Show older comments
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.
Accepted Answer
More Answers (1)
Chunru
on 6 Mar 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
Categories
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!