tab3 <- prop.table(with(d, table(ContType, Block, Connective)), c(2,3))
farben=brewer.pal(n = 7, name = "Set2")
#svg("figures/percentage_continuation_types.png", width=10, height=5, bg="transparent")
#png("figures/percentage_continuation_types2.png", width=800, height=600, bg="transparent")
layout(m <- matrix(c(1,2,2,3,3), ncol=5, byrow = TRUE))
par(mar=rep(.5, 4), family="liberationserif")
plot(1,1, type="n", axes=F, ann=F)
legend("left", legend=levels(d$ContType),
fill=farben, bty="n", cex=1.5)
par(mar=c(4,5,3,2))
barplot(tab3[,,1], main="full stop", ylim=c(0,1), col=farben,
las=1, mar=2, ylab="Percentage of type of continuation",
cex.axis=1.3, cex.names=1.5, cex.lab=1.5, cex.main=1.6)
barplot(tab3[,,2], main="because (weil)", ylim=c(0,1), col=farben,
las=1, mar=2, ylab="Percentage of type of continuation",
cex.axis=1.3, cex.names=1.5, cex.lab=1.5, cex.main=1.6)
ggsave("percentage_continuation_types_gg.png",
plot = last_plot(), path ="/home/path/partially/obscured/figures/")
#dev.off()
#png("figures/percentage_continuation_types.png", width=785, height=346, bg="transparent")
svg("figures/percentage_continuation_types.png", width=10.5, height=4.8, bg="white")
layout(m <- matrix(c(1,2,2,3,3), ncol=5, byrow = TRUE))
par(mar=rep(.5, 4), family="liberationserif")
plot(1,1, type="n", axes=F, ann=F)
legend("left", legend=levels(d$ContType),
fill=farben, bty="n", cex=1.5)
par(mar=c(4,5,3,2))
barplot(tab3[,,1], main="full stop", ylim=c(0,1), col=farben,
las=1, mar=2, ylab="Percentage of type of continuation",
#cex.axis=1.7, cex.names=1.9, cex.lab=1.9, cex.main=2)
cex.axis=1.3, cex.names=1.5, cex.lab=1.5, cex.main=1.6)
barplot(tab3[,,2], main="because (weil)", ylim=c(0,1), col=farben,
las=1, mar=2, ylab="Percentage of type of continuation",
cex.axis=1.3, cex.names=1.5, cex.lab=1.5, cex.main=1.6)
#cex.axis=1.7, cex.names=1.9, cex.lab=1.9, cex.main=2)
dev.off()
where "/home/path/partially/obscured/figures/" is a valid path to a directory where all other files are saved as well.
I have noticed that the RStudio preview will not render text consistently. For example, in the attached image, the y-axis label on the left looks fine, whereas the one on the right looks blurry:
I am a little confused about the inner workings of the RStudio plot preview. I have searched far and wide online and I could find no settings or configurations that influence its behavior. I could not find anything on how to reproduce its exact behavior in code either. That being the state of things, I'm wondering: What is the point of even having the preview window?