下面是數據集,df.test:遇到問題使用GGPlot繪製在同積多行[數據集包括]
MLSpredictions BPLPredictions
1 1.392213 0.8326201
2 1.392213 0.8662049
3 1.448370 0.9011444
4 1.448370 1.0146486
5 1.448370 0.9374932
6 1.448370 0.9374932
7 1.448370 0.9011444
8 1.448370 1.0981538
9 1.448370 1.0555757
10 1.506792 1.0555757
11 1.506792 1.1424492
12 1.506792 1.0555757
13 1.567570 1.0981538
14 1.567570 1.0981538
15 1.567570 1.1424492
16 1.567570 1.1424492
17 1.567570 1.1885314
18 1.567570 1.1424492
19 1.567570 1.1885314
20 1.630800 1.2364723
我知道GGPlot需要你包括所有的信息,我相信我在上面完成了相同的數據框。
這裏是我的出發點:
ggplot(df.test, aes(x = 1:20, y = , color =))
由於我的列名是不同的,我不知道要放什麼東西了「Y」。我一直在尋找所有的樣本數據框架,在這種情況下,我會空着。
請指教。
[編輯]我想想出一個情節,有兩個不同的顏色在同一個情節線。
可能[複製](http://stackoverflow.com/questions/17150183/r-plot-multiple-lines-in-one-graph)。和[這篇文章](http://stackoverflow.com/questions/35586520/when-creating-a-multiple-line-plot-in-ggplot2-how-do-you-make-one-line-thicker)給出了信息關於'aes(x)' – cuttlefish44
這個問題缺乏你試圖想出的東西的信息。你能否提供你想要在你的圖表中繪製的內容? –
'ggplot(df.test,aes(x = MSLpredictions,y = BPLPredictions))+ geom_line()'會爲您發佈的所有數據提供一行。爲了得到兩條不同顏色的線條,你需要一個具有兩個不同值的分類列。例如,'df.test $ group = rep(c(「A」,「B」),10)',那麼ggplot(df.test,aes(x = MSLpredictions,y = BPLPredictions,color = group) )+ geom_line()' – eipi10