I have a forest plot (using metafor) whose number of rows will change depending on the input conditions. My code saves the plot after each run using:
dev.copy(png,'myplot.png')
dev.off()
Depending on the number of rows in the plot, the data can be squashed. Anymore than about 30 rows and the data becomes unreadable, see below examples. The first chart is readable, however the second chart is useless and it only gets worse as I want to include more data.
Is there a way to save the charts so that the height will automatically update to fit in the rows correctly? There is no specific need for the chart to be square, in fact I envisage that it will be rectangular to fit in the data. Chart code is included at the base of the question for reference.
forest(x = final$AvgPts, ci.lb = final$min, ci.ub = final$max, slab = final$Players,
ilab = final$value, ilab.xpos = max(final$max)+10,ilab.pos =4, alim = c(min(final$min)-5,
max(final$max)+5), xlim = c(min(final$min)-170, 2*(max(final$max)+5)),
xlab = "Moneyball Points Spread", efac = 1, cex = 0.75, mgp = c(1, 1, 0),
refline=mean(final$AvgPts),digits=1,col="dark blue",pch = 19,
main=paste("2016 Moneyball Summary (position =",pos,"and min average >",points,")"))