Hello, Is there a simple way to make a plot with xy coordinates and a z value which determines the size and the color of point on the plot? Thanks for your help ! Emilie -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Levivier Emilie <Emilie.Levivier at lmcp.jussieu.fr> writes:> Hello, > > Is there a simple way to make a plot with xy coordinates and a z value > which determines the size and the color of point on the plot?Color, yes. Try plot(1:10,col=1:10), or something with gray(), etc. Size, no. But this will work in 0.90. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Levivier Emilie wrote:> Hello, > > Is there a simple way to make a plot with xy coordinates and a z value > which determines the size and the color of point on the plot?This is pretty basic, but may be helpful:> test<-c(2,6,4,7,5,6,8,3,7,2) > plot(test,type="n",main="Color/size test plot",ylab="Size scale",xlab="Colorscale")> colsiz<-function (yvec) {ymin <- min(yvec) cexdiv <- max(yvec)/2 for (i in 1:length(yvec)) { nextcex <- (yvec[i] - ymin)/cexdiv + 1 par(cex = nextcex) points(i, yvec[i], type = "p", col = i) } }> colsiz(test)Note that the size here ranges from 1->2. You can change that by fiddling with the calculation of 'cexdiv'. Oops, I just realized that I used the x and y values to determine the color and size, but that may be what you wanted anyway... Jim -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Wed, 17 Nov 1999, Levivier Emilie wrote:> Hello, > > Is there a simple way to make a plot with xy coordinates and a z value > which determines the size and the color of point on the plot? > >In package sgeostat, there is a plot() for point objects: Plot the spatial locations in a point object, optionally coloring by quantile. If this isn't quite what you need, it will give you an idea about how to get there. Roger Bivand Department of Geography, Norwegian School of Economics and Business Administration, Breiviksveien 40, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93 e-mail: Roger.Bivand at nhh.no -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._