Connecting dots on discrete data values in plot


I'm trying to connect the dots in this graph through straight lines but I can't seem to be able to. My code is:
plot(stats_without_21$year, stats_without_21$total.number.of.recorders.per.year,
type = "b",
main = 'Total Recorders per Year', xlab = 'Year', ylab= 'Number of Recorders',
pch= 19)
That gives this graph:

I've tried doing it as a ggplot but that didn't work either
Any ideas?
Thank you!

Try to see if this does the trick for you?

my_data <- tribble(
  ~Year, ~Number_of_Recorders,
  2014, 299,
  2015, 300,
  2016, 297,
  2017, 400,
  2018, 350,
  2019, 800,
  2020, 352
my_data %>% 
  ggplot(aes(x = Year,
             y = Number_of_Recorders)) +
  geom_point() +
  geom_line() +

Hope it helps! :slightly_smiling_face:

Amazing thank you that worked!

You're welcome - Please mark my answer as the solution :+1:

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.