0
我有這樣的數據幀,我試圖使用自定義顏色ggplot氣泡圖自定義顏色
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'))
我用ggplot獲得abubble圖形,但我不知道我怎麼會編輯它使用我公司的標準色彩
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")
我有一個向量稱爲顏色:
colors
[1] "#101820" "#AF272F" "#EAAA00"
,我試圖用這個曲線圖吧:
p < - P + scale_fill_manual(值=顏色)
沒有什麼改變。我嘗試了以下指示here,但沒有任何更改。有人可以協助嗎?
謝謝你,但我的結局沒有任何變化。 : -/ – Walker
我剛剛注意到複製粘貼 – sconfluentus
中的一個錯誤,它現在可以工作 – sconfluentus