フィルターのクリア

How can I add both numbers and text as legend in a plot?

182 ビュー (過去 30 日間)
Jørgen
Jørgen 2013 年 12 月 4 日
コメント済み: Walter Roberson 2017 年 12 月 25 日
I have a matrix called x, which contains 8 numbers. I have then a plot, and I can get the numbers as legend by writing legend(num2str(x(1)),.....), but I also want one letter after each number in the legend. Have tried to write legend(num2str(x(1)) 'V',.....) etc. but with no success. Have searched a while after a solution, but can't find any.

採用された回答

sixwwwwww
sixwwwwww 2013 年 12 月 4 日
use
legend(strcat('Some text', num2str(someValue)))
  3 件のコメント
Ankita Kule
Ankita Kule 2017 年 12 月 25 日
Thank you. :)
Walter Roberson
Walter Roberson 2017 年 12 月 25 日
legend( sprintf('Some text %g', someValue) )

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

その他の回答 (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