[Rd] Clipping (was Re: patch dendrogram.R from stats [was: Re: dendrogram plot does not draw long labels ?])

Tobias Verbeke tobias.verbeke at openanalytics.eu
Sun Jan 30 21:42:32 CET 2011

On 01/29/2011 11:59 PM, Prof Brian Ripley wrote:
> On Sat, 29 Jan 2011, Martin Maechler wrote:
>>>>>>> Tobias Verbeke <tobias.verbeke at openanalytics.eu>
>>>>>>> on Tue, 25 Jan 2011 21:27:41 +0100 writes:
>> > L.S.
>> > Please find below a patch for dendrogram.R (stats package)
>> > against revision r54107 which allows one to pass the xpd
>> > parameter as a component of the nodePar list (to be
>> > passed to plot.dendrogram).
>> > I hope I did not overlook anything.
>> Thank you, Tobias.
>> Note BTW, that on Linux I don't have your problems that the
>> label is "not drawn" when it does not fit.
>> For me, it just is clipped (to the figure region as you note),
>> so "chopped off" but the part inside the figure box is well
>> visible.
>> I was searching a bit and did not find mentioned on ?par or
>> ?clip that clipping happens device dependently,
>> but I vaguely recall to have seen it stated..
> Yes, it is device-dependent (but then most low-level things about
> graphics are, in particular everything about fonts).
> The designers of the graphics internals never documented their
> principles, but I retrospectively tried to do so in the R-ints manual.
> So whereas clipping of lines is done in the graphics engine, for text
> the manual says:
> If possible, the graphics device should handle clipping of text. It
> indicates this by the structure element 'canClip' which if true will
> result in calls to the callback 'clip' to set the clipping region. If
> this is not done, the engine will clip very crudely (by omitting any
> text that does not appear to be wholly inside the clipping region).
> I'll add a note to ?clip, but perhaps this can serve as a reminder that
> the R-ints manual is the place to look for low-level graphics details.

Many thanks, Prof Ripley and Martin, for your work
integrating the patch, documentation updates as well
as for the additional explanation putting the observed
behaviour in perspective.

Kind regards,
Tobias Verbeke

More information about the R-devel mailing list