2

I'm working on visualizing a matrix in R (almost exactly like http://reference.wolfram.com/mathematica/ref/MatrixPlot.html), and I've been using

image(<matrix>,axes=FALSE) 

to draw the picture. However, I noticed that with the y-axis turned off, the plot isn't centered--the space is still there for the axis ticks + label. I can finagle some centering with

par(oma=c(0,0,0,2.5))

but this seems inefficient and error-prone (if my matrix were to change dimensions/become non-square). Is there a better way to force the graphic to center? Reference image http://img694.imageshack.us/img694/9891/metropolis.png

The right hand margin is significantly smaller than the left.

4

1 回答 1

4

par(mar=c(5,2,4,2))+0.1

帮助?

于 2010-03-13T07:20:09.473 回答