悬赏 100 个论坛币 未解决
下面是用ggplot作图的程序,求大神看看有没有可以解决的,运用了分面作图的函数后,不能改变其中线条的类型,用过scale_linetype_manual了,并没有变化。
library(dplyr)
library(ggplot2)
I020 = read.csv("I020.csv")
p1 <- ggplot(filter(I020, mu == 0 )) +
geom_line(aes(x=lambda, y=power, colour = phi), size=1.5) +
theme_bw() +
scale_color_manual(values=c("orangered4","dodgerblue3","orange3","brown1","dodgerblue3","orange")) +
#scale_linetype_manual(values=c("twodash","dotted","solid","twodash","dotted","solid"))+
geom_hline(yintercept = 0.05, linetype = "dashed") +
xlab(NULL) + ylab(NULL)+
guides(colour = guide_legend( ncol = 1, byrow = TRUE))+
guides(colour = guide_legend('',nrow = 1, byrow = TRUE)) +
theme(legend.position = "bottom", legend.background = element_rect(colour = "black")) +
facet_grid(DF ~ rho, labeller = labeller(rho = c(`-0.2` = "ρ=-0.2", `-0.4` = "ρ=-0.4",`-0.6` = "ρ=-0.6"),
DF = c(`df=(10,10)` = "df=(10,10)", `df=(15,15)` = "df=(15,15)")))