Horizontal alignment of text objects w.r.t. their coordinates
MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
TitleAlignment controls the interpretation
the titles of graphical objects.
the interpretation of the coordinates of text objects.
Titles of graphical objects are
placed at the position defined by
whether the beginning, the center, or the end of the title text is
aligned at this position. See Example 1.
Text objects (i.e., objects of type
plot::Text3d) carry, in their
determine which point of the text this position refers to. For example,
HorizontalAlignment = Left and
= Bottom, the given position is the lower left corner of
the rendered text.
We plot three points with title positions 0.1 above
each point. The titles are aligned such that the beginning of the
Left), the center of the text (
or the end of the text (
Right) is at the
plot(plot::Point2d(0, 0, Title = "Point 1", TitlePosition = [0, 0.1], TitleAlignment = Left), plot::Point2d(1, 1, Title = "Point 2", TitlePosition = [1, 1.1], TitleAlignment = Center), plot::Point2d(2, 2, Title = "Point 2", TitlePosition = [2, 2.1], TitleAlignment = Right), PointSize = 2.5*unit::mm)
The following call generates a table showing all the combinations
Hor := [Left, Center, Right]: Vert := [Top, BaseLine, Center, Bottom]: plot((plot::Text2d(expr2text(Hor[i], Vert[j]), [i, j], HorizontalAlignment = Hor[i], VerticalAlignment = Vert[j]), plot::Point2d([i, j], Color = RGB::Black)) $ i = 1..3 $ j = 1..4, Axes = None, TitleFont = , PointSize = 2.5*unit::mm)
delete Hor, Vert: