[英]ggplot color bar missing in legend
我是這個論壇的新手,但是我在這些主題中找到了很多答案。 我離程序員還很遠,但是使用R創建自定義圖。 我一直在學習曲線,但是在試圖顯示散點圖中的2個變量而又想顯示第3維Process_Time時遇到困難。
我已按“ STATE”過濾了數據集的行,因此“ Process_Time”已中斷。
數據框的摘要如下:
'data.frame': 71896 obs. of 10 variables:
$ key : Factor w/ 6 levels "ATAB","CCNa",..: 1 1 1 1 1 1 1 1 1 1
$ Process_Time: num 4.32 4.33 4.35 4.37 4.38 ...
$ CONC_PCT : num 30.9 31 31 30.9 30.9 ...
$ STATE : Factor w/ 4 levels "Blind","Gravimetric",..: 2 2 2 2 2 2 2
$ NW : num 1.15 1.14 1.14 1.14 1.13 ...
$ SRW_SP : num 106 105 105 106 105 ...
$ FF : num 2.45 2.46 2.46 2.45 2.45 ...
$ MF : num 15.5 15.5 15.5 15.4 15.4 ...
$ Max_Mass : num 1.72 1.72 1.72 1.72 1.72 ...
$ NW_norm : num 0.67 0.667 0.665 0.663 0.66 ...
代碼如下:
FF_DATA <- subset(FF_Data, STATE=="Gravimetric")
FF_NW <- ggplot(FF_DATA,aes(NW_norm,FF)) +
geom_point(aes(color = Process_Time ))+
facet_grid(key~.,scales = "free")+
scale_color_gradient()
看來我有一個渲染問題。 我已經在有關此問題的其他幾篇文章中閱讀了此內容,但不知道從哪里開始。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.