Azzera filtri
Azzera filtri

How to make nonumeric x-axis values for Bar Charts

95 visualizzazioni (ultimi 30 giorni)
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);

Risposte (1)

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

Categorie

Scopri di più su Line Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by