From Thomas Lumley <thomas@biostat.washington.edu>  Thu Jul  3 17:28:58 1997
From: Thomas Lumley <thomas@biostat.washington.edu> (Thomas Lumley)
Date: Thu, 3 Jul 1997 09:28:58 -0700 (PDT)
Subject: R-alpha: plot(  pch = <character> ) is slow.. -- why ? --
In-Reply-To: <199707031554.RAA04752@sophie.ethz.ch>
Message-ID: <Pine.SUN.3.95.970703091049.5412B-100000@chekov>

On Thu, 3 Jul 1997, Martin Maechler wrote:

> # (The following is using  x11() and an  Ultrasparc I.
> # You should decrease from '20000' if you have a slower machine):
> 
> > x <- runif(20000)
> 
> > for(i in 1:10) print(unix.time(plot(x)))
> [1] 1.66 0.04 3.00 0.00 0.00
> > for(i in 1:10) print(unix.time(plot(x, pch='-')))
> [1]  4.76  3.25 21.00  0.00  0.00
> 
> Why is x11 much faster in drawing pch=1 (a circle), than a simple "-" ?
> Is this X11's `fault' ?

Same thing on a Pentium Pro running Linux and displaying on a Sparcstation
10.  

It looks like X11's fault: the graphics code directly calls the X11
functions in each case, however S-PLUS does not have this slowdown.  I
would have thought the explanation was that "-" requires plotting text and
the circle is just graphics, however the square (pch=0) which is also a
simple graphic is just as slow.

Thomas Lumley
------------------------------------------------------+------
Biostatistics		: "Never attribute to malice what  :
Uni of Washington	:  can be adequately explained by  :
Box 357232		:  incompetence" - Hanlon's Razor  :
Seattle WA 98195-7232	:				   :
------------------------------------------------------------


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


R-alpha: plot( pch = <character> ) is slow.. -- why ? --
Thomas Lumley