How to plot multiple figures in the same figure in matlab?

G
Gracesmith9 · Sep 10, 2020 · 2K views
Question
How to plot multiple figures in the same figure in matlab?? I have to plot overlapping triangular windows in the same graph. Could anyone help me??. I need this for my project.
Expert Answer
Profile picture of John Williams
John Williams PhD Expert
Answered Aug 29, 2026
plot(x1, y1);
hold on
plot(x2, y2);
plot(x3, y3);

If you need multiple axes that overlap, do not use subplot() as subplot() automatically erases any axes that the new axes would overlap.

 

ax1 = axes('Position', [10 10 50 50]);
plot(ax1, x1, y1);
ax2 = axes('Position', [20 20 50 50]);
plot(ax2, x2, y2);
ax3 = axes('Position', [30 10 50 50]);
plot(ax3, x3, y3);
100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!