Hi All, Have spent the last couple of days learning R and shell scripting to do batch plotting jobs. I have had success getting R to complete a filled contour plot and output to a file (.jpg or .tiff etc). However, when I try to do the same thing with the simple plot command the script seems to execute correctly yet there is no output. Below is my R code: file <- Sys.getenv("input_file") tiff(paste( file, "tiff", sep=".")) z <- read.table(file) plot(z, type="l", xlim=range(0.6,2), col = "red", plot.title = title(main file, xlab = "Wavelength (um)", ylab = "Intensity (arb.)) q() The data file is simply 2 columns of real numbers. The system it is running on is a linux box from the command line, but does have the Xlibrarys and can clearly write tiff's as it managed it with the filled contours. Bear in mind I only started with both linux and R a couple of days ago, so be gentle if it is something silly! Cheers, Kenny -- View this message in context: http://www.nabble.com/Issues-getting-R-to-write-image-files-tp23977785p23977785.html Sent from the R help mailing list archive at Nabble.com.
Has tried to close the image file at the end? Do: dev.off() Hope it helps mario Kenny Larsen wrote:> Hi All, > > Have spent the last couple of days learning R and shell scripting to do > batch plotting jobs. I have had success getting R to complete a filled > contour plot and output to a file (.jpg or .tiff etc). However, when I try > to do the same thing with the simple plot command the script seems to > execute correctly yet there is no output. Below is my R code: > > file <- Sys.getenv("input_file") > tiff(paste( file, "tiff", sep=".")) > z <- read.table(file) > plot(z, type="l", xlim=range(0.6,2), col = "red", plot.title = title(main > file, xlab = "Wavelength (um)", ylab = "Intensity (arb.)) > q() > > The data file is simply 2 columns of real numbers. The system it is running > on is a linux box from the command line, but does have the Xlibrarys and can > clearly write tiff's as it managed it with the filled contours. > > Bear in mind I only started with both linux and R a couple of days ago, so > be gentle if it is something silly! > > Cheers, > > Kenny > >-- Ing. Mario Valle Data Analysis and Visualization Group | http://www.cscs.ch/~mvalle Swiss National Supercomputing Centre (CSCS) | Tel: +41 (91) 610.82.60 v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax: +41 (91) 610.82.82
Hi Kenny,> Have spent the last couple of days learning R and shell scripting to do > batch plotting jobs. I have had success getting R to complete a filled > contour plot and output to a file (.jpg or .tiff etc). However, when I try > to do the same thing with the simple plot command the script seems to > execute correctly yet there is no output. Below is my R code: > > file <- Sys.getenv("input_file") > tiff(paste( file, "tiff", sep=".")) > z <- read.table(file) > plot(z, type="l", xlim=range(0.6,2), col = "red", plot.title = title(main > file, xlab = "Wavelength (um)", ylab = "Intensity (arb.))dev.off()> q()You need to close the tiff graphics device you opened using dev.off() before quitting. HTH, Tobias