tags:

views:

212

answers:

1

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

The right hand margin is significantly smaller than the left.

+4  A: 

Does

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

help?

Karsten W.
That does it! I see now that the mar default = c(5,4,4,2)+0.1 "lines", do the axis labels typically occupy exactly 2 lines?
ConnorG
I think one line for the label of the variable and one line for the labeling of the tick marks
Karsten W.