s-news
[Top] [All Lists]

Re: Superposing graphics with exactly

To: Tristan Lorino <tristan.lorino@lcpc.fr>, s-news@lists.biostat.wustl.edu
Subject: Re: Superposing graphics with exactly
From: "Richard M. Heiberger" <rmh@temple.edu>
Date: Mon, 13 Mar 2006 10:12:16 -0500
Ah, I see now.  barplot doesn't follow the same rules you expect
it to follow.

> z_data.frame(size=c(3720,16962,11627,9676),mean=c(.6,.7,.3,.5),ax=0:3)
> z
   size mean ax 
1  3720  0.6  0
2 16962  0.7  1
3 11627  0.3  2
4  9676  0.5  3
> barplot(z$size,names=as.character(z$ax))
> par()$usr
[1]     -0.19999999      5.19999981   -678.47998047  17640.48046875
> points(0:5, 0:5)
> tmp <- barplot(z$size,names=as.character(z$ax))
> tmp
[1] 0.69999999 1.90000010 3.10000014 4.30000019
> text(x=tmp, y=5000, letters[1:4])
> 

To match the barplot scaling, you need to do a lienar transformation.

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