Skip to content

clip to keep coordinate system?

4 messages · Thomas Lumley, ivo_welch-rstat8303@mailblocks.com, Jan T. Kim

#
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?

regards,

/ivo
#
On Tue, 9 Aug 2005 ivo_welch-rstat8303 at mailblocks.com wrote:

            
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
#
Dear wizards:

despite my omission of the c() on the limits, a kind soul sent me the 
answer: a par(new=T) will make the next plot() redraw nicely.

a help question for  R-2.1.0:  help.search("transparent")  gives
"No help files found with alias or concept or title matching 
'transparent' using fuzzy matching."
but "?par" has the word transparent in the color specification section 
(though an example of usage would make this one much clearer, too).  
shouldn't help.search() look through the build-in docs, too?

sincerely, /iaw

---
ivo welch
4 days later
#
On Tue, Aug 09, 2005 at 07:49:36AM -0700, Thomas Lumley wrote:
What's wrong with the semicolons? Technically, they're not necessary,
but they definitely improve readability without doing any harm.

Best regards, Jan