79549533

Date: 2025-04-02 02:22:07
Score: 0.5
Natty:
Report link

I'm not sure if I'm understanding this correctly. Can't reproduce it as no data was provided. Not sure if guide_legend(reverse = TRUE) is an answer you want.

library(tidyverse)

data <- tibble(x = c(1,2,3), y =c(4,5,6), class = c('a', 'b', 'c'))

ggplot(data = data, aes(x = x, y = y, color = class))+
  geom_point()

enter image description here

library(tidyverse)

data <- tibble(x = c(1,2,3), y =c(4,5,6), class = c('a', 'b', 'c'))

ggplot(data = data, aes(x = x, y = y, color = class))+
  geom_point()+
  guides(color = guide_legend(reverse = TRUE))

enter image description here

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Breeze