Here are three versions of the plot with some different options for setting the x axis limits and removing the grid. You can see the many elements of the theme that can be changed at
library(dplyr)
library(tibble)
library(ggplot2)
library(tidyr)
library(stringr)
Stress<-tibble::tribble(
~V1, ~V2, ~V3, ~V4, ~V5, ~V6, ~V7, ~V8, ~V9, ~V10, ~V11, ~V12, ~V13, ~V14, ~V15, ~V16, ~V17,
"ID Number", 0L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L,
"CD-Female", 66L, 66L, 64L, 64L, 58L, 58L, 58L, 57L, 56L, 56L, 57L, 57L, 57L, 57L, 57L, 57L,
"CD-Female", 103L, 103L, 103L, 103L, 103L, 103L, 103L, 103L, 103L, 103L, 103L, 103L, 103L, 103L, 103L, 104L,
"CD-Female", 115L, 115L, 114L, 114L, 114L, 114L, 112L, 111L, 110L, 109L, 109L, 108L, 109L, 110L, 111L, 112L,
"CD-Female", 84L, 63L, 62L, 62L, 63L, 58L, 58L, 54L, 62L, 66L, 66L, 60L, 60L, 51L, 54L, 54L,
"CD-Female", 83L, 84L, 84L, 84L, 84L, 84L, 82L, 82L, 82L, 82L, 81L, 82L, 83L, 82L, 82L, 82L,
"CD-Female", 240L, 202L, 141L, 106L, 89L, 74L, 71L, 71L, 71L, 72L, 74L, 77L, 77L, 70L, 68L, 68L,
"CD-Female", 66L, 66L, 76L, 76L, 76L, 77L, 75L, 75L, 75L, 75L, 76L, 76L, 77L, 79L, 79L, 77L,
"CD-Female", 66L, 68L, 68L, 67L, 66L, 67L, 68L, 69L, 69L, 68L, 68L, 68L, 70L, 72L, 71L, 69L,
"CD-Female", 65L, 65L, 65L, 65L, 65L, 65L, 66L, 66L, 65L, 65L, 66L, 66L, 67L, 67L, 68L, 69L,
"CD-Male", 70L, 69L, 68L, 68L, 69L, 69L, 69L, 69L, 68L, 69L, 70L, 71L, 72L, 72L, 73L, 74L,
"CD-Male", 66L, 66L, 66L, 66L, 66L, 66L, 67L, 67L, 67L, 67L, 68L, 68L, 68L, 67L, 67L, 67L,
"SS-Female", 67L, 65L, 65L, 64L, 58L, 61L, 55L, 60L, 60L, 60L, 60L, 66L, 66L, 72L, 72L, 82L,
"SS-Female", 78L, 78L, 77L, 76L, 75L, 75L, 75L, 75L, 76L, 76L, 76L, 76L, 77L, 76L, 76L, 77L,
"SS-Female", 79L, 78L, 67L, 67L, 68L, 62L, 62L, 62L, 63L, 72L, 72L, 82L, 81L, 82L, 83L, 82L,
"SS-Female", 85L, 84L, 83L, 81L, 80L, 79L, 78L, 78L, 79L, 80L, 80L, 81L, 81L, 81L, 80L, 80L,
"SS-Male", 63L, 63L, 63L, 63L, 77L, 78L, 80L, 77L, 76L, 67L, 67L, 62L, 57L, 57L, 57L, 48L,
"SS-Male", 49L, 48L, 46L, 46L, 45L, 46L, 45L, 45L, 45L, 45L, 46L, 46L, 47L, 48L, 48L, 50L
)
TheData <- Stress %>%
group_by(V1) %>%
summarize_if(is.numeric, mean) %>%
pivot_longer(-V1) %>%
filter(V1 != "ID Number") %>%
mutate(time = str_sub(name, 2) %>% as.numeric())
#cutting off data with xlim()
ggplot(TheData) +
aes(time, value, color = V1) +
geom_line() +
xlim(5,15)
#> Warning: Removed 20 rows containing missing values (geom_path).

#Zooming in to x = [5, 15] with coord_cartesian
ggplot(TheData) +
aes(time, value, color = V1) +
geom_line() +
coord_cartesian(xlim = c(5,15))

#Change the legend label and remove the grid
ggplot(TheData) +
aes(time, value, color = V1) +
geom_line() +
xlim(5,15) +
labs(color = "Population") +
theme(panel.grid = element_blank())
#> Warning: Removed 20 rows containing missing values (geom_path).

Created on 2022-04-22 by the reprex package (v0.2.1)