Correct Sprintf use on legend

10 ビュー (過去 30 日間)
Jose
Jose 2012 年 9 月 20 日
Hi, I'm plotting 3 things. I want to make a box legend inside the plot but cant find the right way to do it, I want the third legend say:
CI = Ddata(1) +- 10%
The code is the next:
rango=10
legend('Original Data','CI=Ddata(1)',sprintf('CI = Ddata(1) \pm %.1e',rango),4);
It doesnt create the legend and give this on the Command Window:
Warning: Invalid escape sequence appears in format string. See help
sprintf for valid escape sequences.
Any help is appreciated.

採用された回答

Matt Fig
Matt Fig 2012 年 9 月 20 日
編集済み: Matt Fig 2012 年 9 月 20 日
Use:
\\pm % The first \ escapes the use of the escape \.
instead of:
\pm
  1 件のコメント
Jose
Jose 2012 年 9 月 29 日
Thanks, I focused on other parts of my code and forget about this.

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by