フィルターのクリア

text as a table in a plot !!

22 ビュー (過去 30 日間)
Majid Mostafavi
Majid Mostafavi 2017 年 3 月 29 日
コメント済み: Majid Mostafavi 2017 年 3 月 29 日
Hi; I have a plot with different curves and point. I just want to add a text without coordination like top left. The text could be like below. I would be appreciate if someone could help me to do.
title: A B
a= 10 5
b= 32 2
c= 4 3
TnX

採用された回答

KL
KL 2017 年 3 月 29 日
編集済み: KL 2017 年 3 月 29 日
Hi,
Since you want to have a table like text, creating a latex table should do the trick, something like this:
cs = '\begin{tabular}{lll} title&A&B\\ a=&10&5\\ b=&32&2\\ c=&4&3 \end{tabular}';
figure;
plot(sin(1:0.01:pi))
ha = annotation('textbox',[0.7 0.7 0.2 0.2], 'Interpreter', 'latex');
set(ha, 'String', cs);
(0.7,0.7) are not exactly (x,y) coordinates while (0,0) represent bottom left and (1,1) represent top right corner of the window. It doesn't have anything to do with your plot axis. Goodluck, KL.
  1 件のコメント
Majid Mostafavi
Majid Mostafavi 2017 年 3 月 29 日
tnX KL, just in case the number I mentioned are double format and I want to use 'num2str' to change them how could it be possible?

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by