Vorrei aggiungere una linea orizzontale sopra un grafico a barre. Attualmente sono in grado di aggiungere punti utilizzando geom_points
:Come aggiungere una linea orizzontale sopra un grafico a barre usando ggplot?
data <- ddply(diamonds, .(cut, color), summarise, mean_carat = mean(carat))
ggplot(data, aes(color, mean_carat,fill=cut)) +
geom_bar(stat="identity", position="dodge") +
geom_point(data=data, aes(color, mean_carat, fill=cut))
La freccia rossa nell'immagine qui sotto mostra cosa vorrei aggiungere:
Grazie!
Controllare 'geom_segment' http://docs.ggplot2.org/current/geom_segment.html. Non sono sicuro che funzioni con un barplot. – Molx