Multiple color bar graph in Matlab

조회 수: 1 (최근 30일)
Vartika Agarwal
Vartika Agarwal 2022년 5월 20일
답변: KSSV 2022년 5월 20일
I want to plot a multi color bar graph in Matlab
I have the data
x=[1 2 3]
y=[10 20 30 40]
Please find the attachment and solve the query

채택된 답변

KSSV
KSSV 2022년 5월 20일
x=[1 2 3] ;
y=[10 20 30] ;
c = {'r','g','b'} ;
figure
hold on
for i = 1:3
bar(x(i),y(i),c{i})
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by