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
> 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
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
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
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
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
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
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)
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)
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
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
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
> 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
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)) +
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
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
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
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:
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.
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
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
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
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
>
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
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
33 matches
Mail list logo