qplot(..., size=0.5): get rid of the 0.5 in the legend

54 views
Skip to first unread message

Agustin Lobo

unread,
Mar 30, 2011, 7:05:10 AM3/30/11
to ggp...@googlegroups.com
In
qplot(runif(100),runif(100),colour=c(rep(1,50),rep(2,50)),size=0.5)

I get a "0.5 " field in the legend, which makes sense if size is a
variable, but does not if size is fixed.
How can I manage to do not get that size in the legend?

Thanks

Agus

Scott Chamberlain

unread,
Mar 30, 2011, 7:51:55 AM3/30/11
to Agusti...@ija.csic.es, ggp...@googlegroups.com
Maybe this

qplot(runif(100),runif(100),colour=c(rep(1,50),rep(2,50)),size=0.5) + scale_size("size")

S
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: http://gist.github.com/270442

To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2

Dennis Murphy

unread,
Mar 30, 2011, 7:59:05 AM3/30/11
to Agusti...@ija.csic.es, Agustin Lobo, ggp...@googlegroups.com
Hi:

An alternative to Scott's solution is

qplot(runif(100),runif(100),colour=c(rep(1,50),rep(2,50)),size=I(0.5))

HTH,
Dennis

kahsay gebremariam

unread,
Mar 31, 2011, 3:20:24 AM3/31/11
to Dennis Murphy, Agusti...@ija.csic.es, Agustin Lobo, ggp...@googlegroups.com
Hi 

try this 

qplot(runif(100),runif(100),colour=c(rep(1,50),rep(2,50))) +geom_xx(size=0.5)


qplot(runif(100),runif(100),colour=c(rep(1,50),rep(2,50)))+geom_point(size=5)

Reply all
Reply to author
Forward
0 new messages