Thread Subject: error bar with data labels

Subject: error bar with data labels

From: Michael

Date: 31 May, 2011 04:01:05

Message: 1 of 4

Hello everyone.

I want to graph the averge test score (mean, with std) for several different test. For example: average +/- 1 stddev
the average math (85+/- 10), science (75 +/-15), reading 90 +/- 5 etc.

summary(1,i)= mean(data_reduce(:,i))
summary(2,i)=std(data_reduce(:,i))
figure
errorbar(summary(1,:),summary(2,:),'xr')

This is close but I just get data labels 1, 2, 3..22 (max numer of test catagories). How can I change the data label 1 to say math?

Subject: error bar with data labels

From: TideMan

Date: 31 May, 2011 05:20:59

Message: 2 of 4

On May 31, 4:01 pm, "Michael" <michael.lisow...@gentex.com.extrachar>
wrote:
> Hello everyone.
>
> I want to graph the averge test score (mean, with std)  for several different test.  For example: average +/- 1 stddev
> the average math (85+/- 10), science (75 +/-15), reading 90 +/- 5 etc.
>
> summary(1,i)= mean(data_reduce(:,i))
> summary(2,i)=std(data_reduce(:,i))
> figure
> errorbar(summary(1,:),summary(2,:),'xr')
>
> This is close but I just get data labels 1, 2, 3..22 (max numer of test catagories).  How can I change the data label 1 to say math?

Is there a new version of errorbar?
The old version has this format:
errorbar(x,y,e)
which does not correspond to the format of your command at all.

Anyhow, to change the labels on the x axis, you can do this:
xlab={'math','science','reading'};
set(gca,...
   'XTickLabel',xlab)

Subject: error bar with data labels

From: Michael

Date: 31 May, 2011 18:34:04

Message: 3 of 4

> Anyhow, to change the labels on the x axis, you can do this:
> xlab={'math','science','reading'};
> set(gca,...
> 'XTickLabel',xlab)

This worked only some of the catagories are long is there a command to rotate the text 90 degrees on the xlab?

Subject: error bar with data labels

From: TideMan

Date: 31 May, 2011 21:30:57

Message: 4 of 4

On Jun 1, 6:34 am, "Michael" <michael.lisow...@gentex.com.extrachar>
wrote:
> > Anyhow, to change the labels on the x axis, you can do this:
> > xlab={'math','science','reading'};
> > set(gca,...
> >    'XTickLabel',xlab)
>
> This worked only some of the catagories are long is there a command to rotate the text 90 degrees on the xlab?

No, not directly. You need to replace the tick labels with text, then
rotate that.
Search on this forum for "x tick label rotate" and you'll find a
routine that does it.

Tags for this Thread

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.

rssFeed for this Thread

Contact us at files@mathworks.com