[R] symbols hidden in polar.plot

Jim Lemon jim at bitwrit.com.au
Thu Feb 15 10:12:05 CET 2007


Sumitrajit Dhar wrote:
> Hi Folks,
> 
> Here is my attempt at a simple polar plot.
> 
> 
>  > pos <- seq(0,360,by=5)
>  > tspk <- rep(c(1,0,1),c(13,47,13))
>  > require(plotrix)
>  > polar.plot(tspk,pos,rp.type="s",point.symbols=17,point.col="green4")
> 
> 
> I only see half the symbols, the other half of each symbol is hidden  
> under the circular grid. In fact if I change rp.type="r", I see the  
> lines being plotted and then the grid gets plotted over it and hides  
> the lines.
> 
> What am I doing wrong?

Hi Sumitrajit,
You aren't doing anything wrong, just unusual. 47 of your symbols are 
placed exactly in the center of the plot, so that only one of them is 
visible. Most of that is covered by the radial lines that the function 
draws. The other 26 are placed on the periphery of the plotting area and 
  seven of these will have the same radial lines drawn across them. If 
you want to see what I mean, try this:

fix(radial.plot)

now comment out line 78

  # segments(0,0,xpos,ypos,col=grid.col)

save and quit your editor. Now try your last line like this:

polar.plot(tspk,pos,rp.type="s",point.symbols=17,
  point.col="green4",show.grid=FALSE)

This gives me a chance to ask any interested R users the question:

"Do you prefer the radial.plot family to draw the lines, symbols or 
polygons first or last (that is, on top of everything else)?"

Thanks for any answers.

Jim



More information about the R-help mailing list