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

2012-08-15 Thread Hadley Wickham
On Thu, Jun 7, 2012 at 9:30 AM, Tim Smith tim_smith_...@yahoo.com 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 -

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 the

Re: [R] ggplot2: legend

2012-07-04 Thread John Kane
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 plot for those two (the line for Overall Mean on the other hand is wanted

[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.frame(x

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

2012-06-07 Thread John Kane
) 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_',1:3,sep='') before - sample(9) after - sample(1:10,9) dat - as.matrix(cbind(before

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

2012-06-07 Thread Tim Smith
in ggplot2? thanks! From: John Kane jrkrid...@inbox.com To: Brian Smith bsmith030...@gmail.com; r-help@r-project.org Sent: Wednesday, June 6, 2012 3:06 PM Subject: Re: [R] ggplot2: legend for geom_rug() ..? What is X2? code not running at the moment John Kane

[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 -

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 legend

[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,

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,

[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) e - 1

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 psutc...@it.uts.edu.au wrote: In ggplot2 how do you justify the legend text ? In the example below the opts(legend.text = theme_text(size

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 psutc...@it.uts.edu.au wrote: In ggplot2 how do you justify the legend text ? In the example below the

[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 medium

[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 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)) +

Re: [R] ggplot2 legend problem

2009-08-19 Thread hadley wickham
On Tue, Aug 18, 2009 at 11:10 PM, Chris Friedlcfrieda...@gmail.com 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 -

Re: [R] ggplot2 legend problem

2009-08-19 Thread ONKELINX, Thierry
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 Friedlcfrieda...@gmail.com wrote: Still struggling with this. A further example using a slightly different organisation of the data. The factors A and B

Re: [R] ggplot2 legend problem

2009-08-19 Thread Chris Friedl
: Chris Friedl CC: r-help@r-project.org Onderwerp: Re: [R] ggplot2 legend problem On Tue, Aug 18, 2009 at 11:10 PM, Chris Friedlcfrieda...@gmail.com wrote: Still struggling with this. A further example using a slightly different organisation of the data. The factors A and B are included

[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

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(5000,

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

[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

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

2009-05-28 Thread Felipe Carrillo
Thanks for your help Mike, it works like a charm now!! --- On Thu, 5/28/09, Mike Lawrence mike.lawre...@dal.ca wrote: From: Mike Lawrence mike.lawre...@dal.ca Subject: Re: [R] ggplot2 legend To: Felipe Carrillo mazatlanmex...@yahoo.com Cc: r-h...@stat.math.ethz.ch Date: Thursday, May 28

[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

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

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 the

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-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 am

Re: [R] ggplot2 - legend for fill coulours

2008-03-25 Thread Pedro de Barros
Barros Verzonden: zondag 23 maart 2008 13:02 Aan: [EMAIL PROTECTED] Onderwerp: [R] ggplot2 - legend for fill coulours Urgentie: Hoog 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

[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