Thread Subject: text labels in bar plots

Subject: text labels in bar plots

From: Mastaneh

Date: 8 Aug, 2008 16:03:03

Message: 1 of 6

Hi everyone,

I need to apply text (string) labels instead of usual
numbers to the x-axis of my bar plots, but couldn't find
anyway to change them as in h=bar() and set(h,...). Does
anybody know how to do that?
Many thanks in advance :)
Mastaneh

Subject: text labels in bar plots

From: Nick Clark

Date: 8 Aug, 2008 16:09:01

Message: 2 of 6

Use cell arrays as follows:


bar([3 4 5])
set(gca,'XTickLabel',{'me','myself','&I'})

Subject: text labels in bar plots

From: Mastaneh

Date: 8 Aug, 2008 16:17:01

Message: 3 of 6

"Nick Clark" <bmoviehorror@hotmail.com> wrote in message
<g7hr2t$cqe$1@fred.mathworks.com>...
> Use cell arrays as follows:
>
>
> bar([3 4 5])
> set(gca,'XTickLabel',{'me','myself','&I'})
>

Thanks a lot Nick! It worked :)

Subject: text labels in bar plots

From: Nick Clark

Date: 8 Aug, 2008 16:25:03

Message: 4 of 6

Happy to help :)

Subject: text labels in bar plots

From: Ajit

Date: 22 Aug, 2008 20:06:33

Message: 5 of 6

On Aug 8, 11:25 am, "Nick Clark" <bmoviehor...@hotmail.com> wrote:
> Happy to help :)

What will make the labels appear vertical instead of horizontal?
Thanks,
-Ajit

Subject: text labels in bar plots

From: Walter Roberson

Date: 25 Aug, 2008 16:23:36

Message: 6 of 6

Ajit wrote:

> What will make the labels appear vertical instead of horizontal?

There is a Matlab File Exchange (FEX) contribution to create
rotated tick labels.
--
Q = quotation(rand);
if isempty(Q); error('Quotation server filesystem problems')
else sprintf('%s',Q), end

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
bar plot Mastaneh 8 Aug, 2008 12:05:09
bar plot axis Mastaneh 8 Aug, 2008 12:05:09
rssFeed for this Thread

Contact us at files@mathworks.com