how to separate two graphe in one figure
Show older comments
how to separate two graphe in one figure like this picture in matlab
Accepted Answer
More Answers (1)
Image Analyst
on 26 Nov 2024
0 votes
If you want one plot or surface to be "lifted" above the other, you can add an offset to the one you want shifted. Be aware that the axes units will not align with the original units, but with the shifted units.
4 Comments
Belaid
on 28 Nov 2024
x = linspace(0, 5*pi, 100);
y1 = cos(x);
y2 = sin(x);
y2Lifted = y2 + 3; % Raise it up by 3 units.
plot(x, y1, 'b-', 'LineWidth', 3);
hold on;
plot(x, y2, 'r-', 'LineWidth', 3);
plot(x, y2Lifted, 'm-', 'LineWidth', 3);
legend('y1', 'y2', 'y2Lifted', 'Location', 'west');
grid on;
To learn other fundamental concepts, invest 2 hours of your time here:
Image Analyst
on 29 Nov 2024
I don't understand the question. What is t? Is it x or y? And if it's one of those, what value would the other x or y have? Maybe you should start your own question rather than continue here in @Belaid Boutqlmount's question (for which he'll get emails about).
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


