我如何摆脱所有重叠的x轴标签,而不是通过颜色创建一个图例和过滤器?
library(ggplot2)
#Load in the dataset
broadband = read.csv("broadbanddata.csv")
#Box plot
ggplot(broadband) + geom_boxplot(aes(x = rsp, y = All.hour.trimmed.mean.latency)) +
labs(title="Figure 1: Average internet speed", x="Type of technology", y="Average Latency in a Day")+
facet_wrap(~technology)
试试这个:
library(ggplot2)
#Load in the dataset
broadband = read.csv("broadbanddata.csv")
#Box plot
ggplot(broadband) + geom_boxplot(aes(x = rsp,
y = All.hour.trimmed.mean.latency,
fill = rsp)) +
labs(title="Figure 1: Average internet speed",
x="Type of technology",
y="Average Latency in a Day",
fill = "Average Latency in a Day")+
theme(axis.text.x = element_blank())+
facet_wrap(~technology)