0

我有以下数据集:

Time               Served        MAC             BLER
07:16:18.341       7561.60       6721.60             8.33
07:16:18.641       10321.44          8198.24             16.47

为简洁起见,我省略了其他示例。

我想在 ggplot2 的同一图表上绘制 x 轴时间和 Y 轴其他三个变量,即 Served、MAC 和 BLER。我怎样才能做到这一点?非常感谢

4

1 回答 1

2

您需要融化形式的数据。

require(reshape2)
df.m<-melt(df,id.var="Time")

然后

ggplot(df.m, aes(x=Time, y=value, color=variable))+geom_line()

但我害怕y轴的缩放

于 2013-10-30T00:42:32.880 回答