Jianghong wrote:> Hello,
>
> I have created two boxplots with following R code. There is one
outlier in> B group.
> The outlier is 33. But the all other data are between 0 to 4.
>
> How can I skip y-axis around 5 to 25, and expand 0-4 for this case.
Also I> want keep the outlier in my boxplot.
> I want my boxplot look like the second one, keep the outlier, and
make an> interrupt of y-axis from 5 to 25.
>
> Thanks,
> Jianghong
>
>
> Example = c( 0.00,0.33,0.75,3.00,2.50,0.50,2.00,33.00)
> Grp_Example
=c("A","A","A","B","B","B","B","B")
>
> Example_Data= cbind(Example,Grp_Example)
> attach(Example_Data)
>
>
> boxplot(Example ~ Grp_Example,main=paste("Boxplot of Example"),
> pars = list(boxwex = 0.25, staplewex = 0.25, outwex = 0.25))
>
> boxplot(Example ~ Grp_Example,main=paste("Boxplot of
Example"),ylim=c(0,4),> pars = list(boxwex = 0.25, staplewex = 0.25, outwex = 0.25))
Try plotting in two regions of the same device. Quick and dirty
example:
par(mfrow=c(2,1))
boxplot(Example ~ Grp_Example,main=paste("Boxplot of Example"),
pars = list(boxwex = 0.25, staplewex = 0.25, outwex = 0.25),
ylim=c(25,35),xaxt="n")
boxplot(Example ~ Grp_Example,
pars = list(boxwex = 0.25, staplewex = 0.25, outwex = 0.25),
ylim=c(0,4))
See ?layout --instead of par(mfrow) -- and ?par for further
adjustments of region sizes and margins.
Helios
INSTITUTO DE BIOMEC?NICA DE VALENCIA
Universidad Polit?cnica de Valencia ? Edificio 9C
Camino de Vera s/n ? 46022 VALENCIA (ESPA?A)
Tel. +34 96 387 91 60 ? Fax +34 96 387 91 69
www.ibv.org
Antes de imprimir este e-mail piense bien si es necesario hacerlo.
En cumplimiento de la Ley Org?nica 15/1999 reguladora de la Protecci?n
de Datos de Car?cter Personal, le informamos de que el presente mensaje
contiene informaci?n confidencial, siendo para uso exclusivo del
destinatario arriba indicado. En caso de no ser usted el destinatario
del mismo le informamos que su recepci?n no le autoriza a su divulgaci?n
o reproducci?n por cualquier medio, debiendo destruirlo de inmediato,
rog?ndole lo notifique al remitente.