From simon.urbanek at r-project.org  Wed Jun  3 21:45:51 2009
From: simon.urbanek at r-project.org (Simon Urbanek)
Date: Wed, 3 Jun 2009 15:45:51 -0400
Subject: [Rd] Problems with plot and Quartz device / What is alpha?
In-Reply-To: <alpine.LRH.2.01.0906031154190.25094@homer23.u.washington.edu>
References: <20090603084513.662BD283200F@mail.pubhealth.ku.dk>
	<29342260-D4C4-481A-86D9-E64CAF127F4F@r-project.org>
	<alpine.LRH.2.01.0906031154190.25094@homer23.u.washington.edu>
Message-ID: <B809106D-57F8-4E68-8478-70DA6D88BCF1@r-project.org>


On Jun 3, 2009, at 15:00 , Thomas Richardson wrote:

> PS Please forgive my ignorance, but when you say:
>
>
>> BTW: you may want to use something like pch=19, cex=0.1 (and maybe  
>> add some alpha to get a quick density estimation).
>
> I don't know what alpha refers to here.
>

alpha = alpha component of the color (100% = opaque, 0% =  
transparent). Using alpha < 100% with pch=19 is a good way to get a  
rough density estimation in cases where points overlap since the  
overall opacity will increase with the number of overlapping points.

E.g., compare
plot(rnorm(1e5), rnorm(1e5), pch=19, cex=0.2)
to
plot(rnorm(1e5), rnorm(1e5), pch=19, col="#00000010", cex=0.2)

Varying the alpha will allow you to shift the focus from outliers to  
global patterns.

Cheers,
Simon


>
>>
>> Cheers,
>> S
>>
>>
>>> So I guess it might be related to the
>>> "special treatment" of "." described on help(points) ??
>>> ---
>>> Value pch="." (equivalently pch = 46) is handled specially. It is  
>>> a rectangle of
>>> side 0.01 inch (scaled by cex).
>>> ---
>>> I find this behaviour unnerving: the (resized) plots made it look  
>>> as if there
>>> was a lot of structure in the data, but on closer inspection it  
>>> turned out to be
>>> entirely a consequence of the quartz device and plot function!
>>> I can't imagine that this behaviour is intended - even if it were  
>>> intended to
>>> suppress points (like some axis labels) - it seems strange that  
>>> enlarging the
>>> window makes points disappear. (I also tried setting dpi=72 in  
>>> quartz(), but
>>> this did not fix the problem).
>>> Thanks in advance.
>>> Thomas
>>> ------------------------------------------------------
>>> sessionInfo()
>>> R version 2.9.0 (2009-04-17)
>>> i386-apple-darwin8.11.1
>>> locale:
>>> en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8
>>> attached base packages:
>>> [1] stats     graphics  grDevices utils     datasets  methods   base
>>> ______________________________________________
>>> R-devel at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>
>



[Rd] Problems with plot and Quartz device / What is alpha?
Simon Urbanek