Re: [Rd] text(1:10, col=NA) is printed in color 1 instead of color 0 (was "is not transparent")

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Tue, 21 Feb 2012 00:14:53 +0000

The documentation is out of date (and contradictory for cex). Nowadays NULL and NA for col and font correspond to the par() values, and for cex correspond to 1.0.

So it is in fact _plotted_ in par("col"), which by default is 1.

On 20/02/2012 18:16, Peter Ruckdeschel wrote:
> Am 20.02.2012 15:22, schrieb Kasper Daniel Hansen:
>> Peter,
>>
>> not all devices support transparency. My guess is that you are
>> plotting to a device which does not, but it is hard to know from your
>> email.
>>
>> Kasper
>>
>
> In the meantime Kasper and I had some mail exchange offline.
>
> @Kasper: thanks again for your explanations and hopefully it is oK
> for you if I put this clarifying online
>
> It seems my original subject was a bit misleading, as I am not
> really interested in achieving transparency (which I know is
> system-dependent) but rather in the behavior, that
>
> text(<some input>, col = NA)
>
> should not do anything --- or, more useful, if you have vectorized input
> and col is vectorized, too, the NA-coordinates are not printed (as is
> what I read from the help page to par() ).
>
> The non-printing behavior is achievable already with 0 color values, and
> with named color "transparent", but not for NA-values.
>
> This effect seems to be device independent, at least I have checked it
> for the windows, pdf, and jpeg devices under Windows and in the default
> graphics device under Linux.
>
> Any suggestions welcome,
> Peter
>
>> On Mon, Feb 20, 2012 at 6:09 AM, Peter Ruckdeschel
>> <peter.ruckdeschel_at_itwm.fraunhofer.de> wrote:
>>> Maybe I am missing something, but according to the help page
>>> to par (section "Color Specification"), which is referred to in the
>>> help to text argument col:
>>>
>>> ‘"transparent"’ or (integer) ‘NA’ is _transparent_,
>>> useful for filled areas (such as the background!), and just
>>> invisible for things like lines or text.
>>>
>>> but:
>>>
>>> col0<- as.integer(NA)
>>> is.integer(col0)
>>> ### is this coercing to "integer" necessary?
>>> plot(1:10)
>>> text(1:10, col=col0)
>>> ### text is plotted
>>>
>>> ##whereas
>>> plot(1:10)
>>> text(1:10, col="transparent")
>>> ### text is not plotted
>>>
>>> # Of course, this is not terribly urgent, as a color value of 0 also
>>> plot(1:10)
>>> text(1:10, col=0)
>>> ### text is not plotted
>>>
>>> Best, Peter
>>>
>>> ______________________________________________
>>> R-devel_at_r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>
> ______________________________________________
> R-devel_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
Brian D. Ripley,                  ripley_at_stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Tue 21 Feb 2012 - 00:17:20 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 21 Feb 2012 - 13:10:19 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive