[R] png problem

Clément Calenge calenge at biomserv.univ-lyon1.fr
Wed Sep 22 09:31:33 CEST 2004


Thanks for the fast reply.

Paul Murrell wrote:
>Clément Calenge wrote:
>>Dear R-users,
>>I have a small problem with the function png(), when used with the
>>argument colortype="pseudo.cube".
>>  > png("toto.png", colortype="pseudo.cube")
>>  > image(matrix(rnorm(10000), 100, 100))
>>  > dev.off()
>>R is blocked at the last command (R does not
>>print any prompt after the last command). Nothing is
>>written in the file (Gimp indicates that the file is corrupted).
>Did you wait long enough?  This example took a little while to complete 
>for me (may need someone more familiar with the code to tell us why it is 
>so slow).

You're right, it took 45 minutes for me.
However, since I need to use this code to build a Sweave vignette,
I cannot use it too often (I have about thirty files to create, this
would take about 20 hours to build the vignette !).
I also need the colortype argument (some graphics cards
do not allow the compilation of the vignette without).
Does anyone knows how to speed up the process ?


>>  > png("toto.png")
>>  > image(matrix(rnorm(10000), 100, 100))
>>  > dev.off()
>>works fine.
>>I tried:
>>  > options(X11colortype = "pseudo.cube")
>>  > png("toto.png")
>>  > image(matrix(rnorm(10000), 100, 100))
>>  > dev.off()
>>But, here again, R is blocked. I tried to replace dev.off() by
>>graphics.off(), but this does not resolve the problem.
>>The problem does not occurs when the function X11() is used
>>instead of the function png().
>>I searched through the mail archive, the FAQ, on google,
>>but I did not found any solution to this problem.
>>On the help page on the function png(),
>>it is indicated that "The colour handling will be that of the 'X11'
>>device in use".
>>I never used these functions before, but maybe png()
>>is not suitable with colortype="pseudo.cube" ?
>>Can you tell me where I have missed something ?
>>Thanks in Advance,
>>Clément Calenge.
>>  >version
>>           _
>>platform sparc-sun-solaris2.9
>>arch     sparc
>>os       solaris2.9
>>system   sparc, solaris2.9
>>major    1
>>minor    9.1
>>year     2004
>>month    06
>>day      21
>>language R
>>         [[alternative HTML version deleted]]
>>R-help at stat.math.ethz.ch mailing list
>>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>Dr Paul Murrell
>Department of Statistics
>The University of Auckland
>Private Bag 92019
>New Zealand
>64 9 3737599 x85392
>paul at stat.auckland.ac.nz

UMR CNRS 5558 - Equipe "Ecologie Statistique"
Laboratoire de Biométrie et Biologie Evolutive
Université Claude Bernard Lyon 1
43, Boulevard du 11 novembre 1918
69622 Villeurbanne Cedex
tel. (+33)
fax. (+33)

More information about the R-help mailing list