Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

How can I make a bar graph using a cell array of strings?

Asked by Seth Hirsh

Seth Hirsh (view profile)

on 4 Jan 2013

I would like to make a bar graph where the y axis contains numbers and the x axis contains strings. I have the names in a cell array of strings. I am pretty sure that a cell array of strings is not an acceptable format as a parameter for calling the bar function. What can I do to create this bar graph?

0 Comments

Seth Hirsh

Seth Hirsh (view profile)

Products

No products are associated with this question.

1 Answer

Answer by Azzi Abdelmalek

Azzi Abdelmalek (view profile)

on 4 Jan 2013
y=1:4
bar(y)
set(gca,'XtickLabel',{'one','two','three','four'})

0 Comments

Azzi Abdelmalek

Azzi Abdelmalek (view profile)

Contact us