Effacer les filtres
Effacer les filtres

Space between bars in hist plot

2 vues (au cours des 30 derniers jours)
John
John le 11 Jan 2013
Hi,
I am using the code below to generate a plot like this.
x = randn(30,1);
[y2,x2] = ecdf(x);
[y1,x1] = hist(x);
plotyy(x1,y1,x2,y2,@(x,y)bar(x,y,1,'c'),'stairs')
Would anybody know how to get a space between the bars like the example?
Many thanks

Réponse acceptée

Daniel Shub
Daniel Shub le 11 Jan 2013
You are looking for the BarWidth property
plotyy(x1,y1,x2,y2,@(x,y)bar(x,y,1,'c', 'barwidth', 0.9),'stairs')
  1 commentaire
John
John le 11 Jan 2013
Thank you

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Scatter Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by