Line graph with 3 columns

My data looks like this
Date Location Plays
01/10/23 NYC 50
02/10/23 Paris 38

what i have so far but the points join together i want to see individual lines per location

SpotifyCountries %>%
ggplot(aes(Date, Plays, colour = "Location"))+
geom_point(size = 2, alpha = 0.3)+
geom_line(size = 1)
theme_minimal()

you have quoted Location so that its not understood to be a variable in your frame but rather just literally the string Location so remove the quores around it if you want it to be understood as taking the values NYC, Paris , etc.

That's great thank you

Do you know how i would add a title to this please ?

is there a geom_title(title)

? etc

geom_* are for mapped aesthetics, i.e. where your data should change a visual dimension of the chart.
Typically a title is just a description up top of the chart that is independent of the data, so there is not a geom for that.

use ggtitle to set a title label.
documented : Modify axis, legend, and plot labels — labs • ggplot2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.