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