[R] Plotting two distance matrices

Jari Oksanen jarioksa at sun3.oulu.fi
Wed Oct 10 13:29:55 CEST 2007

> I'm trying to plot two distance matrices against each other
> (74x74,phylogenetic distance and phenotypic distances). However R
> gives an error message:"Error in plot.new() : figure margins too
> large".
> Is it because I have too many points to plot?

No. It *sounds* like you don't have distance matrices but data frames of
distances, because this is the error message that you get. The default
plot of a data frame is a pairs() plot of all columns (variables)
against each other. You will have a data frame if you read in your
distances from an external file (or changed them into data frame). Try
changing your data sets into regular R dist objects, and plot these
against each other (and as.dist really seems to work to data frames

plot(as.dist(d1), as.dist(d2))

This was only guessing, since the message did not contain sufficient

cheers, jari oksanen

More information about the R-help mailing list