Draw multi graphs in one figure
Ältere Kommentare anzeigen
How to draw multi plots with same x axis and different ranged y axis in a same figure? (See the x axis and y axis values written in the image attached) . 

clc;
close all;
t=0:0.000001:0.1;
x=sin(100*t);
y=cos(100*t);
plot(t,x);
hold on
plot(t,y);
1 Kommentar
VBBV
am 23 Jun. 2023
See stackedplot function https://in.mathworks.com/help/matlab/ref/stackedplot.html
Akzeptierte Antwort
Weitere Antworten (1)
Aakash
am 23 Jun. 2023
0 Stimmen
You can achieve the desired outcome using subplot function as below:
t=0:0.000001:0.1;
x=sin(100*t);
y=cos(100*t);
figure;
subplot(2, 1, 1); % First subplot
plot(t, x);
ylim([-1 1]);
title('Plot 1');
subplot(2, 1, 2); % First subplot
plot(t, y);
ylim([-1 1]);
title('Plot 2');
1 Kommentar
Reji G
am 23 Jun. 2023
Kategorien
Mehr zu Title finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
