I'm using geom_text
from ggplot
to annotate each of my plots in a facet_wrap
. My code is shown below. num_zeros_text
is just a dataframe with a single column, label
, with a number in each row. I'm trying to follow the answer posted by Kamil Slowikowski in this post. For some reason, my labels are ending up "overlapping" each other (see picture below), where essentially all numbers from the dataframe num_zeros_text
are being displayed on each plot (I believe). I can't figure out why.
ggplot(normalized_counts_subsampled, aes(value)) +
geom_histogram() +
facet_wrap(~bins, 100) +
geom_text(data = num_zeros_text,
aes(x = 0.75, y=50, label=label))