Move bars so that first is between 0 and 1 (0 and first tick) .
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
How can i move the bars 0.5 to the left (according xticks)?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/606045/image.jpeg)
I need first bar to be between 0 and 1, next from 1 to 2 and so on. Now the xticks are centered under each bar.
0 commentaires
Réponse acceptée
Adam Danz
le 3 Mai 2021
Modifié(e) : Adam Danz
le 3 Mai 2021
That looks like a histogram rather than a bar plot. You can define the histogram edges using (0:25)-.5 to shift the bars leftward by 0.5 units and centered on intergers.
If you are using a bar plot, set the x values to 0:23
4 commentaires
Adam Danz
le 4 Mai 2021
Modifié(e) : Adam Danz
le 4 Mai 2021
> Is it the lack of any number behind 'BinCounts' which makes this work
By specifying the bincounts, you're telling Matlab how high to make the bars which is similar to bar plot. It accepts floating point values, too, not just integer "counts".
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Data Distribution 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!