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
> To: r-help@r-project.org > Subject: [R] ggplot2: legend > > Dear all, > > I produced the following graph with ggplot which is almost fine, yet I > don't like that the legend for "Means" and "Observations" includes a > line, though no line is used in the

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

[R] ggplot2: legend

2012-07-03 Thread Thaler,Thorn,LAUSANNE,Applied Mathematics
Dear all, I produced the following graph with ggplot which is almost fine, yet I don't like that the legend for "Means" and "Observations" includes a line, though no line is used in the plot for those two (the line for "Overall Mean" on the other hand is wanted): library(ggplot2) ddf <- data.f

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

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

2012-06-06 Thread Brian Smith
Hi, I was trying to make another legend for the rug plot. Sample code: library(ggplo2) 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(19,3)) mdat <- cbind(melt(dat

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

[R] ggplot2: Legend title

2012-04-20 Thread Bush, Daniel P. DPI
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, color=Enrolled_by, shape=Enrolled_by, fill=Enrolled_by)

[R] ggplot2 legend how?

2010-04-30 Thread Giovanni Azua
Hello, I have just ordered the "ggplot2: Elegant Graphics for Data Analysis (Use R)" but while it arrives :) can anyone please show me how to setup and add a simple legend to a ggplot? This is my use case, I need a legend showing CI "Classic", "Own bootstrap", "R bootstrap": library(ggplot2)

Re: [R] R ggplot2 legend text left justify

2010-02-09 Thread Paul Sutcliffe
Thanks hadley wickham wrote: Hi Paul, That's a bug in the current version of ggplot. I'm working on update for later this week. Hadley On Mon, Feb 8, 2010 at 5:56 PM, Paul Sutcliffe wrote: In ggplot2 how do you justify the legend text ? In the example below the opts(legend.text = them

Re: [R] R ggplot2 legend text left justify

2010-02-09 Thread hadley wickham
Hi Paul, That's a bug in the current version of ggplot. I'm working on update for later this week. Hadley On Mon, Feb 8, 2010 at 5:56 PM, Paul Sutcliffe wrote: > > > In ggplot2 how do you justify the legend text ? > In the example below the opts(legend.text = theme_text(size = 9,hjust=0)) >  c

[R] R ggplot2 legend text left justify

2010-02-08 Thread Paul Sutcliffe
In ggplot2 how do you justify the legend text ? In the example below the opts(legend.text = theme_text(size = 9,hjust=0)) changes the size of the text OK but it remains right justified. > mydata=data.frame(RowID=c("A","B","C"),Name=c("long long long long long name","short name ","medium m

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

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

2009-09-14 Thread Julian Burgos
Hello fellow R's, I´ve been learning to use the ggplot2 library, and after a full day of work I still have a couple of basic questions. Here is an example: mydata=data.frame(x=runif(20),y=runif(20),n=runif(20)) mydata2=data.frame(x=c(0.4,0.6,0.5),y=c(0.4,0.4,0.6)) ggplot(mydata, aes(x, y)) +

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

[R] ggplot2 legend problem

2009-08-18 Thread Chris Friedl
I'm trying to overlay two histograms using transparency to enable viewing of multiple distributions on a single scale. So far ggplot2 seems to do what I want. However I'm having a problem generating the legend coloring appropriate to each distribution in the plot. Here is a test case to show my b

[R] ggplot2-legend overlaps with strip

2009-06-02 Thread Felipe Carrillo
Hi: See the attached pdf graphic. The legend overlaps a little bit with the strip. Is there a way to move it over a half a cm? Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA Europe.pdf Description: Adobe PD

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

[R] ggplot2 legend

2009-05-28 Thread Felipe Carrillo
Hi: I need some help with the legend. I got 14 samples(Muestreo) and I am trying to plot a smooth line for each sample. I am able to accomplish that but the problem is that the legend only displays every other sample. How can I force the legend to show all of my Muestreos? Thanks in advance.

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

[R] ggplot2 legend for vertical lines

2008-07-03 Thread baptiste Auguié
Dear all, The following example code produces a graph with ggplot2, to which I add several vertical lines of arbitrary colors. I am not satisfied with the legend: it automatically adds some vertical lines which I'd rather not see (they confuse the reader rather than add information in th

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
cted from a given body of >data. >~ John Tukey > >-Oorspronkelijk bericht- >Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] >Namens Pedro de Barros >Verzonden: zondag 23 maart 2008 13:02 >Aan: [EMAIL PROTECTED] >Onderwerp: [R] ggplot2 - legend for fill coulours >

Re: [R] ggplot2 - legend for fill coulours

2008-03-25 Thread ONKELINX, Thierry
be extracted from a given body of data. ~ John Tukey -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Pedro de Barros Verzonden: zondag 23 maart 2008 13:02 Aan: [EMAIL PROTECTED] Onderwerp: [R] ggplot2 - legend for fill coulours Urgentie: Hoog Dear All, I

[R] ggplot2 - legend for fill coulours

2008-03-23 Thread Pedro de Barros
Dear All, I am trying to build a stacked bar plot, where I define the colours to use. I have asked this before, and I was using a solution in http://thread.gmane.org/gmane.comp.lang.r.general/100649/focus=100673 (thanks, Thierry). However, it looks this works only when the data are in the sequ