codebox
codebox copied to clipboard
table.graph.r does not work with par(mfrow=c(1,2)) multi-graph-display
I am trying to display two table graphs side by side using par(mfrow=c(1,2)). However, the result displays only one graph, on the left side.
I've also tried to add , mfrow=c(1,2) to the first or both calls to table.graph(), but to no avail.
It would be convenient if table.graph honored mfrow, or offered another way to support side-by-side plots.
This plot make heavy use of par and margin to fit all the text. par(mfrow=c(1,2)) will not work properly. You can use split.screen like so:
source('table.graph.r')
def.par <- par(no.readonly = TRUE)
split.screen(c(1,2))
table.graph(WorldPhones[,1:2], label.cex=0.7, title.cex=1.2, mar=c(5, 5, 1, 5))
par(def.par)
screen(2)
table.graph(WorldPhones[,1:2], label.cex=0.7, title.cex=1.2, mar=c(5, 5, 1, 5))
example: http://imgur.com/a/CQZjL