Wrap Axis Labels in AppDesigner

2 ビュー (過去 30 日間)
Felipe Dicker
Felipe Dicker 2025 年 3 月 12 日
回答済み: Jack 2025 年 3 月 12 日
Is it possible to wrap the text in a UIAxis YLabel in AppDesigner if its string is too long? An example is provided below:
The string can change depending on what the user does, so it does not work to do something like:
str = ["Variation of";"Steering Wheel Angle"];

回答 (1 件)

Jack
Jack 2025 年 3 月 12 日
App Designer’s UIAxes do not automatically wrap long axis labels. However, you can manually force multiple lines by inserting newline characters (\n) or by assigning a cell array of strings. For example:
app.UIAxes.XLabel.String = sprintf("Long Label Text\n(Continued Here)");
or
app.UIAxes.XLabel.String = {"Long Label Text", "(Continued Here)"};
Either approach displays a multi-line label. Keep in mind there’s no built-in “auto-wrap,” so you’ll need to decide where to insert the line breaks.
Follow me so you can message me anytime with future questions. If this helps, please accept the answer and upvote it as well.

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

製品


リリース

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by