Filter löschen
Filter löschen

How to make nonumeric x-axis values for Bar Charts

95 Ansichten (letzte 30 Tage)
tarmizi adam
tarmizi adam am 26 Jan. 2013
Hello all,
I want to use the MATLAB bar plot to plot some data. I have these data that i've imported from excel (4 Rows and 2 columns).
40 Feat = 50.52 60 Feat = 36.60 90 Feat = 46.78 120 Feat = 32.56
How do i plot a bar graph with the x-axis labeled as '40 Feat','60 Feat', '90 Feat' and so on...
I have done this, but the x-axis does not display what i intend to do. The x-axis shows nothing
%read excel data to plot
[numDat,txtDat]=xlsread('BarPlot.xlsx');
x = numDat(:,1);
y = txtDat(:,1);
bar(x);
set(gca,'xtick',1:9,'xticklabel',y);

Antworten (1)

Wayne King
Wayne King am 26 Jan. 2013
Y = [50.52 36.60 46.78 32.56];
bar(Y)
set(gca,'xticklabel',{'40 feet','60 feet','120 feet'})

Kategorien

Mehr zu Line Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by