I’m familiar enough with ggplot that I can make a quick plot pretty easily in most cases.1 But when it comes to fine-tuning the various plot aesthetics, like adjusting the legend position or rotating axis tick labels, I always have to look them up. Today, I will be writing about one of these pesky things: looking up the point shape options for geom_point. The available documentation for this isn’t great, so I thought it would be worthwhile to write my own reference.

# How to Change the Shape

By default, shape = 19 (a filled circle). You can change the number to plot different shapes, i.e. geom_point(shape = x). If you want to change point shapes based on a grouping variable, then first set the shape with the grouping variable in geom_point and then use scale_shape_manual to choose the desired shapes (optional). Below is an example.

library(ggplot2)

dt = data.frame(x = 1:5,
y = c(1, 3, 2, 4, 5),
group = as.factor(c(1, 2, 1, 2, 2)))

ggplot(dt, aes(x, y)) +
geom_point(aes(shape = group, color = group), size = 3) +
scale_shape_manual(values = c(15, 16)) +
theme_minimal()

The first 26 options available for point shapes, i.e. shapes 0 to 25, are the ones you are most likely to use.2 I have created two keys below for the different shape options. The first is ordered by the shape number and the second is ordered by the geometric shape.

# Shape Options (Ordered By Number)

• Shapes 0 to 14 are outline only: use color to change colors
• Shapes 15 to 20 are fill only: use color to change colors
• Shapes 21 to 25 are outline + fill: use color to change the outline color and fill to change the fill color

# Shape Options (Ordered by Shape)

I often find that I’m looking for a particular shape when plotting, so I’ve also arranged the options by their geometric shape above.

For more tips, check out my other posts about using R here.

1. Yes, I spoke too soon. The plots on this post took way longer to make than anticipated!↩︎

2. There are additional options available, i.e. shapes 32 to 127, which correspond to the ASCII characters. I think it’s quite unlikely I’ll ever use them, but if you’re interested, you can view them here.↩︎