我有以下数据:
Name Value Type
One 500 Confirmed
One 1000 Total
Two 550 Confirmed
Two 900 Total
Three 550 Confirmed
Three 800 Total
以下R脚本:
#!/usr/bin/env Rscript
library(ggplot2)
data = structure(list(Name = c("One", "One", "Two", "Two", "Three",
"Three"), Value = c(500L, 1000L, 550L, 900L, 550L, 800L), Type = c("Confirmed",
"Total", "Confirmed", "Total", "Confirmed", "Total")), .Names = c("Name",
"Value", "Type"), class = "data.frame", row.names = c(NA, -6L
))
ggplot(data=data, aes(x=Value, y=Name, group=Name, colour=Type)) + geom_line(color="black") + geom_point()
产生以下情节:
我的问题是,如何减少三个类别(一,二,三)之间的垂直空间?他们似乎毫无必然地相距甚远。