炎炎设计
我显然不是一个很好的R编码器,但是如果您想用ggplot2做到这一点:data<- rbind(c(480, 780, 431, 295, 670, 360, 190), c(720, 350, 377, 255, 340, 615, 345), c(460, 480, 179, 560, 60, 735, 1260), c(220, 240, 876, 789, 820, 100, 75))a <- cbind(data[, 1], 1, c(1:4))b <- cbind(data[, 2], 2, c(1:4))c <- cbind(data[, 3], 3, c(1:4))d <- cbind(data[, 4], 4, c(1:4))e <- cbind(data[, 5], 5, c(1:4))f <- cbind(data[, 6], 6, c(1:4))g <- cbind(data[, 7], 7, c(1:4))data <- as.data.frame(rbind(a, b, c, d, e, f, g))colnames(data) <-c("Time", "Type", "Group")data$Type <- factor(data$Type, labels = c("A", "B", "C", "D", "E", "F", "G"))library(ggplot2)ggplot(data = data, aes(x = Type, y = Time, fill = Group)) + geom_bar(stat = "identity") + opts(legend.position = "none")