Search code examples
rscatter-plot

does cex scale the radius, diameter, or area when applied to circular points in base R plots


The graphical parameter cex determines the size of various things in base R plots, from labels to point sizes. cex = 1 is the default size, cex = .5 is 50% smaller, cex = 1.5 is 50% larger. My question is what exactly cex uses to scale circular point sizes. For example, when cex = 1.5 does that mean the area, radius, or diameter of the point is 50% bigger than default?

Example of cex changing circular point size:

plot(x = 1:5, y = 1:5, type = "n")
points(x = 1:5, y = 1:5, pch = 21, cex = 1)
points(x = 1:5, y = 1:5, pch = 21, cex = 2)

Solution

  • It scales the radius (or, equivalently, the diameter).

    plot(x = -1:1, y = -1:1, type = "n")
    points(0, 0, cex = 20)
    points(0, 0, cex = 40)
    abline(v=0)
    abline(v=0.5)
    abline(v=1)
    

    enter image description here