Simply:
x = c(1:10)
y = c(1:10)
z = (x%o%y) # a matrix
ts = list(x,y,z) # a list with matrix
names(ts) = c("x","y","z")
This gives a structure that is great for contour, but not so good for
ggplot (as far as I can tell).
Given a structure such as ts, is there a direct way to change it into a
data frame that can be consumed by ggplot and stat_contour? All my
friends are laughing at my nested loop.
Thanks,
Mark
something like this,
x = c(1:10)
y = c(1:100)
z = (x%o%y) # a matrix
d = with(melt(z), data.frame(x=x[X1],y=y[X2],z=value))
ggplot(d, aes(x, y, z = z)) + stat_contour()
HTH,
baptiste
> --
> You received this message because you are subscribed to the ggplot2 mailing
> list.
> Please provide a reproducible example: http://gist.github.com/270442
>
> To post: email ggp...@googlegroups.com
> To unsubscribe: email ggplot2+u...@googlegroups.com
> More options: http://groups.google.com/group/ggplot2
>
Mark