Skip to content

Commit 6253e6b

Browse files
committed
fixes geom_text documentation
1 parent b995460 commit 6253e6b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

docs/examples/geoms/geom_text.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,22 +89,24 @@ ggplot(df, @aes(x = x, y = y, text = t)) +
8989

9090
# Control where the text appears relative to the point:
9191

92-
ggplot(df, @aes(x = x, y = y, text = t)) +
92+
ggplot(df, @aes(x = x, y = y)) +
9393
geom_point(size = 15) +
94-
geom_text(fontsize = 20, align = (:center, :bottom)) +
94+
geom_text(@aes(text = t), fontsize = 20, align = (:center, :bottom)) +
9595
lims(x = (0.5, 2.5), y = (0.5, 2.5))
9696

9797
# Different alignment options:
9898

99-
ggplot(df, @aes(x = x, y = y, text = t)) +
99+
ggplot(df, @aes(x = x, y = y)) +
100100
geom_point(size = 15) +
101-
geom_text(fontsize = 20, align = (:left, :center)) +
101+
geom_text(@aes(text = t), fontsize = 20, align = (:left, :center)) +
102102
lims(x = (0.5, 2.5), y = (0.5, 2.5))
103103

104104
# ## Labeling Real Data
105105

106106
# Label species on a scatterplot (using summarized data):
107107

108+
import Statistics: mean
109+
108110
species_centroids = @chain penguins begin
109111
@group_by(species)
110112
@summarize(

0 commit comments

Comments
 (0)