Adding text programmatically to a figure
Show older comments
I have a figure with several subplots in it. I want to place a textbox with some text init which belongs to the entire figure. However, whenever I try to use the text command to place the text, it places it relative to the current subplot but not to the overall figure. How do I overcome this nuance?
Thanks in advance.
Accepted Answer
More Answers (1)
dpb
on 3 Jan 2022
0 votes
text() is exclusively a child of an axes, not a figure. To write text outside the boundaries of an axis, use the annotation object instead.
Or, depending upon just what you want/need for this to contain, use tiledlayout with which you can have a shared title and axes labels. Those may or may not be sufficient for your purpose.
Categories
Find more on Annotations 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!