How to use "hold on" for plotmatrix?
Afficher commentaires plus anciens
I am currently trying to run multiple simulations and superimpose all the plots of the sampled probability density functions from the simulation over one another on the same figure via "hold on." For the histogram function this seems to work if I am plotting one variable, but if I am plotting multiple variables to show the marginal and joint distributions I would want to use plotmatrix. However, it looks like plotmatrix and "hold on" are not exactly compatible and don't produce the same result as using "hold on" with histogram.
The format of my code for doing this looks roughly like this (simplified for generality):
n = 1;
while n <= 5
samples = my_function(parameters);
figure(1)
histogram(samples)
hold on
end
What I wanted to do was simply:
plotmatrix(samples)
hold on
Instead of using histogram for when I want to plot more than one variable. But I tried using plotmatrix for just one variable thinking that it would do the same thing as histogram and it doesn't - the plots were not superimposed at all and instead replaced one another.
What would be the proper way to achieve what I want to do?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Data Distribution Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
