From ripley@stats.ox.ac.uk  Wed Feb  7 18:45:02 2001
From: ripley@stats.ox.ac.uk (Prof Brian D Ripley)
Date: Wed, 7 Feb 2001 18:45:02 +0000 (GMT)
Subject: [Rd] Re: Writing graphics code (was: [R] get vector data from
 contour)
In-Reply-To: <qf238t4ps6bht9tvkblvfnof8a7oe106o0@4ax.com>
Message-ID: <Pine.GSO.4.31.0102071828220.14134-100000@auk.stats>

On Wed, 7 Feb 2001, Duncan Murdoch wrote:

> I submitted a message to r-help this morning that really belongs in
> r-devel; here's its URL in the archive:
> <http://www.r-project.org/nocvs/mail/r-help/2001/0693.html>.
>
> In summary, I suggest that R graphics objects should be accessible and
> modifiable, but it raises some problems if you want to do it without
> pointers.

Duncan,

I saw your post, and Ross's.   As I understand it, in R there is a
separation between computing and drawing, but it is at a higher level than
the original question wanted.  That's not to say I am very sure of this!

Normally, R maintains a display list, that is a list of high-level
description of graphics calls.  The idea is that list can be replayed
to refresh the display as needed (especially if it is resized), but the
idea has been taken further, for example to copy plots by replaying
on another device.  Further, individual plots can be saved and replayed,
first by menus on Guido's Windows display driver, and later from R
functions.

Now, I don't understand the display list in detail, but I know we have had
problems with statefulness.  There is also a lower-level separation, the
set of calls made to the graphics driver, more akin to Windows GDI calls.
One of my motivations for writing a PDF driver (there is one in R-devel
now) was to allow editing of graphical output at object level.
Unfortunately, this is not to be as the graphics driver interface is too
low-level, for plotmath at the level of a single character, for example.

I suspect that the ideal is somewhere in between the display list and the
graphics driver level, and that probably PDF is about right.  Someone in
Apple clearly thinks so given the fuss being made about MacOSX graphics.

I am not sure this helps you much.  It is one example of an issue that is
beginning to come up in several places:  is it better to re-design and
re-implement, or to try to maintain what we have?

On the actual issue of extracting contours, then I think if you
turn labelling off and use a device like XFig, it is quite easy to pull out
the contours as vectors.

Some background thoughts, I hope of some use.

Brian

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

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


[Rd] Re: Writing graphics code (was: [R] get vector data from contour)
Prof Brian D Ripley