Determine furthest points on an ellipsoid for charting purposes

#1
Hi,

I'm trying to plot an ellipsoid chart with the code below :

Code:
library(cluster)
x <- rnorm(150)
y <- rnorm(150) + 2*x + 10)
xy <- unname(cbind(x, y)
exy <- ellipsoidhull(xy)

maxx <- max(xy[,1])*3
maxy <- max(xy[,2])*3
minx <- min(xy[,1])/3
miny <- min(xy[,2])/3


plot(xy,  col="blue", xlab="Page Views", ylab="Conversions", main = "Performance Report", type='n', xlim=c(minx,maxx),ylim=c(miny,maxy))
# type = 'n' for no plots
# type = 'p' for points

lines(predict(exy), col="blue")
points(rbind(exy$loc), col = "blue", cex = 2, pch = 13)
I need to zoom out to ensure the whole ellipsoid is shown. I'm doing this crudely at the minute with :

Code:
maxx <- max(xy[,1])*3
maxy <- max(xy[,2])*3
minx <- min(xy[,1])/3
miny <- min(xy[,2])/3
And then using these values to set the scale.

It would be better if I could determine the scale based on the outside edges of the ellipsoid along the X & Y axis.

I can get the shape matrix from the ellipsoidhull but not sure how to translate this to scale for the chart. Any ideas?
 
#2
I figured this out myself.

Using :
Code:
temp = predict(exy)

maxx <- max(temp[,1])
maxy <- max(temp[,2])
minx <- min(temp[,1])
miny <- min(temp[,2])
 
#4
Apologies Dason, I didn't put an alert on that post hence missed your answer.

I also needed to plot another series hence when setting the scale I need to check multiple objects for min/max. I ended up doing this with IF's to check the minimum and maximum across both series. This is overly complicated by the fact each series is found in 2 different source files. In time I'll learn to refactor my code and data to best suit the processing but for now I'm just getting my head around R.

I didn't mention this earlier as I'm trying to learn things on my own and I don't expect fourum members to write the whole solution for me.

I like your suggestion to use Range. This will come in very handy for future plots.

Thanks.