Re: [R] contourLines() starts a plot device

From: Paul Murrell <>
Date: Tue 21 Jun 2005 - 12:08:07 EST


Barry Rowlingson wrote:
> Pierre Kleiber wrote:

>> I want to use contourLines() to get contour line coordinate vectors, 
>> but I don't want to make a plot.  However contourLines() insists on
>> opening a graphics device.  Is there a way tell it not to do this?

> contourLines() calls .Internal(contourLines(...)), and that calls
> do_contourlines in plot3d.c, and that gets the current graphics device,
> hence activating one if there isn't one (I think), and passes it to
> GEcontourLines... which then seems to do nothing with it at all.
> I just removed 'dd' from the call to GEcontourLines and the arg list to
> GEcontourLines, fixed GraphicsEngine.h to match, recompiled, and now my
> contourLines() function doesn't try to make a new graphics window. I
> can't see GEcontourLines being called from anywhere else, but there may
> be code that calls it, so possibly a better idea may be to pass a NULL
> to it from GEcontourLines to keep the API the same.

Thanks for the diagnosis and suggested fix! This change has now been made in the development version of R.


> There are some comments scattered around the code about how
> contourLines shouldnt really be a graphics function, so I'm guessing
> there's some thought going into this already by the developers.
> Another possible quick fix for unix systems may be to start a
> PostScript graphics device with file="/dev/null" so that the graphics
> output disappears into thin air.
> Baz
> ______________________________________________
> mailing list
> PLEASE do read the posting guide!

Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
New Zealand
64 9 3737599 x85392

______________________________________________ mailing list
PLEASE do read the posting guide!
Received on Tue Jun 21 12:14:36 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:54 EST