필터 지우기
필터 지우기

Hi when I plot I always get the same color for both bar. They are from different classes. How can I make the color different? Thank you.

조회 수: 1 (최근 30일)
close all
clear
clc
r = [100; 80];
bar(r)
ylabel('Accuracy');
xlabel('Classifier')
%yticks([0 0.2 0.4 0.6 0.8 1])
xticklabels({'Mono', 'Hetero'})

채택된 답변

William Rose
William Rose 2022년 11월 28일
y=[100 90 70];
b=bar(y,'FaceColor','flat');
%Next line: Each row is the colorspec for one bar
b.CData=[1,0,0;0,1,0;0,0,1];

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by