我的数据框:
dput(head(x,3))
structure(list(Programs = structure(1:3, .Label = c("400.perlbench",
"401.bzip2", "403.gcc", "429.mcf", "445.gobmk", "456.hmmer",
"458.sjeng", "462.libquantum", "464.h264ref", "471.omnetpp",
"473.astar", "483.xalancbmk"), class = "factor"), Base_Run_Time = c(988.746037,
1401.357446, 821.134215), Base_Rate = c(790.49624, 550.8944,
784.28104), Base_Geo_Mean = c(837.6709, 837.6709, 837.6709),
Bench_Mark_Run_Time = c(827.236707, 1329.663649, 818.863431
), Peak_Rate = c(944.83232, 580.59792, 786.45592), Chip = structure(c(2L,
2L, 2L), .Label = c("E5_2660", "E7_4860", "ultrasparc"), class = "factor"),
Bench_Geo_Mean = c(790.4498, 790.4498, 790.4498), Percent_Difference = c(0.06,
0.06, 0.06)), .Names = c("Programs", "Base_Run_Time", "Base_Rate",
"Base_Geo_Mean", "Bench_Mark_Run_Time", "Peak_Rate", "Chip",
"Bench_Geo_Mean", "Percent_Difference"), row.names = c(NA, 3L
), class = "data.frame")
我需要为每个组创建一个条形图,其中需要并排放置 Base_Run_Time 和 Bench_Mark_Run_Time,一个为橙色,另一个为蓝色。
我已经尝试过这样的事情,但这给了我一个堆栈图。我需要每个 Base_Run_Time 和 Bench_Mark_Run_Time 的条形图:
ggplot(x)+geom_bar(data=x, aes(Programs, Base_Run_Time, colour="orange", group=Chip), stat="identity") + geom_bar(data=x, aes(Programs,Bench_Mark_Run_Time, colour="blue", fill="green", group=Chip), stat="identity")
有任何想法吗?