I have an R package I am working on that returns output from a Metropolis-Hastings sampler. The output consists of, among other things, matrices where the columns are the variables and the rows are the samples from the posterior. I convert these into coda
mcmc
objects with this code:
colnames(results$beta) = x$data$Pops
results$beta = mcmc(results$beta, thin = thin)
where thin
is 183 and beta
is a 21 x 15 matrix (this is a toy example). The mcmc.summary
method works fine, but the plot.mcmc
gives me:
Error in plot.new() : figure margins too large
I have done a bit of debugging. All the values are finite, there are no NA
's, the limits of the axes seem to be being set okay, and there are enough panels (2 plots each with 4 rows and 2 columns) I think. Is there something I am missing in the coercion into the mcmc
object?
Package source and all associated files can be found on http://github.com/jmcurran/rbayesfst. A script which will produce the error quickly is in the unexported function mytest
, so you'll need
rbayesfst:::mytest()
to get it to run.
There has been suggestion that this has been answered already in this question, but I would like to point out that it is not me setting any of the par
values, but plot.mcmc
so my question is not about par
or plot
but what (if anything) I am doing wrong in making a matrix into an mcmc
object that cannot be plotted by plot.mcmc
It can't be the size of the matrix, because I have had examples with many more dimensions directly from rjags
that worked fine.