|
|
|
|
|
|
|
|
rm(list = ls(all = TRUE)) |
|
|
|
|
|
|
|
|
|
|
|
count <- as.matrix(c(1547, 54, 2346)) |
|
|
|
|
|
|
|
|
perc <- sapply(count, function (x) x/sum(count)) |
|
|
|
|
|
|
|
|
cum_perc <- cumsum(perc) |
|
|
|
|
|
|
|
|
power_x <- c(0, rep(.74, 2), 0) |
|
|
both_x <- c(.74, rep(.96, 2), .74) |
|
|
weap_x <- c(.96, rep(1, 2), .96) |
|
|
|
|
|
|
|
|
plot_y <- c(2.25, 2.25, 3, 3) |
|
|
|
|
|
|
|
|
setEPS() |
|
|
postscript("fgc1.eps", width = 10, height = 3) |
|
|
|
|
|
|
|
|
par(mar = c(0, 6, 6, 1)) |
|
|
|
|
|
|
|
|
plot(1, type = "n", xlab = "", ylab = "", xlim = c(0, 1), ylim = c(1.5, 3), axes = FALSE) |
|
|
|
|
|
|
|
|
polygon(power_x, plot_y, col = "#FF8F37", border = "white") |
|
|
polygon(both_x, plot_y, col = "steelblue3", border = "white") |
|
|
polygon(weap_x, plot_y, col = "gray", border = "white") |
|
|
|
|
|
|
|
|
axis(side = 3, at = seq(0, 1, .1), labels = FALSE) |
|
|
text(x = seq(0, 1, .2), y = par("usr")[4] + .2, labels = c("0%", "20%", "40%", "60%", "80%", "100%"), xpd = TRUE) |
|
|
mtext(text = "Proportion of Responses", side = 3, line = 2.5, cex = 1.25, font = 2) |
|
|
|
|
|
|
|
|
text(x = .74/2, y = 2.2, pos = 1, cex = 2, labels = "74%", col = "#FF8F37", font = 2) |
|
|
text(x = .85, y = 2.2, pos = 1, cex = 2, labels = "22%", col = "steelblue3", font = 2) |
|
|
text(x = .98, y = 2.2, labels = "4%", pos = 1, cex = 2, col = "grey", font = 2, xpd = TRUE) |
|
|
|
|
|
|
|
|
leg = legend(x = -.16,, y = 2.625, legend = c("Oppose", "Support", "Prefer not\nto answer"), xpd = TRUE, |
|
|
pch = 16, col = c("#FF8F37", "steelblue3", "grey"), box.lty = 0, cex = .9, y.intersp = 1.5, yjust = .5) |
|
|
|
|
|
|
|
|
dev.off() |
|
|
|