Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R GGPLOT-在B_W模式下一个图中的两条曲线_R_Graph_Ggplot2 - Fatal编程技术网

R GGPLOT-在B_W模式下一个图中的两条曲线

R GGPLOT-在B_W模式下一个图中的两条曲线,r,graph,ggplot2,R,Graph,Ggplot2,我有下面的一段代码,我写这段代码是为了为我在论文中的文章生成一个黑白图像 require(ggplot2) require(extrafont) #loadfonts(device="pdf") #set the x-axis now xaxis <- seq(0,1, by=0.01) #set the functions here aij <- sqrt(1 - (1-xaxis)**1.02) bij <- 1 - (1 - xaxis)**1.50 #p

我有下面的一段代码,我写这段代码是为了为我在论文中的文章生成一个黑白图像

require(ggplot2) 
require(extrafont)

#loadfonts(device="pdf")

#set the x-axis now 
xaxis <- seq(0,1, by=0.01)

#set the functions here 
aij <- sqrt(1 - (1-xaxis)**1.02)
bij <- 1 - (1 - xaxis)**1.50 

#plot using commands 

ggplot(,aes(xaxis)) + geom_line(aes(y=aij, colour="aij")) + 
      geom_line(aes(y=bij,colour="bij"),linetype="dashed") + 
      theme_bw() + 
      xlab("x ratio") + 
      ylab("Function values") + 
      theme(text=element_text(family="Times New Roman", face="bold", size=12))
ggsave('myGraph.pdf')
require(ggplot2)
需要(外部字体)
#加载字体(device=“pdf”)
#现在设置x轴
xaxis(1)

(二)

(三)

全部加在一起,例如:

ggplot(transform(stack(data.frame(aij, bij)), x = xaxis), 
       aes(x = x, y = values, linetype = ind)) +
  geom_line() + 
  theme_bw() + 
  xlab("x ratio") + 
  ylab("Function values") + 
  theme(text=element_text(family="Times New Roman", face="bold", size=12), 
        legend.title = element_blank()) + 
  scale_linetype_manual(values = c("solid", "dashed"))

(1)

(二)

(三)

全部加在一起,例如:

ggplot(transform(stack(data.frame(aij, bij)), x = xaxis), 
       aes(x = x, y = values, linetype = ind)) +
  geom_line() + 
  theme_bw() + 
  xlab("x ratio") + 
  ylab("Function values") + 
  theme(text=element_text(family="Times New Roman", face="bold", size=12), 
        legend.title = element_blank()) + 
  scale_linetype_manual(values = c("solid", "dashed"))

(1)

(二)

(三)

全部加在一起,例如:

ggplot(transform(stack(data.frame(aij, bij)), x = xaxis), 
       aes(x = x, y = values, linetype = ind)) +
  geom_line() + 
  theme_bw() + 
  xlab("x ratio") + 
  ylab("Function values") + 
  theme(text=element_text(family="Times New Roman", face="bold", size=12), 
        legend.title = element_blank()) + 
  scale_linetype_manual(values = c("solid", "dashed"))

(1)

(二)

(三)

全部加在一起,例如:

ggplot(transform(stack(data.frame(aij, bij)), x = xaxis), 
       aes(x = x, y = values, linetype = ind)) +
  geom_line() + 
  theme_bw() + 
  xlab("x ratio") + 
  ylab("Function values") + 
  theme(text=element_text(family="Times New Roman", face="bold", size=12), 
        legend.title = element_blank()) + 
  scale_linetype_manual(values = c("solid", "dashed"))