Legends in same figure

1 次查看(过去 30 天)
maro
maro 2013-5-6
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
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 个评论
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
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-10
Try tinypic.com or look here

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Legend 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by