Re: [R] Suppressing internal grid in filled.contour
Martin Maechler stat.math.ethz.ch> writes: > Yes, indeed, PDFs *are* fine Apologies to the original poster, I was not aware of this. Dieter __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Suppressing internal grid in filled.contour
> "JG" == Jonathan Greenberg <[EMAIL PROTECTED]> > on Wed, 29 Oct 2008 11:40:08 -0700 writes: JG> Ok, I've placed the input files and the PDF on a website (I apologize JG> for attaching the PDF -- the readme guide for this listserv indicated JG> that PDFs were fine): Yes, indeed, PDFs *are* fine (and I don't know exactly what Dieter's problem was with it; he was right that you should include self-contained code). Martin Maechler, ETH Zurich __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Suppressing internal grid in filled.contour
Jonathan Greenberg ucdavis.edu> writes: > > Ok, I've placed the input files and the PDF on a website > http://www.cstars.ucdavis.edu/~jongreen/temp/ > This an aliasing problem that disappears partially when using higher resolution, as noted in the quoted # http://finzi.psych.upenn.edu/R/Rhelp02a/archive/90744.html of my first message (did you check it?). Dieter library(akima) # Providing data on the net as you did is fine, but you can make # life easier by directly providing the file url urlt = url("http://www.cstars.ucdavis.edu/~jongreen/temp/tahoedata02.csv";) tahoecontourdata<-read.csv(urlt,header=TRUE) x=tahoecontourdata$Elevation_Bin y=tahoecontourdata$PRR z=tahoecontourdata$MaxStems # For easier reading, don't put too much into one expression, # but split it steps = 600 # fine grid intp = interp(x,y,z,duplicate="strip", xo=seq(1800,3200,length=steps), yo=seq(120,280,length=steps)) col=grey.colors(33,start=0,end=1,gamma=1) pdf("tahoe.pdf") # even at this resolution, the pdf picture has ugly kinks filled.contour(intp,col=col, nlevels=33,zlim=0:650) dev.off() # This was the workaround in # http://finzi.psych.upenn.edu/R/Rhelp02a/archive/90744.html pdf("tahoe1.pdf") image(intp$x,intp$y,intp$z,col=col) dev.off() # or use lattice (but needs some additional massaging) gr = expand.grid(x=intp$x,y=intp$y) gr$z= as.vector(intp$z) gr = na.omit(gr) library(lattice) pdf("tahoe2.pdf") p = contourplot(z~x+y,data=gr,region=TRUE) print(p) dev.off() __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Suppressing internal grid in filled.contour
Ok, I've placed the input files and the PDF on a website (I apologize for attaching the PDF -- the readme guide for this listserv indicated that PDFs were fine): http://www.cstars.ucdavis.edu/~jongreen/temp/ The full suite of commands I used are: tahoecontourdata<-read.csv("tahoedata02.csv",header=TRUE) x=tahoecontourdata$Elevation_Bin y=tahoecontourdata$PRR z=tahoecontourdata$MaxStems tahoelinedata<-read.csv("tahoelines02.csv",header=TRUE) xline=tahoelinedata$Elevation yline=tahoelinedata$PRR filled.contour(interp(x,y,z,duplicate="strip",xo=seq(1800,3200,length=57),yo=seq(120,280,length=65)),col=grey.colors(33,start=0,end=1,gamma=1),nlevels=33,zlim=0:650,plot.axes={axis(1);axis(2);points(xline,yline,type="l")}) As you can see in the PDF, there is a faint internal grid that I can't seem to disable. Thanks again! --j Dieter Menne wrote: Jonathan Greenberg ucdavis.edu> writes: ..faint internal grid when running the following command to make a filled contour plot of some data I have (x,y,z being the inputs): filled.contour(interp(x,y,z,duplicate="strip", xo=seq(1800,3200,length=57), yo=seq(120,280,length=65)), col=grey.colors(33,start=0,end=1,gamma=1),nlevels=33,zlim=0:650, plot.axes={axis(1);axis(2);points(xline,yline,type="l")}) The output is attached to this email via pdf -- I'm using R 2.8.0 on MacOS X. Thanks for any help you all can give me! Please do not send attachments, most people cannot see this. Instead, better use self-running code, including simulated data. The above line does not run (probably because of bad formatting?) For a similar case, check http://finzi.psych.upenn.edu/R/Rhelp02a/archive/90744.html Dieter __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Jonathan A. Greenberg, PhD Postdoctoral Scholar Center for Spatial Technologies and Remote Sensing (CSTARS) University of California, Davis One Shields Avenue The Barn, Room 250N Davis, CA 95616 Cell: 415-794-5043 AIM: jgrn307, MSN: [EMAIL PROTECTED], Gchat: jgrn307 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Suppressing internal grid in filled.contour
Jonathan Greenberg ucdavis.edu> writes: > ..faint internal grid when running the following command to make a > filled contour plot of some data I have (x,y,z being the inputs): > > filled.contour(interp(x,y,z,duplicate="strip", xo=seq(1800,3200,length=57), yo=seq(120,280,length=65)), col=grey.colors(33,start=0,end=1,gamma=1),nlevels=33,zlim=0:650, plot.axes={axis(1);axis(2);points(xline,yline,type="l")}) > > The output is attached to this email via pdf -- I'm using R 2.8.0 on > MacOS X. Thanks for any help you all can give me! > Please do not send attachments, most people cannot see this. Instead, better use self-running code, including simulated data. The above line does not run (probably because of bad formatting?) For a similar case, check http://finzi.psych.upenn.edu/R/Rhelp02a/archive/90744.html Dieter __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.