On Thu, Aug 14, 2008 at 2:30 PM, Jason Pare <[EMAIL PROTECTED]> wrote: > Hello, > > I am searching for the best method to plot two variables with points > whose output color depends on the size of a third variable. For > example, the darkness of the x-y point would increase incrementally > based on the size of the z value, similar to the colramp parameter in > geneplotter. This would be analagous to symbols(), except changing the > selection from the color gradient rather than the size of the plotted > shape. The closest I have come so far is the levelplot() function, as > below: > > graphdata <- alldata[,c("x","y", "size")] > levelplot(size ~ x * y, data=graphdata) > > However, since I only have 147 total observations, the graph produced > by levelplot() is mostly white space. Is there either a function that > would produce this in a more visually digestible form, or a parameter > I can use with levelplot to accomplish this?
install.packages("ggplot2") library(ggplot2) qplot(x, y, data=graphdata, colour = size) qplot(x, y, data=graphdata, size = size) qplot(x, y, data=graphdata, full = size, geom="tile") Learn more at http://had.co.nz/ggplot2 Hadley -- http://had.co.nz/ ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.