@@ -143,7 +143,7 @@ The border of the polygon is controlled by the `colour`, `linetype`, and `size`
143143
144144### Shape {#sec:shape-spec}
145145
146- Shapes take four types of values:
146+ Shapes take five types of values:
147147
148148* An __integer__ in $[0, 25]$:
149149
@@ -161,6 +161,32 @@ Shapes take four types of values:
161161 scale_x_continuous(NULL, breaks = NULL) +
162162 scale_y_continuous(NULL, breaks = NULL)
163163 ```
164+
165+ * The __name__ of the shape:
166+
167+ ```{r out.width = "90%", fig.asp = 0.4, fig.width = 8}
168+ shape_names <- c(
169+ "circle", paste("circle", c("open", "filled", "cross", "plus", "small")), "bullet",
170+ "square", paste("square", c("open", "filled", "cross", "plus", "triangle")),
171+ "diamond", paste("diamond", c("open", "filled", "plus")),
172+ "triangle", paste("triangle", c("open", "filled", "square")),
173+ paste("triangle down", c("open", "filled")),
174+ "plus", "cross", "asterisk"
175+ )
176+
177+ shapes <- data.frame(
178+ shape_names = shape_names,
179+ x = c(1:7, 1:6, 1:3, 5, 1:3, 6, 2:3, 1:3),
180+ y = -rep(1:6, c(7, 6, 4, 4, 2, 3))
181+ )
182+
183+ ggplot(shapes, aes(x, y)) +
184+ geom_point(aes(shape = shape_names), fill = "red", size = 5) +
185+ geom_text(aes(label = shape_names), nudge_y = -0.3, size = 3.5) +
186+ scale_shape_identity() +
187+ scale_x_continuous(NULL, breaks = NULL) +
188+ scale_y_continuous(NULL, breaks = NULL)
189+ ```
164190
165191* A __ single character__ , to use that character as a plotting symbol.
166192
0 commit comments