Skip to content

[FORGED] Re: draw stripes in a circle in R

2 messages · jean-philippe, Jim Lemon

#
Envoy? depuis mon appareil Samsung

-------- Message d'origine --------
De : Rolf Turner <r.turner at auckland.ac.nz> 
Date : 14/06/2017  22:53  (GMT+01:00) 
? : David Winsemius <dwinsemius at comcast.net> 
Cc : r-help at r-project.org 
Objet : Re: [R] [FORGED] Re:&nbsp; draw stripes in a circle in R
On 15/06/17 05:29, David Winsemius wrote:
This is just idle curiosity, since I'm not really able to contribute 
anything useful, but I can't resist asking:? When I try to run the OP's 
code I get an error:
Sorry for the lack of precision, alpha is just to add some transparency to the color. This alpha parameter ranges from 0 fully transparent to 1, full color.I don't remember having loaded any package to use this function, I think it is there in base R.
Why does this (apparently) not happen to anyone else?? Why does the 
universe pick on *me*?? What is the function "alpha()"?? Where is it to 
be found?

Searching on "alpha" is of course completely unproductive; there are far 
too many (totally irrelevant) instances.

cheers,

Rolf
#
Hi Jean-Phillipe,
Thanks for the plug on plotrix. Because of that I will suggest a gross
hack that will do almost what you want:

# your code down to draw.circle
segments(c(-12.7,-12.7),c(-11.2,-10.6),c(-12,-12),
 c(-10.75,-10.15),col="white",lwd=28)
draw.circle(-12.85,-10.9,0.85,nv=1000,border=NULL,
col=NA,lty=1,lwd=1)
box()
dev.off()

Your problem is that plotrix is written in base graphics, which is
simple to understand, but does not support layered graphics. Thus I
have to do the striping over the yellow circle and avoid overwriting
the big red stripe. You should do this using the grid graphic system,
but that would take too large a chunk of my morning to write an
example for you.

To Rolf - It happened to me as well, but because I saw Venus smiling
at me in the sky this morning I was granted the knowledge that it was
a function that had not been properly introduced to us and simply
replaced it with "red". Such are the benefits of evidence-based
astrology.

Jim


On Thu, Jun 15, 2017 at 8:04 AM, jeanphilippe.fontaine
<jeanphilippe.fontaine at gssi.infn.it> wrote: