如何将轴标签添加到R中的多个时间段?

时间:2013-05-01 14:25:34

标签: r plot igraph

我设法创建了一个包含4个不同图表的单个图表。但是轴标签不会显示。因为我是R的初学者,如果有人能告诉我如何在这种情节中添加轴标签,我会很感激。 X轴:学位 Y轴:记录(累积分布)

该图使用igraph-Functions。

这是图表: enter image description here 这是我的代码:

par(mar = rep(2, 4))  
par(mfrow=c(2,2))               
ddU <- degree.distribution(USAN_g_num, cumulative=TRUE, mode="in")
plot(ddU,  log="xy", col=ifelse(degree.distribution(USAN_g_num, cumulative=FALSE,     mode="in")==0 ,'white',"black"), 
 pch=ifelse(degree.distribution(USAN_g_num, cumulative=FALSE, mode="in")==0 ,10,20),
 cex=ifelse(degree.distribution(USAN_g_num, cumulative=FALSE, mode="in")==0 ,0,1),xlab="degree", ylab="log(cumulative frequency)",main="USAN") 

  ddS <- degree.distribution(SAg, cumulative=TRUE, mode="in")
  plot(ddS,  log="xy", col=ifelse(degree.distribution(SAg, cumulative=FALSE, mode="in")==0 ,'white',"black"),   
     pch=ifelse(degree.distribution(SAg, cumulative=FALSE, mode="in")==0 ,10,20),
     cex=ifelse(degree.distribution(SAg, cumulative=FALSE, mode="in")==0 ,0,1),xlab="degree", ylab="log(cumulative frequency)",main="SA") 

  ddO <- degree.distribution(OWg, cumulative=TRUE, mode="in")
  plot(ddO,  log="xy", col=ifelse(degree.distribution(OWg, cumulative=FALSE, mode="in")==0 ,'white',"black"),  
    pch=ifelse(degree.distribution(OWg, cumulative=FALSE, mode="in")==0 ,10,20),
    cex=ifelse(degree.distribution(OWg, cumulative=FALSE, mode="in")==0 ,0,1),xlab="degree", ylab="log(cumulative frequency)",main="OW") 

  ddT <- degree.distribution(STg, cumulative=TRUE, mode="in")
  plot(ddT,  log="xy", col=ifelse(degree.distribution(OWg, cumulative=FALSE, mode="in")==0 ,'black',"black"),  
    pch=ifelse(degree.distribution(STg, cumulative=FALSE, mode="in")==0 ,10,20),
    cex=ifelse(degree.distribution(STg, cumulative=FALSE, mode="in")==0 ,0,1),xlab="degree", ylab="log(cumulative frequency)",main="ST")

谢谢

1 个答案:

答案 0 :(得分:2)

您没有看到x和y轴标签,因为您为mar=的图的底部和左侧设置了太窄的边距。尝试将其增加到4或更高。

par(mar = c(4,4,2,2))  
par(mfrow=c(2,2))
plot(1:10,xlab="mm",ylab="kk")
plot(1:10,xlab="mm",ylab="kk")
plot(1:10,xlab="mm",ylab="kk")
plot(1:10,xlab="mm",ylab="kk")