[R] high resolution plot tick problems

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Apr 24 10:12:38 CEST 2007


You will do better to use e.g. bitmap() and bitmap the output at 
600 dpi, if that is what you are aiming at.  The default line width 
will be 1/96".

You haven't told us what OS 'my PC' is running, but people who say that 
usually mean Windows.  On the Windows' png device the default line width 
is one pixel.

On Mon, 23 Apr 2007, Brian O'Connor wrote:

> R-Masters,
>
> I need to produce high resolution line plots, with two or more plots
> per page. The commands I'm using cause the tick labels to appear on
> the x-axis line itself rather than below it. And the tick marks are
> so tiny they are invisible. These commands produce the problem on my
> PC:
>
> png("trial.png", width=3000, height=4800, res = 600 ) # width &
> height purposely set for 5 x 8 inches
>
> par(ann=F, font.main=2, font.lab=2, font.axis=1,
>     cex=1, cex.main=7, cex.lab=7, cex.axis=7,
>     lwd=12, las=1, mai=c(6, 6, 5, 3) )
>
> x = seq(-2.5, 2.5, length=100)
>
> split.screen(c(2,1))
> screen(1)
> plot(x,sin(x),type="l",xlim=c(-3,3))
> title(main="Plot 1",xlab="x",ylab="y",line=16)
> screen(2)
> plot(x,cos(x),type="l",xlim=c(-3,3))
> title(main="Plot 2",xlab="x",ylab="y",line=16)
>
> close.screen(all = TRUE)
> dev.off()
>
>
> If cex.axis is lowered to 1, the problem disappears, but the tick and
> tick labels are way too small. I've spent a lot of time struggling
> with this, but can't find a way out.
>
> Thanks for your time.
>
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list