Your problem is that you haven't specified the aesthetics in geom_text
correctly:
geom_text(data = df, aes(x = lon, y = lat, label = label),
size = 3, vjust = 0, hjust = -0.5)
You didn't tell geom_text
to use the variables from the data frame df
. If you don't do this, all aesthetics are inherited from the main call. Finally, when setting aesthetics to a single value, you don't do this inside of aes()
, but outside.
I monkeyed with the hjust
setting to get the labels to be visible.