Superimposing Graphs with large difference in Y-axis values
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a graph a=exp(-0.2*x).*sin(x), with x in the range x = 0:pi/20:6*pi. I want to superimpose another graph z=exp(3*x).*cos(x) with the same x range to the other graph. I have tried it, the code is pos_combined_code. The graph displayed is pos_combined. It seems the a graph is not displayed. Only the z graph is displayed. I suspect the reason is the y-axis value for z is much bigger than a, and therefore it is impossible to display those 2 graphs together. I have attached graph a when plotted alone(graph a alone.jpg).
Anyone knows how to display these 2 graphs together in this situation? Thanks.
0 commentaires
Réponses (1)
Simon Chan
le 14 Jan 2022
2 commentaires
Kevin Holly
le 14 Jan 2022
x = 0:pi/20:6*pi
a=exp(-0.2*x).*sin(x)
z=exp(3*x).*cos(x)
figure
plot(x,a)
figure
plot(x,z)
figure
plot(x,a)
hold on
plot(x,z)
figure
yyaxis left
plot(x,a)
yyaxis right
plot(x,z)
Voir également
Catégories
En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!