Skip to contents

Provides an example plot with defaults for a standard plot includes details of how to gnerate tiff, pdf, and png versions, mtext and legends. Currently no parameters, but the function is open to development for customization of the example plot.

Usage

setplot()

Value

prints lines of R that will define a standard plot and can be copied into an R script.

Examples

setplot()
#> #if (names(dev.cur()) %in% c("null device","RStudioGD")) 
#> #    dev.new(width=width,height=height,noRStudioGD = TRUE) 
#> #graphfile <- "name.tiff" OR "name.pdf" OR name.png  
#> #if (file.exists(graphfile)) file.remove(graphfile)  
#> #tiff(file=graphfile,width=150,height=150,units="mm",res=300,
#>       compression=c("lzw")) OR  
#> #pdf(file=graphfile,onefile=T,width=8,height=6,family="Times") OR 
#> #png(filename=graphfile,width=150,height=100,units="mm",res=300,
#>       family="Times") 
#> 
#> par(mfrow=c(1,1),mai=c(0.45,0.45,0.05,0.05),oma=c(0.0,0,0.0,0.0)) 
#> par(cex=0.85, mgp=c(1.35,0.35,0), font.axis=7,font=7,font.lab=7) 
#> ymax <- max(y,na.rm=T) * 1.05 
#> plot(x,y,type="l",xlab="",ylab="",col=1,ylim=c(0,ymax),yaxs="i",
#>       lwd=2) 
#> title(ylab=list("ylabel", cex=1.0, font=7),  
#>       xlab=list("xlabel", cex=1.0, font=7)) 
#> 
#> legend(0,0.45,c("True Mean","Precise","Imprecise"),col=c(4,1,2),
#>       lwd=3,bty="n",cex=1.0) 
#> mtext("label",side=2,outer=T,line=0.0,font=7,cex=1.0) 
#> 
#> #dev.off() 
#> #graphics.off()