Clipping and (device)_Text

Guido Masarotto
Wed, 11 Nov 1998 18:56:48 +0100

I observed that my graphapp device (the one I used under Windows) behaves
in a different way from the X11 device when a text(...) command is issued.

My first example was using the Brian Ripley's tree package under Windows.
> data(iris)
> <- tree(Species~.,iris)
> plot(
> text(
I had a "setosa" on the left with only half of the first 's' and a virginica
on the right with only half of the 'a' shown.

Problem seems to be that in my device text(...) is clipped. Indeed
> plot(1:10)
> text(-0.5,3,"some dots.........................................",adj=c(0,0))
under Windows shows the string clipped
in the 'plotting region' (inside the rectangle of the plotted axes);
on the contrary, the full string is shown under Unix.

In a first moment, I though that the clipping region should be restored
to the full device every time a command is completed, i.e, in the
previous case after the plot(1:10). This works for  text(...)
commands but not for other drawing commands. 
For example, then I observed that
> plot(SomeData)
> lines(lowess(SomeData))
> abline(c(0,1))
gives problems (the `abline' line extends outside the 'plotting
region' -> clipping is supposed to be 'passed' from a drawing 
command to the next one; is this right?).

Next, since I found the following comments in devX11.c
       /* Device capabilities */
       /* Clipping is problematic for X11 */
       /* Graphics is clipped, text is not */  
       dd->dp.canClip = 1;        

I simple disabled clipping in (device)_Text(...).

Now, all seems ok; examples before, demo(graphics),....
But, in this way, (device)_Text never 'clips'.
Is this correct? Or I must reintroduce clipping in
(device)_Text and set dd->dp.canClip to a values different
from 1 to advise the graphics engine that my device
clip text, too?


r-devel mailing list -- Read
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: