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
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
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
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
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_
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
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
> 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
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
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
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(
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
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
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
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
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
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
> 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
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
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
20 matches
Mail list logo