ggplot(z,aes(x=x,y=y))+
geom_point(shape=21,alpha=.5, size=6,fill=alpha("lightblue", 0.5),
colour="black")
Best,
Ista
> --
> 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
>
--
Ista Zahn
Graduate student
University of Rochester
Department of Clinical and Social Psychology
http://yourpsyche.org
Ista,
your style points are helpful, but I think this doesn't actually solve
Adrian's problem. Here's a slightly extended example.
cheers
Ben Bolker
set.seed(1001)
z <- data.frame(x=rnorm(50,10),y=rnorm(50,10),z=runif(50))
## this works fine, fill is set to a constant
ggplot(z,aes(x=x,y=y))+
geom_point(shape=21,alpha=.5, size=6,fill=alpha("lightblue", 0.5),
colour="black")
## this tries to map fill to a third variable, doesn't work
## -- no transparency
ggplot(z,aes(x=x,y=y,fill=z))+
geom_point(shape=21,alpha=.5, size=6, colour="black")
## this maps colour (for pch=16) to a third variable, works
## -- but no lines around the edges of the points as we would like.
ggplot(z,aes(x=x,y=y,colour=z))+
geom_point(shape=16,alpha=.5, size=6)
## another attempt to get around the problem by setting
## an explicit fill scale between two transparent colours
## fails.
ggplot(z,aes(x=x,y=y,fill=z))+
geom_point(shape=21,alpha=.5, size=6, colour="black")+
scale_fill_continuous(low=rgb(1,0,0,0.5),high=rgb(0,0,1,0.5))
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk3yRLEACgkQc5UpGjwzenN0KQCfZVllEkUVYrJ2mUfRBxO9xAzf
6W0AnjZZVDH5/E48EllxddYvWQZyok97
=OW6Z
-----END PGP SIGNATURE-----
ggplot(z,aes(x=x,y=y,fill=z))+
geom_point(shape=21, size=6, colour="black")+
scale_fill_manual(breaks = levels(z), values = c(alpha("red", 0.5),
alpha("blue", 0.5), alpha("green", 0.5), alpha("black", 0.5)))
This is not really nice because we have to convert to a factor first,
and is a bit verbose, but does produce the desired result.
Best,
Ista
--
z$z <- cut(z$z, 4)
ggplot(z,aes(x=x,y=y,fill=z))+
geom_point(shape=21, size=6, colour="black")+
scale_fill_manual(breaks = levels(z), values = c(alpha("red", 0.5),
alpha("blue", 0.5), alpha("green", 0.5), alpha("black", 0.5)))
-Ista