logo

Symbols Used in Plotting Graphs in R 📂R

Symbols Used in Plotting Graphs in R

Code

1.png

Various symbols can be changed in graph related functions by using the pch option. The image above especially shows at a glance the most frequently used symbols. There are many useful ones, but especially number 16 is often used, and after number 25, while the markers themselves are set, there’s nothing much useful. In the example code below, sym can be changed from 26 to 50 for checking. Meanwhile, from 21 to 25, colors can be added through the bg option.

win.graph()
X1 <- rep(1:5, 5)
Y1 <- rep(5:1, each = 5)
sym <- 1:25
plot(X1, Y1, pch = sym, cex = 1.2, xlab = "", ylab = "",
     xaxt = "n", yaxt = "n", xlim = c(0.3, 5.7), ylim = c(0.3, 5.7))
text(x = X1 - 0.3, y = Y1, labels = sym)