I am trying to Combine a Line and a Bar Chart using Two y-Axes.
조회 수: 3 (최근 30일)
이전 댓글 표시
I am trying to combine a Line and a Bar Chart using two y-axes. I am using the following code and the line chart get hidden behind the bar graph.
C1=[0.26;0.35;0.27];
C2=[21;29;27];
set(gca,'XTickLabel',{'0.08 g ','0.2 g ','0.40 g '},'FontWeight','bold')
yyaxis left
p = plot(C1);
ylim([0 0.4])
yyaxis right
b=bar(C2);
ylim([0 30])
Can someone help me solve this problem?
댓글 수: 0
채택된 답변
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!