Adding Quadrants to R Scatterplots, and lines pointing from plots to their respective labels
11,395
Just doing the same thing (the quadrants part) and have used:
p<-ggplot(survey.df, aes(x=specificity, y=success)) +
geom_point() +
lims(x=c(1,10),y=c(1,10)) +
theme_minimal() +
coord_fixed() +
geom_vline(xintercept = 5) + geom_hline(yintercept = 5)
p
Author by
Admin
Updated on June 09, 2022Comments
-
Admin almost 2 years
With ggplot2, can I add four quadrants. Basically just a line down the middle for the y and x axis (a plus sign)? I also wanted to see if i can have a lines pointing from the labels to their respective dots. The labeling overlap is getting problematic.
data$Goal <- factor(data$Goal, levels = c("KPI", "Strategic Support and Relationship Management", "Sales and Marketing Support", "Google AW Account Management and Product Support")) library(ggplot2) ggplot(data = data, aes(x = X, y = Y, color = Goal)) + geom_point(size=3) + scale_colour_manual(values = c("blue", "red4", "purple4", "olivedrab")) + geom_text(aes(label = Label), color = "black", position = "jitter", hjust=0.6, vjust=1.1, size = 2.5) + labs(title = "PSAT", x = "Impact on Overall Satisfaction", y = "Higher Rating")