我完全是R的新手,我正在尝试结合到qplots (ggplot2包),以便两个图(应力-应变曲线)将成为一个应力-应变图。我不知道该怎么做。有人能帮帮忙吗。下面是每个单独绘图的代码。我尝试过使用rbind,但我不确定这是否与此相关。
p1 <- qplot(StrainL,StressL, data=dat2,) +
geom_line(aes(colour="Longitudinal"))
p2 <- qplot(StrainC,StressC, data=dat2) +
geom_line(aes(colour="Circumferential"))
p3 <- rbind(p1,p2)发布于 2015-09-29 12:29:08
我在这里对你的数据做了一些假设,但这可能会起作用:
library(ggplot2)
ggplot(data = dat2) +
geom_line(aes(x = StrainL, y = StressL, colour = "L")) +
geom_line(aes(x = StrainC, y = StressC, colour = "C")) +
xlab("Strain") +
ylab("Stress") +
ggtitle("Put your plot's title here") +
scale_colour_manual(name = "", values = c("L" = "red", "C" = "blue"))https://stackoverflow.com/questions/32835509
复制相似问题