How can I plot a bar char from an excel file?

7 views (last 30 days)
I wan to plot a bar chart like the attached picture from the attached excel file sample. The problem is that I can not use the first column as ticks. It is shown by numbers.I tried some other techniques but it did not work since all the letter were not shown on the plot. I would be thankful if someone could help me. Thanks!
csvfiles = dir('*.csv');
for file = csvfiles'
T = readtable( ;
A = table2array(T(2:end,2:end)) ;
l = T.(1) ;

Accepted Answer

Simon Chan
Simon Chan on 28 Jan 2023
Try the following:
T = readtable('');
X = categorical(T.Var1); % Convert to categorical
Y = table2array(T(:,2:3));

More Answers (0)




Community Treasure Hunt

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

Start Hunting!

Translated by