Legends in same figure

I am plotting in the same figure from different m-files and I want a legend for each of them to show up, I tried to manage that but I failed.
To make my question clear I called the following m-files,
Beforefault
Duringfault
Afterfault
each m-file (Beforefault,Duringfault and Afterfault) has only one figure and the plot part is like this:
figure(1);
plot(t,x);
end
I putted all the three legends in last part of last m-file (Afterfault), it doesn't work.

回答 (2 件)

Image Analyst
Image Analyst 2013 年 5 月 6 日

0 投票

What doesn't work about it? Does it error out? Does it not have the correct (matching) colors and line styles? Does it not put three (or however many you plotted) lines in the legend box? Can you upload a screenshot to http://snag.gy?

4 件のコメント

Image Analyst
Image Analyst 2013 年 5 月 10 日
You can delete all of the entries by issuing the "cla reset" command.
maro
maro 2013 年 5 月 10 日
I want to keep first entry from the three lines. Can you explain how can I use cla command?
maro
maro 2013 年 5 月 10 日
I used "cla reset" command it clears all entries before it and this not working for me because I need the first entries of previous plots.
maro
maro 2013 年 5 月 11 日
Please anyone have idea can help me.

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

maro
maro 2013 年 5 月 9 日

0 投票

My problem is I have so many data in same figure of all plots (entries of legend) how can I delete all of this entries?

6 件のコメント

Image Analyst
Image Analyst 2013 年 5 月 9 日
Can you answer my 5 questions first, so that we'll then be able to answer yours?
maro
maro 2013 年 5 月 9 日
There is no error, the three legend appear but is not matching colors and line styles.
I tried to upload the figure in site you gave me, I didn't success.
Thank you for your response
Image Analyst
Image Analyst 2013 年 5 月 9 日
You can hit alt-printscreen to capture the active window into the clipboard, and then paste into snag.gy.
maro
maro 2013 年 5 月 9 日
I have problem in java downloading that make me unable to save image in snag.gy. Is there any other sites to upload me figure?
Image Analyst
Image Analyst 2013 年 5 月 10 日
Try tinypic.com or look here
maro
maro 2013 年 5 月 10 日

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

カテゴリ

タグ

質問済み:

2013 年 5 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by