Graphics |
When you use the text
command to display a character string, the string's position is defined by a rectangle called the Extent
of the text. You can display this rectangle either as a box or a filled area. For example, you can highlight contour labels to make the text easier to read.
[x,y] = meshgrid(-1:.01:1); z = x.*exp(-x.^2-y.^2);; [c,h]=contour(x,y,z); h = clabel(c,h); set(h,'BackgroundColor',[1 1 .6])
For additional features, see the following text properties:
BackgroundColor
-- Color of the rectangle's interior (none by default)
EdgeColor
-- Color of the rectangle's edge (none by default)
LineStyle
-- Style of the rectangle's edge line (first set EdgeColor
)
LineWidth
-- Width of the rectangle's edge line (first set EdgeColor
)
Margin
-- Increase the size of the rectangle by adding a margin to the text extent.
Example -- Multiline Text | Adding Arrows and Lines to Graphs |
© 1994-2005 The MathWorks, Inc.