Changing ggplot box plot legend title

tukeyboxplot(data = data_long_labels,
y = score,
x = job,
by = affect) + (labs(x="Job Status", y="Attractiveness Score"))

My code. Im struggling to change the title of the by = affect from affect to Facial Expressions.
Searched it a lot on the web and have figured out have to change every other label but not this one.

Assuming that the by argument maps to ggplot's fill aesthetic, it would be done like this in ggplot

ggplot(data = data_long_labels,
             aes(y = score,
             x = job,
             fill = affect)) + 
  geom_boxplot() + 
  (labs(x="Job Status", y="Attractiveness Score", fill = "Facial Expression"))

If by maps to color, change the labs argument to color.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.