Bar groups multiple line styles
14 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Osh
am 29 Mär. 2016
Bearbeitet: Azzi Abdelmalek
am 29 Mär. 2016
Hi, I have a grouped bar chart as follows:
y = [2 2 3; 2 5 6; 2 8 9; 2 11 12];
h=bar(y)
I would like to generate 3 different lineStyles for each group so that the chart is visible in black and white as well.
LineArray={'_',':','--'}';
set(h,'LineStyle',LineArray)
Doesn't seem to work, throws this error:
Error using matlab.graphics.chart.primitive.Bar/set
While setting the 'LineStyle' property of 'Bar':
Invalid enum value. Use one of these values: '-' | '--' | ':' | '-.' | 'none'.
0 Kommentare
Akzeptierte Antwort
Azzi Abdelmalek
am 29 Mär. 2016
Bearbeitet: Azzi Abdelmalek
am 29 Mär. 2016
y = [2 2 3; 2 5 6; 2 8 9; 2 11 12];
h=bar(y)
LineArray={ '-' , ':' '--' };
for k=1:3
set(h(k),'LineStyle',LineArray{k})
end
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Bar Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!