Plot two grafphs at the same figure
1 次查看(过去 30 天)
显示 更早的评论
First of all: Merry Xmas and happy holidays to all!
Now here's my doubt: I want to plot two graphs at the same figure. But, each graph has it own program. Example: I have the program1 with the graph1 and the program2 with the graph2. Both graphs has the same x and y labels. I think that the solution may be using the savefig and the openfig commands but i didn't have sucess using both..
Thanks in advance!
0 个评论
采纳的回答
KSSV
2016-12-26
You have to read about hold on
clc; clear all
x = linspace(-pi,pi);
y1 = sin(x);
y2 = cos(x);
plot(x,y1)
hold on
plot(x,y2)
xlabel('x-axes')
ylabel('y-axes')
2 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!