Because you are plotting it once for each row it appears in.
Hadley
--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/
Yes, that's exactly what I want, Brandon. :-)
"Can you even do that?"
I don't know. Maybe one of the ggplot experts in here knows a solution.
Thanks for your suggestion to plot the names of the cities on the right side
(works perfect). But i would prefer them on the left side (see attachment:
created by a friend with illustrator)
The idea behind this attempt with transparent variables is this: for a
powerpoint presentation i want to show differences over some variables.
First, i show them all opaque. In a second step only the significant
differences stay opaque. The rest gets transparent (blends into the
background).
But if it's not possible with ggplot, i'm thinking about another solution to
mark the significant variables within the plot. Any suggestions?
Thanks
igreg
On Fri, Oct 15, 2010 at 5:39 PM, igreg <zoor...@gmx.net> wrote:
> „I think you're trying to apply an alpha transparency to axis text.“
>
> Yes, that's exactly what I want, Brandon. :-)
>
> "Can you even do that?"
>
> I don't know. Maybe one of the ggplot experts in here knows a solution.
Yes, you can do that. I don't know if this is supported, but it works for me:
## Prepare the plot
pl <- ggplot(d.frame, aes(x=city, y=mean.value,fill=variable,
alpha=trans))
pl <- pl + geom_bar(stat="identity",position = "dodge")
pl <- pl + geom_text(aes(label=((round(mean.value,
0)))),position=position_dodge(width=1), colour="black",
size=10,hjust=-0.3)
pl <- pl + coord_flip()
pl <- pl + scale_y_continuous("",limits=c(0,15))
## Set y axis text theme, including alpha level (manually).
pl + opts (axis.text.y = theme_text(size=20, hjust=1,
colour=alpha("black", c(.3, 1, 1))))
## Or, if you must set the alpha level according to d.frame$trans:
pl + opts (axis.text.y = theme_text(size=20, hjust=1,
colour=alpha("black", daply(d.frame, .(city), function(x)
as.numeric(as.character((unique(x$trans))))))))
>
> Thanks for your suggestion to plot the names of the cities on the right side
> (works perfect). But i would prefer them on the left side (see attachment:
> created by a friend with illustrator)
>
> The idea behind this attempt with transparent variables is this: for a
> powerpoint presentation i want to show differences over some variables.
> First, i show them all opaque. In a second step only the significant
> differences stay opaque. The rest gets transparent (blends into the
> background).
Cool idea. I like it.
>
> But if it's not possible with ggplot, i'm thinking about another solution to
> mark the significant variables within the plot. Any suggestions?
I think the solution above will work for you. Let me know how it turns out!
-Ista
--
Ista Zahn
Graduate student
University of Rochester
Department of Clinical and Social Psychology
http://yourpsyche.org
it works great.
You saved my weekend :-)
Thanks a lot!
On Monday I will adjust all my syntaxes..
Best. greg