Thread Subject: Double Boxplot

Subject: Double Boxplot

From: Julia Sandell

Date: 2 Feb, 2012 20:41:10

Message: 1 of 3

Any suggestions for plotting two sets of data on the same plot using boxplot? I am trying to plot pre and post data for a variety of organs and would like the pre data to be one color and the post data to be another.

Thanks!

Subject: Double Boxplot

From: Tom Lane

Date: 2 Feb, 2012 22:29:20

Message: 2 of 3

> Any suggestions for plotting two sets of data on the same plot using
> boxplot? I am trying to plot pre and post data for a variety of organs and
> would like the pre data to be one color and the post data to be another.

x = [1 2 3 4 5 12 13 14 15 16]';
p = {'pre' 'pre' 'pre' 'pre' 'pre' 'post' 'post' 'post' 'post' 'post'}';
boxplot(x,p,'color','rb')

-- Tom

Subject: Double Boxplot

From: Julia Sandell

Date: 3 Feb, 2012 19:10:27

Message: 3 of 3

"Tom Lane" <tlane@mathworks.com> wrote in message <jgf2o0$jk4$1@newscl01ah.mathworks.com>...
> > Any suggestions for plotting two sets of data on the same plot using
> > boxplot? I am trying to plot pre and post data for a variety of organs and
> > would like the pre data to be one color and the post data to be another.
>
> x = [1 2 3 4 5 12 13 14 15 16]';
> p = {'pre' 'pre' 'pre' 'pre' 'pre' 'post' 'post' 'post' 'post' 'post'}';
> boxplot(x,p,'color','rb')
>
> -- Tom

Thank you so much, this is perfect!

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