English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I am creating bar charts in Matlab, and I would like to put a text label under each bar showing what the bar represents.

I seem to be only able to place numbers under each individual bar.
eg: bar([1 2 3],[# # #]);
This command plots three bars labeled 1, 2 and 3.
Matlab doesn't seem to allow me to put text in the place of 1, 2, 3.

If you could give me a command that would change this it would be most helpful. Thanks.

2006-12-21 13:15:53 · 3 answers · asked by Ubi 5 in Science & Mathematics Engineering

3 answers

you should be able to manipulate those from the figure window. Thats the easiest strategy.


You should also be able to modify them using the xlabel command.
set(gca,'xtick',[2 2.1 2.2 2.3 2.4 2.5])
This allows you to change where they are and their number value, but doesnt put letters in place.

aha

set(gca,'xticklabel',{'a' 'b' 'c' 'frog' 'tree'})

That should do it for you

2006-12-22 02:32:44 · answer #1 · answered by Curly 6 · 1 0

Bar Chart Matlab

2016-12-15 21:08:31 · answer #2 · answered by ? 4 · 0 0

Matlab Bar Chart

2016-11-13 21:38:46 · answer #3 · answered by Anonymous · 0 0

fedest.com, questions and answers