Too many non-property/value arguments error occurred when applying a text box to a figure

21 ビュー (過去 30 日間)
Here is the line:
text(2,3,'\bf fontname{times} infty','FontSize',12,'center')

採用された回答

Walter Roberson
Walter Roberson 2019 年 9 月 6 日
'center' is not an option by itself. You want either 'HorizontalAlignment', 'center' or 'VerticalAlignment', 'center'
Also you appear to be missing \ before fontname and before infty: '\bf \fontname{times} \infty'
  2 件のコメント
Zeynab Mousavikhamene
Zeynab Mousavikhamene 2019 年 9 月 6 日
Thanks for your note. what is the role of \?
I uesed 'HorizontalAlignment', 'center' but the inf is not in the middle. For example I need inf sign to be exactly in the middle of x=2 (highlighted in the picture).Capture.JPG
Walter Roberson
Walter Roberson 2019 年 9 月 6 日
text(2, 3, '\bf\fontname{times}\infty','horizontalalignment', 'center', 'fontsize', 12)
That is, those two spaces you had in your control string were being output as spaces.
\ signals to the (default) tex interpreter that the next few characters are a command or special character . For example 'beta \beta' would output

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by