• R语言
  • 求助:ggplot2画图 可以在同一个X坐标上画不同的X,Y组合吗?

数据集为:

<br />
    temp.tpr     temp.fpr  temp.depth<br />
1  1.0000000 0.0710676626 0.084244721<br />
2  1.0000000 0.0407513181 0.054358419<br />
3  0.9389313 0.0314147627 0.044288035<br />
4  0.9312977 0.0239455185 0.036816459<br />
5  0.9236641 0.0207601054 0.033567948<br />
6  0.9160305 0.0168057996 0.029561451<br />
7  0.8778626 0.0144991213 0.026746075<br />
</p>

代码为

<br />
d <- pretty(range(temp.plot$temp.tpr), 20)<br />
e <- pretty(range(temp.plot$temp.depth), 20)<br />
ggplot(temp.plot,aes(x=temp.depth,y=temp.tpr))+<br />
  geom_line(aes(color="blue"))+<br />
  geom_line(aes(x=temp.fpr,y=temp.tpr,color="red"))+<br />
  scale_x_continuous("prob",breaks=e)+<br />
  scale_y_continuous(breaks=d)+<br />
  scale_color_hue("chart",labels=c("ROC","lorenz"))<br />
</p>

这样画出来的2个图,ROC的X轴会替代掉lorenz的,怎么才能在同样的X,Y坐标下,画出这2个图来呢?

谢谢各位~[s:15]