Plot a grouped bar chart

조회 수: 10 (최근 30일)
Nora Lindell
Nora Lindell 2019년 12월 22일
댓글: dpb 2019년 12월 22일
Hi,
I have a script and for some reason I cannot plot a grouped bar chart, or any other plot. This is my script, I ave tried to make other plots with different datasets myt nothing works. Am I missing something obvious?
clc;
concentration = readtable('concentration_metal.xlsx'); %Metal concentrations in the soil samples in mg/kg
conf_interval = readtable('confidence_interval.xlsx'); %95 percent confidence interval for the metal concentration
soil_1=concentration(4,4:21);
soil_2=concentration(8,4:21);
soil_3=concentration(12,4:21);
soil_4=concentration(16,4:21);
soils=[soil_1 ; soil_2 ; soil_3 ; soil_4]; %combining the average soil concentrations
%transpose rows to colomns
xc=table2cell(soils);
soils_sec=xc';
soils_tree=cell2table(soils_sec);
soils_final=table2array(soils_tree);
%soils_final=cell2mat(soils_sec);
x={'50 Cr' '52 Cr' '56 Fe' '57 Fe' '60 Ni' '62 Ni' '63 Cu' '65 Cu' '66 Zn' '68 Zn' '75 As' '78 Se' '82 Se' '111 Cd' '114 Cd' '206 Pb' '207 Pb' '208 Pb'};
%x=x';
figure()
bar(soils_final)
  댓글 수: 1
dpb
dpb 2019년 12월 22일
Well, we can't try to duplicate because you forgot to attach the data files to go with it...what symptoms do you have--errors, unexpected plot appearance, ...???
Not much to go on here.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Agriculture에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by