How can I plot an histogram with bar chart that have striped filling?

7 views (last 30 days)
I would like to have not full filling in every bar, for example in LC1-drift I would want to have the same color of LC1 but with a striped filling, like in the figure:
This is my script:
figure
livelli = categorical({'VC','VA','VB','Modello 1','Modello 3'});
errore = [0.1886 0.1946 0.1911 0.1725 0.1904 0.1975
0.1711 0.1757 0.1631 0.1818 0.1816 0.2106
0.1955 0.2128 0.2073 0.2242 0.1813 0.2389
0.2423 0.1288 0.1132 0.1752 0.1194 0.1497
0.2000 0.1784 0.1768 0.2000 0.1768 0.1000];
bar(livelli,errore)
ylabel('Dispersione drift')
legend('LC1','LC1-drift','LC2-drift','LC3','LC3-drift','LC4')
Thank you very much to whom will help me!!
Sofia

Answers (1)

the cyclist
the cyclist on 16 Mar 2021
Here is a very old post about how to do this. I don't know if there is something newer or better.
  2 Comments
Sofia Giusto
Sofia Giusto on 17 Mar 2021
Unfortunately I have tried to use the functions in the post but matlab gives me error telling that the functions are not recognised..
the cyclist
the cyclist on 17 Mar 2021
Edited: the cyclist on 17 Mar 2021
Those are user-contributed functions, not distributed with MATLAB. You have to download them from the File Exchange, and put them in your path.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!