Bar groups multiple line styles
조회 수: 14 (최근 30일)
이전 댓글 표시
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
채택된 답변
Azzi Abdelmalek
2016년 3월 29일
편집: Azzi Abdelmalek
2016년 3월 29일
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Bar Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!