is it possible to display plots in an emacs buffer?

Damon Wischik djw1005 at cam.ac.uk
Mon May 24 14:18:48 CEST 2004


I've been reading this thread with interest. I thought I'd chip in with my
own experiences.

I used to use Mathematica, before I came to R. Mathematica has a strange
mixture of the elegant and the foul. One thing I liked very much is its
"mathematical document" idea: a document which intersperses input and
output. You type in a command, position your cursor on the text, press
Shift+Enter, and it executes the command. The result of execution is
inserted below. If you edit the command and execute it again, the new
result replaces the old result.

Where it comes into its own is with graphics. Mathematica generates
postscript graphics, and inserts them into the flow of text. You can
reload the document later, and see the graphics without having to redo the
calculation. You can also resize the graphics.

In this way, the "mathematical document" is half-way between a program and
a write-up; and I find it very pleasant to use. I am not keen on the big
distinction we have now between textual output and graphical output.  (In
fact, Mathematica also allows sound and animation output to be embedded in
the document.) 

Now I've switched to R, which is way better at statistics and at handling
data, but I still miss the Mathematica interface. I set up the shift+enter
behaviour by adding this to my .emacs
  (global-set-key [(shift return)] 'ess-eval-paragraph)

It seems to me that it ought to be possible (after some long, hard,
cunning programming) to generate a graphic in R, to turn it into SVG, to
export the SVG as text, to load the SVG into a graphical editor with a
clever SVG-plugin, and to have the editor display the graphic. 

This is way beyond my own skills, and presumably it's not going to be
possible in Emacs (at least for a very long time). I think it might be
possible to take over the Mathematica interface, though -- Mathematica
have a system called MathTalk which enables communication with other
processes -- and I plan to have a go at programming this.

I wonder if anyone else enjoys this style of working, or if anyone else
knows of any systems which permit it.

Damon.




More information about the ESS-help mailing list