how to control the BackgroundAlpha of the text box
7 次查看(过去 30 天)
显示 更早的评论
Is there a way to create a text box with BackgroundAlpha (such as 0.5)? I can't find the alpha option for text box background in Text Properties.
0 个评论
采纳的回答
Les Beckham
2025-8-20
You can use the undocumented feature of a 4-element color spec (the fourth element is the alpha). For example:
plot([0 1], [0 1]);
ht = text(0.45 ,0.5, 'This is a test');
set(ht, 'EdgeColor', [0 0 0], 'BackgroundColor', [1 0 0 0.4]);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
