s-news
[Top] [All Lists]

Re: Histograms on same scale

To: Andre.Mery@aventis.com
Subject: Re: Histograms on same scale
From: Sundar Dorai-Raj <sundar.dorai-raj@PDF.COM>
Date: Tue, 17 Aug 2004 10:08:23 -0500
Cc: s-news@lists.biostat.wustl.edu
In-reply-to: <E127384EB824D347A8DA631BE8082558032A66@crbsmxsusr08.pharma.aventis.com>
Organization: PDF Solutions, Inc.
References: <E127384EB824D347A8DA631BE8082558032A66@crbsmxsusr08.pharma.aventis.com>
Reply-to: sundar.dorai-raj@PDF.COM
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)


Andre.Mery@aventis.com wrote:
Hi,
I am just drawing 2 histograms side by side (using par(mfrow = c(1,2)). The highest class of the 1st one is up to 24, although the highest class of the 2nd one is up to 20. So, the y-axis of the 1st one goes up to 24, although the y-axis of the 2nd one goes up only to 20. In order to have a nice visual comparison between these 2 plots, how can I force the y-axis of the 2nd one to be plotted up to 24? I couldn't get the proper instruction. Thanks for any help.

Use the ylim argument in both plots:

par(mfrow = c(1, 2))
hist(x1, ylim = c(0, 24))
hist(x2, ylim = c(0, 24))

--sundar


<Prev in Thread] Current Thread [Next in Thread>