I have attached a sample plot code. The x-axis is discrete (chr type), y axis is numeric.
- How do I join points to see the change in count with days i.e. connect points of same color
- I want x-axis to be in the pre-defined sequence (not alphbetical) i.e. - "Sun", "Mon", "Tue"
days <- c("Sun", "Mon", "Tue", "Sun", "Mon", "Tue")
count <- c(1, 2, 3, 2.5, 3, 4.5)
variant_type <- c("A", "A", "A", "B", "B", "B")
tbl <- tibble(days, count, variant_type)
ggplot(data = tbl,
aes(x = days,
y = count,
color = variant_type)) +
geom_line() +
geom_point() +
theme_bw() +
theme(legend.position = "right",
aspect.ratio = 1)

