How can I change the color and border of my bars on a hbar graph?
조회 수: 5 (최근 30일)
이전 댓글 표시
I have a bar simple bar graph made with the following code. I want to have the three bars be different colors. Thank You!
yearsforcoal=fossilfulesyearsleft(1,4);
yearsforoil=fossilfulesyearsleft(3,4);
yearsforng=fossilfulesyearsleft(2,4);
c=categorical({'Coal','Natural Gas','Oil'})
Yearsl=[yearsforcoal yearsforng yearsforoil]
barh(c,Yearsl)
title('Projected Fossil Fuel Reserves','FontSize',18)
xlabel('Years Left','FontSize',15)
ylabel('Fossil Fuel Type','FontSize',15)
댓글 수: 0
답변 (2개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Discrete Data Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!