Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Alpha value being applied to entire legend
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Joran  
View profile  
 More options Jun 4 2010, 5:58 pm
From: Joran <joran.el...@gmail.com>
Date: Fri, 4 Jun 2010 14:58:40 -0700 (PDT)
Local: Fri, Jun 4 2010 5:58 pm
Subject: Alpha value being applied to entire legend
I've posted about a related issue before, which I was able to resolve
kind of, but it's popped up again with a slightly different graph.

I just want to know if I'm specifying the graph wrong, or what,
because this seems like really weird behavior:

test_data <-
data.frame(x=rnorm(100),y=rnorm(100),cat1=factor(rep(c(1,2),times=c(50,50)) ),cat2=rnorm(100))
ggplot(test_data,aes(x=x,y=y)) +
geom_point(aes(colour=cat1,size=cat2),alpha=1/2)

versus

ggplot(test_data,aes(x=x,y=y)) +
geom_point(aes(colour=cat1,size=cat2))

In the first version, the alpha value is clearly being applied to the
_entire_ legend, even the size scale.  Am I placing the alpha
parameter in the wrong place?

Is there no way to force the alpha parameter to be applied only to the
data points themselves, not the legend?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Connolly  
View profile  
 More options Jun 5 2010, 2:28 pm
From: Mark Connolly <mark_conno...@acm.org>
Date: Sat, 05 Jun 2010 14:28:00 -0400
Subject: Re: Alpha value being applied to entire legend
Would you be defeating the intent of the legend as a reflection of the
plot?  The behavior seems expected rather than weird to me.

I _think_ that the only way to do this is with grids and viewports.  You
could capture a legend of  a plot without alpha set, create an
appropriately dimensioned grid, print a plot (with alpha set and without
a legend) to a viewport, print the captured legend to another viewport
on the grid.  Maybe a better way will show up in the responses.

Mark

On 06/04/2010 05:58 PM, Joran wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joran  
View profile  
 More options Jun 10 2010, 4:45 pm
From: Joran <joran.el...@gmail.com>
Date: Thu, 10 Jun 2010 13:45:51 -0700 (PDT)
Local: Thurs, Jun 10 2010 4:45 pm
Subject: Re: Alpha value being applied to entire legend
Sorry for disappearing...I've been busy...

On Jun 5, 11:28 am, Mark Connolly <mark_conno...@acm.org> wrote:

> Would you be defeating the intent of the legend as a reflection of the
> plot?  The behavior seems expected rather than weird to me.

Generally, I'd agree.  I think I could make a strong case, though,
that alpha blending is an exception and should _never_ be applied to
the legend.  The legend should display the color I've chosen, not 1/20
(or whatever) of the color I've chosen.  I can't imagine a situation
where I'd actually want very dim, faintly colored items in my legend.
Additionally, you'll notice in the example code I gave, the alpha
blending is applied even to the size scale, which has nothing to do
with the colors scale being used.  Why dim every single symbol in the
legend?  That just makes no sense to me, but I'm certainly open to
correction...

I suppose one option would be to actually add an entirely new legend
scale every time you use alpha blending that shows the depth of color
changes as items are overplotted, and this would be separate from any
color scale, which would be displayed with the "true" colors.

But in any case, at least I think your answer confirms that there is
no (easy) way to do what I want, at least at the moment...

Thanks,

Joran


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hadley Wickham  
View profile  
 More options Jun 11 2010, 10:38 am
From: Hadley Wickham <had...@rice.edu>
Date: Fri, 11 Jun 2010 09:38:41 -0500
Local: Fri, Jun 11 2010 10:38 am
Subject: Re: Alpha value being applied to entire legend

> Generally, I'd agree.  I think I could make a strong case, though,
> that alpha blending is an exception and should _never_ be applied to
> the legend.  The legend should display the color I've chosen, not 1/20
> (or whatever) of the color I've chosen.  I can't imagine a situation
> where I'd actually want very dim, faintly colored items in my legend.
> Additionally, you'll notice in the example code I gave, the alpha
> blending is applied even to the size scale, which has nothing to do
> with the colors scale being used.  Why dim every single symbol in the
> legend?  That just makes no sense to me, but I'm certainly open to
> correction...

The underlying principle of the legends is to make them appear as
similar as possible as the glyphs that actually occur on the plot.  I
agree with you that this isn't always what you want for alpha
blending, but I'm not willing to make a special case for a single
aesthetic.  What legends really need is some way to override the
defaults so that you can supply the other aesthetics yourself.  I've
added a ticket to that affect:
http://github.com/hadley/ggplot2/issues/issue/109

Hadley

--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »