2014-12-08 4 views
0

막대 모양을 만드는 데이 코드가 있지만 x 축의 이름을 종 이름으로 변경하고 싶습니다. 글꼴을 더 작게 만들려고합니다. 나는 그것을 모두 들어갈 수있다. 나는 다양한 조합으로 cex 함수를 사용해 보았지만 시도하지는 못했다. 나는 제안에 대해 감사 할 것입니까?x 축에서 글꼴 크기 변수를 더 작게 만드는 방법

count <-  
    matrix(c(16,102,11,106,15,95,26,87,18,99,21,103,12,110,30,103,10,107,20,87,13,110,17,93),  nrow = 2) 


    barplot(count, beside=T, legend =T, ylim=c(0,130), 
    col=c("darkolivegreen3", "firebrick1"), 
    ylab="Frequency (no. of moths)", las = 3, 
    names = c("tiger\nCo", "tiger\nCr" , "eyes\nCo", "eyes\nCr", "mottled\nCo","mottled\nCr", "pepperL\nCo","pepperL\nCr", "pepperD\nCo","pepperD\nCr", "convol\nCo", "convol\nCr"))   


    legend(6,130, legend=(c("survived","predated")), pch=c(15,22), cex=0.8, col=c("darkolivegreen3","firebrick1")) 
+0

'cex'는 제 경험상 절대로 기능이 아닙니다. –

답변

3

음, ?barplot 페이지에 따르면이있는 cex.names 인수 :.

barplot(count, beside=T, legend =T, ylim=c(0,130), 
    col=c("darkolivegreen3", "firebrick1"), 
    ylab="Frequency (no. of moths)", las = 3, 
    cex.names=0.8, 
    names.arg = c("tiger\nCo", "tiger\nCr" , "eyes\nCo", "eyes\nCr", 
        "mottled\nCo","mottled\nCr", "pepperL\nCo", 
        "pepperL\nCr", "pepperD\nCo","pepperD\nCr", 
        "convol\nCo", "convol\nCr"))   
    legend(6,130, legend=(c("survived","predated")), pch=c(15,22),  
          col=c("darkolivegreen3","firebrick1")) 

내가 인정하는 올바른 CEX를 찾는 * 인수가, 때로는 어렵고 때로는 축에 별도의 호출이 필요하지만 여기 그것은 사소한 것에 가깝게 보인다.

관련 문제