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

Thread Subject:
Add baseline to Boxplot

Subject: Add baseline to Boxplot

From: Steve Sachay

Date: 23 Mar, 2011 05:00:21

Message: 1 of 3

I'd like to show the distribution of my residual values for various types of fit to my data on a boxplot. So naturally the ideal case would have the residuals centered at zero. It it possible to draw in the horizontal y=0 line behind the plots for reference? I don't see anything in the help for boxplot, but there may be another way? Thanks.

Subject: Add baseline to Boxplot

From: Steve Sachay

Date: 23 Mar, 2011 05:48:05

Message: 2 of 3

Oh, I should mention the real trouble is getting the boxes to appear "over" the line, so that they are in the foreground. I can put the line easily enough.

Subject: Add baseline to Boxplot

From: Tom Lane

Date: 23 Mar, 2011 13:38:43

Message: 3 of 3

> Oh, I should mention the real trouble is getting the boxes to appear
> "over" the line, so that they are in the foreground. I can put the line
> easily enough.

Try setting the z values of the line. For example:

   load carsmall; boxplot(MPG,Origin,'plotstyle','compact')
   line([0 7],[25 25],[-1 -1],'color','y','linewidth',5)

-- Tom

Tags for this Thread

No tags are associated with this thread.

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.

Contact us