I was using png() last week and also found it was very slow. But if you
try:
win.metafile('C:/temp/filename.png', width = 9, height = 10)
plot(rnorm(100))
dev.off()
It will speed up quite a lot. But one thing I don't understand is I always
get truncated graph (I lost a bit at the right end of the plot). I make up
a very long title for the graph and then I get an entire graph. I guess I must
miss something here.
Hope this helps.
Huan
Internet
schnitzlerj at gmx.de@stat.math.ethz.ch - 09/14/2003 12:43 AM
Sent by: r-help-bounces at stat.math.ethz.ch
To: r-help
cc:
Subject: [R] (no subject)
Dear all,
for an interactive web application i need to produce a lot of graphics (up
to 50) on demand.
In the moment i'm using the png format.
The png()
...using png(file="Rplot%03d.png", ...); 'plots' ;
dev.off()...
produces very good graphics. The problem is it takes too long to produce
the
png files.
The bitmap()
...using bitmap(file="Rplot%03d.png", type="type =
"png256",...); 'plots';
dev.off()...
works really fast. But on my system the quality is poor compared with png()
even with a higher resolution than 72.
I'm using R 1.7.0 on Windows NT ; Ghostscript 8.00
1) Is there a possibility to speed up the png()
or to improve the quality of the png produced by bitmap()
2) How is it possible to give "names" to the png files (if producing
more
than one plot) instead of Name+serial number like Rplot%03d.png
Any help would be appreciated
Johannes
schnitzlerj at gmx.de
______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
This message and any attachments (the "message") is\
intende...{{dropped}}
On Sun, 14 Sep 2003 huan.huang at bnpparibas.com wrote:> I was using png() last week and also found it was very slow. But if youIf it is `very slow', there is a problem with your hardware. On my very modest laptop> system.time({png();plot(rnorm(100));dev.off()})[1] 0.24 1.99 2.39 NA NA> system.time({bitmap("foo.png");plot(rnorm(100));dev.off()})[1] 1.18 4.31 6.42 NA NA so I am puzzled by the original claim, too.> try: > > win.metafile('C:/temp/filename.png', width = 9, height = 10) > plot(rnorm(100)) > dev.off() > > > It will speed up quite a lot. But one thing I don't understand is IIt will not be a png plot, though, so what is the point of that? You cannot open it in a real Web browser and I can only presume that you did not try to do so. -- Brian D. Ripley, ripley at 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 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595