Graph of pch Plotting Symbols in R

In R, you can plot a variety of symbols when you are plotting points on a graph. The default is a hollow circle. But it is very flexible. To do this, you use the pch parameter when you create a plot. You can find information in the help files (?pch), but it only describes the symbols and doesn’t illustrate what they are. I was wondering for my project, so I put together a little script to do this. Below is the code for symbols 1–25. And here’s the graph

par(mar=c(2, 0, 0, 0) + 0.1)
pchRange = 1:25
 
for (i in pchRange)
{
  if (i==1)
    plot(rep(i, 10), 1:10, pch=i, xlim=c(min(pchRange), max(pchRange)), xlab=0, ylab=0, yaxt="n" )
  if (i>1)
    points(rep(i, 10), 1:10, pch=i)
}

Leave a Reply