[Rd] followup to graphics bug #414

Ben Bolker bolker@zoo.ufl.edu
Fri, 11 Feb 2000 08:58:39 -0500 (EST)


I have done a little bit of poking around at the bug that I reported
earlier (steep slopes and lines from far outside the plot range doing
funny things), and have tracked it down to the fact that, as noted in the
Unix man page, XDrawLine[s] doesn't like coordinates that are outside of
the range of (-32767,32767).

Now the question is, what to do about this?  A quick "fix" (not a fix but
at least an acknowledgement of the problem) would check coordinates in
GLine() and issue a warning instead of trying to draw anything if any of
the coordinates was outside the allowed range (would one have to add a
per-driver piece of information giving the min and max vals?).

I wrote a prototype of some clipping code in R that I could translate to C
and stick into src/unix/devX11.c right before every call to XDrawLine or
XDrawLines.  Before I go to that trouble, though: is there a better way to
do this?  Is there already clipping code lying around somewhere else in R?  
Is there a way to do this generically (perhaps by adding an outer clipping
region to every device at its device-coordinate limits) that would
centralize the code and not require it to be repeated for every
driver/line-drawing call?

 Any thoughts?  I'd really like to get this fixed ...

   Ben

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._