Re: [R] ggplot2: legend for geom_rug() ..?

2012-08-15 Thread Hadley Wickham
On Thu, Jun 7, 2012 at 9:30 AM, Tim Smith wrote: > Hi, > > Here is the corrected code: > > library(ggplot2) > ids <- paste('id_',1:3,sep='') > before <- sample(9) > after <- sample(1:10,9) > dat <- as.matrix(cbind(before,after)) > rownames(dat) <- rep(ids,3) > position <- c(rep(10,3),rep(13,3),rep

Re: [R] ggplot2: legend

2012-07-04 Thread John Kane
I played around with this for a while with no success at all. I'd suggest posting the question on the ggplot2 newsgroup in Google Groups John Kane Kingston ON Canada > -Original Message- > From: thorn.tha...@rdls.nestle.com > Sent: Tue, 3 Jul 2012 18:50:52 +0200 > To: r-help@r-project.o

Re: [R] ggplot2: legend

2012-07-04 Thread Petr PIKAL
Hi I do not have direct answer. You shall probably search ggplot2 web. Searching "legend" gave me about sixty results from which you probably could learn how to modify legend(s) according to your wish. e.g. http://had.co.nz/ggplot2/docs/opts.html Regards Petr > > Dear all, > > I produced th

Re: [R] ggplot2: legend for geom_rug() ..?

2012-06-07 Thread Tim Smith
  geom_rug(subset = .(position > 14),aes(y=NULL),color="black") Alternatively, how do I add a second legend in ggplot2? thanks! ____ From: John Kane To: Brian Smith ; r-help@r-project.org Sent: Wednesday, June 6, 2012 3:06 PM Subject: Re: [R] g

Re: [R] ggplot2: legend for geom_rug() ..?

2012-06-07 Thread John Kane
From: tim_smith_...@yahoo.com Sent: Thu, 7 Jun 2012 07:30:08 -0700 (PDT) To: jrkrid...@inbox.com, bsmith030...@gmail.com, r-help@r-project.org Subject: Re: [R] ggplot2: legend for geom_rug() ..? Hi, Here is the corrected code: library(ggplot2) ids <- paste('id_

Re: [R] ggplot2: legend for geom_rug() ..?

2012-06-06 Thread John Kane
What is X2? code not running at the moment John Kane Kingston ON Canada > -Original Message- > From: bsmith030...@gmail.com > Sent: Wed, 6 Jun 2012 11:52:25 -0400 > To: r-help@r-project.org > Subject: [R] ggplot2: legend for geom_rug() ..? > > Hi, > > I was trying to make another le

Re: [R] ggplot2: Legend title

2012-04-20 Thread Brian Diggs
On 4/20/2012 12:11 PM, Bush, Daniel P. DPI wrote: I'm designing a set of plots intended for a general audience; here's the code for one of them, using the latest version of ggplot: plot.enr.all<- ggplot(data=df1, aes(x=HS_GRAD_YEAR, y=Percentage, group=Enrolled_by, col

Re: [R] ggplot2 legend text....a basic question

2009-09-14 Thread Charlotte Wickham
> a) How to change the text  in the legend (for example, "number" instead of > "n"). Use: scale_size("number") > b) How to avoid having a  legend for the polygon? Don't include the value for alpha inside aes (you want to set it as opposed to mapping it). So, ggplot(mydata, aes(x, y)) + geom_poi

Re: [R] ggplot2 legend problem

2009-08-19 Thread Chris Friedl
ven body of > data. > ~ John Tukey > > -Oorspronkelijk bericht- > Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > Namens hadley wickham > Verzonden: woensdag 19 augustus 2009 14:18 > Aan: Chris Friedl > CC: r-help@r-project.org > Onderwerp

Re: [R] ggplot2 legend problem

2009-08-19 Thread ONKELINX, Thierry
erzonden: woensdag 19 augustus 2009 14:18 Aan: Chris Friedl CC: r-help@r-project.org Onderwerp: Re: [R] ggplot2 legend problem On Tue, Aug 18, 2009 at 11:10 PM, Chris Friedl wrote: > > Still struggling with this. A further example using a slightly > different organisation of the data. The

Re: [R] ggplot2 legend problem

2009-08-19 Thread hadley wickham
On Tue, Aug 18, 2009 at 11:10 PM, Chris Friedl wrote: > > Still struggling with this. A further example using a slightly different > organisation of the data. The factors "A" and "B" are included in the > dataframe in an attempt to get ggplot to generate a legend automatically. > > x <- data.frame(

Re: [R] ggplot2 legend problem - SOLVED

2009-08-18 Thread Chris Friedl
Trawling the online and pdf manuals for density plots further I found a reference to position and tried it with histograms. It worked! So here is an example that gives me overlapping histograms, alpha transparency so they can both be seen in the area of overlap, and with properly labelled and col

Re: [R] ggplot2 legend problem

2009-08-18 Thread Chris Friedl
Still struggling with this. A further example using a slightly different organisation of the data. The factors "A" and "B" are included in the dataframe in an attempt to get ggplot to generate a legend automatically. x <- data.frame(value=rnorm(5000, mean=0), case="A") y <- data.frame(value=rnorm

Re: [R] ggplot2 legend

2009-05-28 Thread Felipe Carrillo
Thanks for your help Mike, it works like a charm now!! --- On Thu, 5/28/09, Mike Lawrence wrote: > From: Mike Lawrence > Subject: Re: [R] ggplot2 legend > To: "Felipe Carrillo" > Cc: r-h...@stat.math.ethz.ch > Date: Thursday, May 28, 2009, 1:06 PM > First, your e

Re: [R] ggplot2 legend

2009-05-28 Thread Mike Lawrence
First, your example didn't work because fish_ByMuestreo didn't build properly (deleting the first "structure(list(data = " bit solves this). To solve your plotting problem, note that as constructed, the Muestreo column is numeric, whereas you seem to want to treat it as a factor. Solution: convert

Re: [R] ggplot2 legend for vertical lines

2008-07-03 Thread hadley wickham
Hi Baptiste, I've fixed this problem in the development version and you can work around it in the cran version as follows: ggplot(dfr, aes(fact2, values)) + geom_point(aes(colour = fact)) + geom_vline(intercept = 5) (i.e. make sure the vline never sees that colour has been mapped to an aesthetic

Re: [R] ggplot2 - legend for fill coulours

2008-04-01 Thread Pedro de Barros
Hadley, Thanks a lot! BTW, do you have any document explaining the object philosophy of ggplot? I was trying to see how you defined scale_fill_identity, but could not find it... Cheers, Pedro At 19:50 2008/04/01, hadley wickham wrote: > > However, it looks this works only when the data are in

Re: [R] ggplot2 - legend for fill coulours

2008-04-01 Thread hadley wickham
> However, it looks this works only when the data are in the sequence > of the levels in the factor defining the fill colours. When the > sequence is different, the legend gets "scrambled", in that the order > of the colours does not match the labels. You can fix this by explicitly specifying

Re: [R] ggplot2 - legend for fill coulours

2008-03-25 Thread Pedro de Barros
Dear Thierry, Thanks, it worked. I though the algorithm behind the plotting uses some approach like unique(), so that the order of the plot is that of the first occurrence of each code, but I could not get into the code to modify this. Anyway, Hadley has already gently volunteered to look into

Re: [R] ggplot2 - legend for fill coulours

2008-03-25 Thread ONKELINX, Thierry
Dear Pedro, Sorting your data before plotting it will probably sort your problem. plotdata2 <- plotdata2[order(plotdata2$group), ] HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research I