Skip to content
Back to formatted view

Raw Message

Message-ID: <80b45a8c0902111802t39ef333bv397e3235d3ae913a@mail.gmail.com>
Date: 2009-02-12T02:02:13Z
From: Remko Duursma
Subject: How to tell if lattice is current device?
In-Reply-To: <eb555e660902111611t449d75b3g4616142ecbf7a95e@mail.gmail.com>

Thanks for the tip. I did some reading on setHook, etc.. but I am
terribly confused. Do you (or someone else!) have a quick example of
what the call will look like?

thanks
remko


-------------------------------------------------
Remko Duursma
Post-Doctoral Fellow

Centre for Plant and Food Science
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753

Dept of Biological Science
Macquarie University
North Ryde NSW 2109
Australia

Mobile: +61 (0)422 096908



On Thu, Feb 12, 2009 at 11:11 AM, Deepayan Sarkar
<deepayan.sarkar at gmail.com> wrote:
> On Wed, Feb 11, 2009 at 3:40 PM, Remko Duursma <remkoduursma at gmail.com> wrote:
>> Dear R-helpers,
>>
>> I have a function that adds some segments to the current plot, but if
>> I the current plot is made with any of the lattice functions (in my
>> case, levelplot),
>> I should use lsegments rather than segments.
>>
>> How can I tell if the current device was made with plot() or e.g.
>> levelplot() or another lattice function?
>> dev.cur() does not help me, it just tells me "windows 2".
>
> A device can have both types, although that's rare.
>
> The best you can probably do is keep track of the last call to
> plot.new() and grid.newpage(). See
>
> ?setHook
> ?plot.new
> ?grid.newpage
>
> -Deepayan
>