Effacer les filtres
Effacer les filtres

Adjust bar width according to the x values

5 vues (au cours des 30 derniers jours)
leonidas86
leonidas86 le 13 Juil 2018
Commenté : dpb le 13 Juil 2018
Hello, I have a probem with my bar plot. I group my data with the histc function (groups not evenly spread) and calculate the x and y average for every group with accumarray. In the next step I use the bar command to draw the groups. Now to my issue:
The bars are placed at the average x value and have the bar width 1 (figure) and between each bar is a gap and I dont want those gaps.
Every bar should have the width of his values range. So each bar must have a individual width. How can I do this? Or is there a way to create e.g. 10 groups with the same range?
  1 commentaire
dpb
dpb le 13 Juil 2018
The bar graph is pretty difficult to use as generic tool with extensive customizations unfortunately.
I'm guessing you may be better off to just draw patch objects with area or patch or perhaps a combination of stairs and fill or the like to draw the areas as you want where you want.
I don't think the multiple bar works as you would need to overlay as many single-bar plots as there are bar widths.

Connectez-vous pour commenter.

Réponse acceptée

Star Strider
Star Strider le 13 Juil 2018

Plus de réponses (0)

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!

Translated by