[R] A problem of splitting the right screen in 3 or more independent vertical boxes:

Sarah Goslee sarah.goslee at gmail.com
Sat May 4 00:21:25 CEST 2013


Hi Aldi,

You might want
?layout
instead.

Sarah

On Fri, May 3, 2013 at 5:54 PM, Aldi Kraja <aldi at wustl.edu> wrote:
> Hmm,
> I had a typo paste by mistake in my x vector
> It has to be:
>
> x<-rnorm(1000,mean=0,sd=1)
> wheat1<-rnorm(100,mean=0,sd=1)
> wheat2<-rnorm(150,mean=0,sd=2)
> tomatos3<-rnorm(200,mean=0,sd=3)
> tomatos4<-rnorm(250,mean=0,sd=4)
> cucumbers5<-rnorm(300,mean=0,sd=5)
> cucumbers6<-rnorm(400,mean=0,sd=6)
> par(mfrow=c(1,2))
>
> hist(x, main="Left screen OK")
>
> boxplot(wheat1,wheat2,tomatos3,tomatos4,cucumbers5,cucumbers6)
> title ("Right screen: boxplot with plants")
>
> Thanks,
>
> Aldi
>
> On 5/3/2013 4:46 PM, Aldi Kraja wrote:
>>
>> Hi,
>> Based on par function, I can split the screen into  two parts left and
>> right.
>> I wish x occupies the half left screen, and all plants occupy half right
>> screen, which happens right now.
>>
>> But I wish the right screen, to be split in 3 or more vertical parts where
>> each pair of the same type of plant, are together in its own block of
>> boxplot, because each plant has its own unit of measure.
>> Let's say wheat is measured in ton, tomato in pound and cucumbers as
>> counts. :-)
>>
>> x<-rnorm(1000,mean=0,sd=1,main="Right screen")
>>
>> wheat1<-rnorm(100,mean=0,sd=1)
>> wheat2<-rnorm(150,mean=0,sd=2)
>> tomatos3<-rnorm(200,mean=0,sd=3)
>> tomatos4<-rnorm(250,mean=0,sd=4)
>> cucumbers5<-rnorm(300,mean=0,sd=5)
>> cucumbers6<-rnorm(400,mean=0,sd=6)
>> par(mfrow=c(1,2))
>>
>> hist(x, main="Left screen OK")
>>
>> boxplot(wheat1,wheat2,tomatos3,tomatos4,cucumbers5,cucumbers6)
>> title ("Right screen: boxplot with plants")
>>
>> Thank you in advance for any suggestions,
>>
>> Aldi
>>


-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list