Re: [R] Can't figure out why short figure won't work

2013-07-26 Thread Frank Harrell
[Sorry I can't quote past messages as I get mail on Nabble and have been 
told I can't reply through Nabble].


Thanks Kennel for recommended a narrowing range for usr y-limits.  That 
does help quite a bit.


But I found a disappointing aspect of the graphics system: When you 
change height= on the device call you have to change the y-coordinates 
to keep the same absolute vertical positioning.


Frank

--
Frank E Harrell Jr Professor and Chairman  School of Medicine
   Department of Biostatistics Vanderbilt University

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Can't figure out why short figure won't work

2013-07-26 Thread Richard M. Heiberger
lattice graphics allow you to specify units in cm or inches, and then the
absolute vertical positioning can be controlled.

On Fri, Jul 26, 2013 at 12:58 PM, Frank Harrell f.harr...@vanderbilt.eduwrote:

 [Sorry I can't quote past messages as I get mail on Nabble and have been
 told I can't reply through Nabble].

 Thanks Kennel for recommended a narrowing range for usr y-limits.  That
 does help quite a bit.

 But I found a disappointing aspect of the graphics system: When you change
 height= on the device call you have to change the y-coordinates to keep the
 same absolute vertical positioning.

 Frank


 --
 Frank E Harrell Jr Professor and Chairman  School of Medicine
Department of Biostatistics Vanderbilt University

 __**
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/**listinfo/r-helphttps://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/**
 posting-guide.html http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Can't figure out why short figure won't work

2013-07-25 Thread Frank Harrell
I can't get the points and a and b to render correctly (they are 
squeezed into the axis) unless I make the height of the figure waste a 
lot of space.  I'd appreciate any ideas.  The code is below. Thanks!


png('/tmp/z.png', width=480, height=100)
par(mar=c(3,.5,1,.5))
plot.new()
par(usr=c(-10, 410, -.04, 1.04))
par(mgp=c(1.5,.5,0))
axis(1, at=seq(0, 400, by=50))
axis(1, at=seq(0, 400, by=25), tcl=-.25, labels=FALSE)
title(xlab='Mean Count')
points(x, rep(-.02, length(x)))
lines(rep(.25*1500, 2), c(-.04, .04), col='blue')
lines(rep(.196*1500, 2), c(-.04, .04), col='blue')
text(.25*1500, .07, 'a', col='blue')
text(.196*1500,.07, 'b', col='blue')
dev.off()

It works if I use height=350.

Frank


 version
   _
platform   x86_64-pc-linux-gnu
arch   x86_64
os linux-gnu
system x86_64, linux-gnu
status
major  3
minor  0.1
year   2013
month  05
day16
svn rev62743
language   R
version.string R version 3.0.1 (2013-05-16)
nickname   Good Sport

--
Frank E Harrell Jr Professor and Chairman  School of Medicine
   Department of Biostatistics Vanderbilt University

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Can't figure out why short figure won't work

2013-07-25 Thread Richard M. Heiberger
I tried
text(.25*1500, .14, 'a', col='blue')
text(.196*1500,.14, 'b', col='blue')
and got improved spacing.

Another option is to take control of ylim, and extend the bottom of ylim a
bit lower than the automatically defined value.

Rich

On Thu, Jul 25, 2013 at 6:54 PM, Frank Harrell f.harr...@vanderbilt.eduwrote:

 I can't get the points and a and b to render correctly (they are
 squeezed into the axis) unless I make the height of the figure waste a lot
 of space.  I'd appreciate any ideas.  The code is below. Thanks!

 png('/tmp/z.png', width=480, height=100)
 par(mar=c(3,.5,1,.5))
 plot.new()
 par(usr=c(-10, 410, -.04, 1.04))
 par(mgp=c(1.5,.5,0))
 axis(1, at=seq(0, 400, by=50))
 axis(1, at=seq(0, 400, by=25), tcl=-.25, labels=FALSE)
 title(xlab='Mean Count')
 points(x, rep(-.02, length(x)))
 lines(rep(.25*1500, 2), c(-.04, .04), col='blue')
 lines(rep(.196*1500, 2), c(-.04, .04), col='blue')
 text(.25*1500, .07, 'a', col='blue')
 text(.196*1500,.07, 'b', col='blue')
 dev.off()

 It works if I use height=350.

 Frank


  version
_
 platform   x86_64-pc-linux-gnu
 arch   x86_64
 os linux-gnu
 system x86_64, linux-gnu
 status
 major  3
 minor  0.1
 year   2013
 month  05
 day16
 svn rev62743
 language   R
 version.string R version 3.0.1 (2013-05-16)
 nickname   Good Sport
 
 --
 Frank E Harrell Jr Professor and Chairman  School of Medicine
Department of Biostatistics Vanderbilt University

 __**
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/**listinfo/r-helphttps://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/**
 posting-guide.html http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Can't figure out why short figure won't work

2013-07-25 Thread Jim Lemon

On 07/26/2013 08:54 AM, Frank Harrell wrote:

I can't get the points and a and b to render correctly (they are
squeezed into the axis) unless I make the height of the figure waste a
lot of space. I'd appreciate any ideas. The code is below. Thanks!

png('/tmp/z.png', width=480, height=100)
par(mar=c(3,.5,1,.5))
plot.new()
par(usr=c(-10, 410, -.04, 1.04))
par(mgp=c(1.5,.5,0))
axis(1, at=seq(0, 400, by=50))
axis(1, at=seq(0, 400, by=25), tcl=-.25, labels=FALSE)
title(xlab='Mean Count')
points(x, rep(-.02, length(x)))
lines(rep(.25*1500, 2), c(-.04, .04), col='blue')
lines(rep(.196*1500, 2), c(-.04, .04), col='blue')
text(.25*1500, .07, 'a', col='blue')
text(.196*1500,.07, 'b', col='blue')
dev.off()

It works if I use height=350.

Frank


I get an error (x is missing), but I would try:

...
par(usr=c(-10,410,-0.1,1.04)
...

Jim

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.