Plotting on the same graph
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
SARVESH AGRAWAL
le 5 Oct 2017
Commenté : SARVESH AGRAWAL
le 6 Oct 2017
Hi, I am trying to plot graphs in a for loop over one another for which, I am using the following code:
for secs=0.75:0.25:1.50
[ etf , decayFct , etfFreq , buildUpNorm , PNR ]=calcEtfSch(data,f_sampl,secs,data_point);
lgSch=10*log10(decayFct);
plT(lgSch,etfFreq);
hold on;
axis([ 0 1.5 -60 0 ]);
xticks([0 .25 0.5 0.75 1.00 1.25 1.50 ])
title( 'Schroeder curves with differing upper integration limits' )
end
However, I get 4 different plots rather than them being on the same graph. I will be glad to get some help.
2 commentaires
Réponse acceptée
Walter Roberson
le 5 Oct 2017
Each figure() call creates a new figure. You should remove the figure() call.
If for some reason it is impossible to remove the figure() call, then it will be necessary to use findobj() to locate all of the plots on all of the figures and merge them into a single plot.
Plus de réponses (1)
Ewout van der Feltz
le 5 Oct 2017
Modifié(e) : Ewout van der Feltz
le 5 Oct 2017
When plotting recursively it is often practical to use 'hold all' rather than 'hold on'. Include that before plotting the functions and the plots should end up in the same graph.
0 commentaires
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!