Skip to content

Commit

Permalink
Figures in pdf.
Browse files Browse the repository at this point in the history
  • Loading branch information
micing committed Jul 24, 2018
1 parent 862cdfe commit b730d81
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 4 deletions.
8 changes: 6 additions & 2 deletions figure1.R
Expand Up @@ -26,8 +26,10 @@ plotit <- function(m=c(.3, .4, .525, .80), density=dBetam, shape, ylab="", xlab=

}

pdf(file = "pdf/figure1.pdf", width = 6, height = 6)

op <- par(no.readonly = TRUE)
par(mfcol=c(3,2), mar=c(5, 5.5, 2, 1), cex=.8)
par(mfcol=c(3,2), mar=c(5, 5.5, 2, 1), cex=.6)

plotit(shape=1, density=dBetam, xlab="Statistical power", ylab="density", main="S=1")
plotit(shape=1/2, density=dBetam, xlab="Statistical power", ylab="density", main="S=1/2")
Expand All @@ -36,5 +38,7 @@ plotit(shape=1, density=dbimodal1090, xlab="Statistical power", ylab="density",
plotit(shape=2, density=dbimodal1090, xlab="Statistical power", ylab="density", main="S=2 (10/90)")
plotit(shape=1, density=dbimodal0595, xlab="Statistical power", ylab="density", main="S=1 (05/95)")

dev.copy(device = jpeg, filename = 'jpeg/figure1.jpg', quality=100, width = 700, height = 700)
#dev.copy(device = jpeg, filename = 'jpeg/figure1.jpg', quality=100, width = 700, height = 700)
par(op)
dev.off()

4 changes: 3 additions & 1 deletion figure2.R
Expand Up @@ -40,6 +40,8 @@ plotit <- function(d, est, ylim=c(0,1), log="x", legpos="topleft", xlab="", ylab
}

d=data$range

pdf(file = "pdf/figure2.pdf", width = 6, height = 6)
op <- par(no.readonly = TRUE)
par(mfrow=c(2,2), mar=c(5, 5.5, 2, 1), cex=.6)

Expand All @@ -65,5 +67,5 @@ plotit(d, "bias", legpos="bottomleft", ylim=c(1,250), log="xy",

par(op)

dev.copy(device = jpeg, filename = 'jpeg/figure2.jpg', quality=100, res=300, unit="mm", width = 150, height = 150)
#dev.copy(device = jpeg, filename = 'jpeg/figure2.jpg', quality=100, res=300, unit="mm", width = 150, height = 150)
dev.off()
3 changes: 2 additions & 1 deletion figure3.R
Expand Up @@ -54,6 +54,7 @@ CIs = c(.95, .75, .50)
Rs=sort(c(35/97, fv(CIs)))
d=data$rep

pdf(file = "pdf/figure3.pdf", width = 6, height = 6)
op <- par(no.readonly = TRUE)
par(mfrow=c(2,2), mar=c(5, 5.5, 2, 1), cex=.6)

Expand All @@ -79,5 +80,5 @@ plotit(d, "bias", CIs, Rs, legpos="bottomleft", ylim=c(1,300), log="xy",

par(op)

dev.copy(device = jpeg, filename = 'jpeg/figure3.jpg', quality=100, res=300, unit="mm", width = 150, height = 150)
#dev.copy(device = jpeg, filename = 'jpeg/figure3.jpg', quality=100, res=300, unit="mm", width = 150, height = 150)
dev.off()
Binary file added pdf/figure1.pdf
Binary file not shown.
Binary file added pdf/figure2.pdf
Binary file not shown.
Binary file added pdf/figure3.pdf
Binary file not shown.

0 comments on commit b730d81

Please sign in to comment.