teepee
teepee

Reputation: 2714

Categorical bar graph labels don't work on Matlab

I tried this code to get a categorical label on the bottom of my bar graph:

c = categorical({'apples','oranges','pears'});
prices = [1.23 0.99 2.3];
bar(c,prices)

In the MATLAB documentation, this claims to have the bottom of the axis labelled with the categories in c. Instead I only see 1, 2, 3 along the bottom. Is something wrong with my setup?

Upvotes: 0

Views: 696

Answers (1)

EBH
EBH

Reputation: 10440

This functionality was only introduced in Matlab 2017a. As you can see here it is absent from 2016b docs:

enter image description here

Upvotes: 1

Related Questions