[R] boxplot and xlim confusion?

Petr Pikal petr.pikal at precheza.cz
Thu Sep 29 17:39:04 CEST 2005


Hi

So you need x to be same in all subsequent plots e.g. from -5 to 5 
like in this.

boxplot(split(rnorm(30), rep(1:3, each=10)), horizontal =T, 
names=letters[1:3], ylim=c(-5,5))

You find it in a thorough reading bxp man page.

Currently, 'ylim' is used 'along the boxplot', i.e.,
          vertically, when 'horizontal' is false. 

So if horizontal is true you still need to use ylim not xlim :-)

HTH
Petr


On 29 Sep 2005 at 15:28, Karin Lagesen wrote:

To:             	"Petr Pikal" <petr.pikal at precheza.cz>
From:           	Karin Lagesen <karin.lagesen at medisin.uio.no>
Date sent:      	Thu, 29 Sep 2005 15:28:14 +0200
Copies to:      	r-help at r-project.org,
	Karin Lagesen <karin.lagesen at medisin.uio.no>
Subject:        	Re: [R] boxplot and xlim confusion?

> "Petr Pikal" <petr.pikal at precheza.cz> writes:
> 
> > Hi Karin
> >
> > I did not have seen any answer for your question yet so here is a
> > try.
> >
> > I gues you want the horizotal layout or your boxplot.
> >
> > boxplot(split(rnorm(30), rep(1:3, each=10)), horizontal =T, 
> > names=letters[1:3])
> >
> > boxplot(split(rnorm(30), rep(1:3, each=10)), horizontal =T, 
> > names=c(NA,"b",NA))
> 
> These look like the plots I want, yes. However, is there a way of
> locking the x-axis? When I do these several times in a row, the range
> of the x axis moves with the data being plotted. If I set xlim in the
> boxplot command, it makes no difference what so ever.
> 
> 
> > So this is closest what I could dig from your text.
> >
> > ***reproducible*** example would by good starting point what you
> > want and was not able to produce.
> 
> Sorry about that...:)
> 
> Karin
> -- 
> Karin Lagesen, PhD student
> karin.lagesen at medisin.uio.no
> http://www.cmbn.no/rognes/
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html

Petr Pikal
petr.pikal at precheza.cz




More information about the R-help mailing list