I need help creating a bubbleplot, like a simple pseudo three dimensional scatterplot of circles whose sizes index a 3rd variable. I initially came across this at http://addictedtor.free.fr/graphiques/graphcode.php?graph=73 but the circleplot function does not exist in fbasic as listed in the document. _________________________________________________________________ 50F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008 [[alternative HTML version deleted]]
?symbols use the argument "circles" On Sat, Sep 13, 2008 at 11:35 AM, Wen Gu <edwardg22486 at hotmail.com> wrote:> > I need help creating a bubbleplot, like a simple pseudo three dimensional scatterplot of circles whose sizes index a 3rd variable. I initially came across this at http://addictedtor.free.fr/graphiques/graphcode.php?graph=73 but the circleplot function does not exist in fbasic as listed in the document. >-- Yihui Xie <xieyihui at gmail.com> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of China, Beijing, 100872, China
Hi: On Sep 12, 2008, at 8:35 PM, Wen Gu wrote:> > I need help creating a bubbleplot, like a simple pseudo three > dimensional scatterplot of circles whose sizes index a 3rd > variable. I initially came across this at http://addictedtor.free.fr/graphiques/graphcode.php?graph=73 > but the circleplot function does not exist in fbasic as listed in > the document. >I believe it is part of Rmetrics, see http://www.rmetrics.org/docs/DocRefcard.pdf HTH, -Roy ********************** "The contents of this message do not reflect any position of the U.S. Government or NOAA." ********************** Roy Mendelssohn Supervisory Operations Research Analyst NOAA/NMFS Environmental Research Division Southwest Fisheries Science Center 1352 Lighthouse Avenue Pacific Grove, CA 93950-2097 e-mail: Roy.Mendelssohn at noaa.gov (Note new e-mail address) voice: (831)-648-9029 fax: (831)-648-8440 www: http://www.pfeg.noaa.gov/ "Old age and treachery will overcome youth and skill." "From those who have been given much, much will be expected"
The function symbols() is in the package 'graphics', so you don't need any add-on packages. For example: # similar code to the example you mentioned set.seed(1) symbols(x = rnorm(50), y = rnorm(50), circles = abs(rnorm(50)), main = "Circles Plot") Yihui On Sat, Sep 13, 2008 at 11:48 AM, Wen Gu <edwardg22486 at hotmail.com> wrote:> I apologize, I don't quite follow, as I am pretty new at this. Can you give > me an example of the code you suggest? Does your suggestions still use the > fbasic package? > >> Date: Sat, 13 Sep 2008 11:45:02 +0800 >> From: xieyihui at gmail.com >> To: edwardg22486 at hotmail.com >> Subject: Re: [R] bubble(circle) plot help. >> CC: r-help at r-project.org >> >> ?symbols >> >> use the argument "circles" >> >> On Sat, Sep 13, 2008 at 11:35 AM, Wen Gu <edwardg22486 at hotmail.com> wrote: >> > >> > I need help creating a bubbleplot, like a simple pseudo three >> > dimensional scatterplot of circles whose sizes index a 3rd variable. I >> > initially came across this at >> > http://addictedtor.free.fr/graphiques/graphcode.php?graph=73 but the >> > circleplot function does not exist in fbasic as listed in the document. >> > >> >> >> -- >> Yihui Xie <xieyihui at gmail.com> >> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 >> Mobile: +86-15810805877 >> Homepage: http://www.yihui.name >> School of Statistics, Room 1037, Mingde Main Building, >> Renmin University of China, Beijing, 100872, China >-- Yihui Xie <xieyihui at gmail.com> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of China, Beijing, 100872, China
I don't quite understand your R code (I think your random numbers make the graph very hard to read!), but I have also written an example for the interaction effect: ## 400 bubbles to show the interaction of x and z sq = seq(0, 10, length = 20) x = rep(sq, 20) z = rep(sq, each = 20) y = c(outer(sq, sq, function(x, z) 10 + 1 * x + 0.5 * z + 0.5 * x * z + runif(1))) symbols(x, z, y, bg = rgb(1, 0, 0, 0.1), fg = "yellow") ## observe the bubbles from the x-axis or y-axis Regards, Yihui -- Yihui Xie <xieyihui at gmail.com> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of China, Beijing, 100872, China On Thu, Sep 18, 2008 at 11:18 AM, Wen Gu <edwardg22486 at hotmail.com> wrote:> hey, you suggestion worked great last time. I was able to create a graph > through simulation. However, now I am having trouble manipulating the > simulated effects of the graph. The code I attached has simulated data > values for all 3 values, and is plotting a graph showing an interaction with > all 3 variables. I am trying to create extreme effects by having the circle > size increase, with increased X value, while holding the other variable > somewhat constant (and then do the other). Yet, when I try to change the > mean of these values, the scales merely adjusts to account for the increased > means. > >> Date: Sat, 13 Sep 2008 11:58:28 +0800 >> From: xieyihui at gmail.com >> To: edwardg22486 at hotmail.com >> Subject: Re: [R] bubble(circle) plot help. >> CC: r-help at r-project.org >> >> The function symbols() is in the package 'graphics', so you don't need >> any add-on packages. >> >> For example: >> >> # similar code to the example you mentioned >> set.seed(1) >> symbols(x = rnorm(50), y = rnorm(50), circles = abs(rnorm(50)), >> main = 'Circles Plot') >> >> Yihui >>