Re: [R] clip to keep coordinate system?

From: Thomas Lumley <tlumley_at_u.washington.edu>
Date: Wed 10 Aug 2005 - 00:49:36 EST

On Tue, 9 Aug 2005 ivo_welch-rstat8303@mailblocks.com wrote:

>
> dear R wizards:
>
> plot( 1, 1, ylim=(2,10), xlim=(2,10), type="n");
> rect( -1, -1, 12, 12, col=gray(0.99) );
>
> unfortunately wipes out the border axes around the plot. how do I keep
> this?

I think you meant

   plot( 1, 1, ylim=c(2,10), xlim=c(2,10), type="n")    rect( -1, -1, 12, 12, col=gray(0.99) ) Your code has two syntax errors and two spurious semicolons.

The border axes are gone because you have drawn on top of them.

On the quartz() and pdf() devices you could draw the rectangle in a partially transparent color rather than solid light grey.

More generally, you can redraw the border axes with box()

         -thomas



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Aug 10 00:53:00 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:39:45 EST