library(ggplot2)
data <- data.frame(
Salary = c(5319.82, 3015.18, 5592.44, 3163.30, 3960.08, 3479.09),
Position = c("Management", "Non-Management", "Management",
"Non-Management", "All Positions", "All Positions"),
Gender = c("Male", "Male", "Female", "Female", "Male", "Female")
)
data |>
ggplot(aes(x = Gender, y = Salary, group = Position, colour = Position)) +
geom_line(linewidth = 1.2) +
geom_point(size = 3) +
labs(x = NULL, y = "Average Salary ($)", colour = "Position") +
scale_colour_manual(values = c("All Positions" = "#005e73",
"Management" = "#FF7E15",
"Non-Management" = "#00C1D4")) +
theme(axis.line = element_line(colour = "#005e73", linewidth = 0.8),
axis.ticks = element_line(colour = "#005e73"),
axis.text = element_text(colour = "#005e73"),
axis.title = element_text(colour = "#005e73"))