how to write name on plotted graph?

hi all:
i want to plot these three graphs in matlab such that name of each graph will be on graph like below figure.
p=[123 456 344 333 667 899 565 546 688 998 765 467]
T=[30 45 55 66 77 54 32 34 25 70 12 34]
m=[1.00 2.00 2.50 4.21 3.00 2.32 5.43 6.75 6.57 6.45 7.89 9.80]
figure
plot(p)
hold on
plot(T)
hold on
plot(m)
p=power
T=temperature
m=mass
i want to write name on each graph .
thanks

回答 (1 件)

KSSV
KSSV 2020 年 10 月 25 日

0 投票

Read about legend.
p=[123 456 344 333 667 899 565 546 688 998 765 467]
T=[30 45 55 66 77 54 32 34 25 70 12 34]
m=[1.00 2.00 2.50 4.21 3.00 2.32 5.43 6.75 6.57 6.45 7.89 9.80]
figure
plot(p)
hold on
plot(T)
hold on
plot(m)
legend("Power","Temperature","mass")

9 件のコメント

Engineer Batoor khan mummand
Engineer Batoor khan mummand 2020 年 10 月 25 日
thanks from your reply.
not in legend dear read my question , i want to each graph name with graph not in legend.
thanks
Engineer Batoor khan mummand
Engineer Batoor khan mummand 2020 年 10 月 25 日
like this dear.
KSSV
KSSV 2020 年 10 月 25 日
p=[123 456 344 333 667 899 565 546 688 998 765 467]
T=[30 45 55 66 77 54 32 34 25 70 12 34]
m=[1.00 2.00 2.50 4.21 3.00 2.32 5.43 6.75 6.57 6.45 7.89 9.80]
figure(1)
plot(p)
title("Power")
figure(2)
plot(T)
title("Temperature")
figure(3)
plot(m)
title("mass")
KSSV
KSSV 2020 年 10 月 25 日
p=[123 456 344 333 667 899 565 546 688 998 765 467]
T=[30 45 55 66 77 54 32 34 25 70 12 34]
m=[1.00 2.00 2.50 4.21 3.00 2.32 5.43 6.75 6.57 6.45 7.89 9.80]
power = figure(1) ;
plot(p)
Temperature = figure(2) ;
plot(T)
mass = figure(3)
plot(m)
KSSV
KSSV 2020 年 10 月 25 日
Read about text, annotation. Also manually you can go to edit and insert the text box where you can enter the desired text in your desired color.
Engineer Batoor khan mummand
Engineer Batoor khan mummand 2020 年 10 月 25 日
編集済み: Engineer Batoor khan mummand 2020 年 10 月 25 日
thanks from your reply dear .
i want to plot my graphs and their name like this but not in title and legend.
thanks
.
Image Analyst
Image Analyst 2020 年 10 月 25 日
Thanks for the announcement. I presume you saw KSSV's last comment. So what happened when you looked up the documentation on text and did something like
text(x, y, 'Radiation', 'Color', 'b');
I imagine you got it working since it's pretty easy, but since you did not say so explicitly, nor did you accept the Answer, nor ask a new question, we're still wondering.
Engineer Batoor khan mummand
Engineer Batoor khan mummand 2020 年 10 月 26 日
thanks you so much Image Analyst your method is correct dear i have used your method it is done but one thing that i am confusing that is the postion of name of the graph i mean graph name should come at the top of each graph.
thank you so much
KSSV
KSSV 2020 年 10 月 26 日
You have to read the documentation. You can specify the position like up/ down/ center etc....read the doc.

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

カテゴリ

ヘルプ センター および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

製品

リリース

R2017a

コメント済み:

2020 年 10 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by