[R] Two graphs, align vertically

Uwe Ligges ligges at statistik.uni-dortmund.de
Thu Aug 23 10:24:16 CEST 2007



squall44 wrote:
> Hi,
> 
> I created an ecdf and a boxplot. Now I would like to place the ecdf above
> the boxplot.
> But I only managed to align them horizontally. I used this code:
> 
> #-------------------------------------------
> par(mfrow=c(1,2), mar=c(5,3,3,1))


As in the message before: Please read the help pages more carefully! You 
found par(mfrow), what about reading the help page and switching to c(2,1)?

Uwe Ligges


> # ecdf
> library(plotrix)
> x = c(1.6,1.8,2.4,2.7,2.9,3.3,3.4,3.4,4,5.2)
> F2.5 <- ecdf(x)
> plot(F2.5,
>   verticals= TRUE,
>   do.p = TRUE,
>   lwd=3,
>   ylab = "",
>   xlab = "",
>   main = "Figur 2.5 Empirische Verteilfunktion",
>   xlim = c(1,5.5))
> abline(h= (0:5)*0.2)
> staxlab(at=x,labels=paste("X[",1:10,"]",sep=""),nlines=3,top.line=2,
> line.spacing=1, cex=0.8)
> 
> #boxplot
> F26<-boxplot(x,
>      horizontal=TRUE,
>      main="Figur 2.6 Der Boxplot",
>      axes=FALSE,
>      varwidth=TRUE)
> #-------------------------------------------
> 
> Can anyone tell me how I need to change the code to align the two graphs
> vertically?
> Thanks in advance
> Tobias
>



More information about the R-help mailing list