2011-10-18 7 views

답변

2

를 사용할 수는 :

plot(x, y, log="xy") 

이 로그 스케일에 포인트를 플롯합니다.

1

:

library(lattice) 
library(latticeExtra) 
xyplot((1:200)/20 ~ (1:200)/20, type = c('p', 'g'), 
     scales = list(x = list(log = 10), y = list(log = 10)), 
     xscale.components=xscale.components.log10ticks, 
     yscale.components=yscale.components.log10ticks) 

더 예제 here.

1

당신은 이미 빈도와 단어의 순위를 얻음으로써 열심히 노력했습니다. 그것들을 로그 스케일로 그려야합니다.

##Word frequencies in Moby dick 
dd = read.csv("http://tuvalu.santafe.edu/~aaronc/powerlaws/data/words.txt") 

##Rename the columns and add in the rank 
colnames(dd) = "freq" 
dd$rank = 1:nrow(dd) 

##Plot using base graphics 
plot(dd$rank, dd$freq, log="xy") 

아니면 그냥 기본 기능으로 ggplot2

require(ggplot2) 
ggplot(data=dd, aes(x=rank, y=Freq)) + 
    geom_point() + scale_x_log10() + 
    scale_y_log10() 
관련 문제