r - ggplot bubble graph custom colors -


i have dataframe i'm trying use custom colors

data <- data.frame(condition=c('1','1','1','1','1','2','2','2','2','2','3','3','3','3','3'), assessmentgrade=c('400','410','420','430','440','500','510','520','530','540','300','310','320','330','340'), freq=c('1','2','1','5','7','9','1','5','3','4','5','8','1','3','5'), mathgrade=c('a+','b-','c-','d','f','a-','b','c+','d-','f','a+','d','d','f','c'), condition=c('condition 1','condition 1','condition 1','condition 1','condition 1','condition 2','condition 2','condition 2','condition 2','condition 2','condition 3','condition 3','condition 3','condition 3','condition 3')) 

i used ggplot abubble graph wondering how edit use company's standard colors

p <- ggplot(data, aes(x = mathgrade, y = assessmentgrade, size = freq, fill = condition)) +  geom_point(aes(colour = condition)) +  ggtitle("main title") +  labs(x = "first math grade", y = "math assessment score") 

i have vector called colors:

colors [1] "#101820" "#af272f" "#eaaa00"  

and tried graph this:

p <- p + scale_fill_manual(values = color)

nothing changed. tried following directions here nothing changed. can assist?

you create palette:

my_colors<- c("#101820", "#af272f", "#eaaa00") 

then when comes time use in plot:

 p <- ggplot(data, aes(x = mathgrade, y = assessmentgrade, size = freq, fill = condition)) +  geom_point(shape=21) +  ggtitle("main title") +  labs(x = "first math grade", y = "math assessment score") +  scale_fill_manual(values=my_colors) #or enter color numbers directly here 

this worked during testing ggplot not how used size in main aesthetic.

enter image description here


Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -