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

2 visualizaciones (últimos 30 días)
Sofia Giusto
Sofia Giusto el 16 de Mzo. de 2021
Editada: the cyclist el 17 de Mzo. de 2021
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

Respuestas (1)

the cyclist
the cyclist el 16 de Mzo. de 2021
Here is a very old post about how to do this. I don't know if there is something newer or better.
  2 comentarios
Sofia Giusto
Sofia Giusto el 17 de Mzo. de 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 el 17 de Mzo. de 2021
Editada: the cyclist el 17 de Mzo. de 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.

Iniciar sesión para comentar.

Categorías

Más información sobre Histograms en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by