0

I'm trying to create APA style figures where I have both individual data points and the best fitting lines of two different levels of a variable. When I adjust the shape of my points using geom_point, it is not changing all of my points. See code below:

enter image description here

ggplot(df, aes(x = Psych.Distress.Sum, y = Likelihood.Max, col = Feedback, fill = Feedback)) +
  geom_smooth(method = "lm", se = T, aes(linetype = Feedback)) +
  geom_point(aes(shape = Feedback), set.seed = 1) +
  geom_jitter() +
  labs(x = "Psychological Distress", y = "Endorsement of Max's Feedback Strategy") +
  apatheme +
  theme(axis.title = element_text(face="bold")) +
  theme(legend.text = element_text(face="bold")) +
  theme(legend.position = c(0.87, 0.13)) 
  • 1
    You're adding your points twice - once as `geom_point()`, and again as `geom_jitter()`. `aes(shape = Feedback)` only applies to the `geom_point()` layer where you put it, so `geom_jitter` doesn't know about it and doesn't change shape. Pick one, either `geom_point()` (and you can add `position = "jitter"` as an argument) or `geom_jitter()` (and you can add `aes(shape = "Feedback")` as an argument), but don't do both. – Gregor Thomas Jun 18 '22 at 17:48
  • Thanks so much! That did the trick. Much appreciated, Mr. Gregor Thomas. – RforDummies Jun 20 '22 at 18:28

0 Answers0