R-alpha: line types

Ben Bolker Ben Bolker <ben@eno.Princeton.EDU>
Tue, 29 Jul 1997 21:54:34 -0400 (EDT)


  Responding to my own post, after some hacking:

  To fix the behavior of the following test code (the rect()s inherit the
lty set by the previous abline())--

x _ (1:100)/10
plot(x,sin(x))
abline(h=0,lty=2,col="red")
rect(1,0,2,0.5)
abline(v=2)
rect(3,0,4,0.5)

Here are some diffs (now all I have to do is wade through and get lwd
working properly ...)

*** devX11.c.orig	Tue Jul 29 16:44:19 1997
--- devX11.c	Tue Jul 29 16:57:55 1997
***************
*** 671,676 ****
--- 671,677 ----
  	}
  	if (fg != NA_INTEGER) {
  		SetColor(fg);
+ 		SetLinetype(GP->lty);
  		XDrawRectangle(display, window, wgc, (int)x0, (int)y0,
  			(int)x1 - (int)x0, (int)y1 - (int)y0);
  	}
*** devPS.c.orig	Sun Jul  6 21:29:03 1997
--- devPS.c	Tue Jul 29 17:01:05 1997
***************
*** 433,438 ****
--- 433,439 ----
  	}
  	if(fg != NA_INTEGER) {
  		SetColor(fg);
+ 		SetLinetype(GP->lty);
  		PostScriptOpenRectangle(psfp, x0, y0, x1, y1);
  	}
  }
*** plot.c.orig	Tue Jul 29 16:43:34 1997
--- plot.c	Tue Jul 29 16:51:02 1997
***************
*** 875,880 ****
--- 875,883 ----
  
  	GSavePars();
  
+ 	if(nlty && INTEGER(lty)[i % nlty] != NA_INTEGER) GP->lty = INTEGER(lty)[i % nlty];
+ 	else GP->lty = DP->lty;
+ 
  	xl = REAL(sxl);
  	xr = REAL(sxr);
  	yb = REAL(syb);


Benjamin Bolker          Dep't of Ecology and Evolutionary Biology,
ben@eno.princeton.edu    Princeton University
tel: (609) 258-6886,     fax: (609) 258-1334


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-