2012-07-13 3 views
5

"this"변수에 "STATE"변수에 "DISTANCE"비율의 배분을 생성합니다. 내 코드는 다음과 같습니다 :R : 래티스가 pdf에서 범례를 엉망으로 만들었습니다

library(R.utils) 
df = loadObject("bchart.bin") 
df.prop = as.data.frame(prop.table(table(df$STATE, df$DISTANCE),1)) #Creating proportions data 
    names(df.prop) = c('State','Distance','Proportion') 

library(lattice) 
pdf(file="bchart.pdf", width=10, height=10, pointsize=10) 
barchart(State ~ Proportion, groups=Distance, data=df.prop, stack=T, horizontal=T, auto.key=list(columns=5, space="top"), par.settings = list(superpose.polygon = list(col = rev(gray.colors(5))))) 
dev.off() 

PDF 파일은 here입니다. '>'이 잘 인쇄되면 범례가 '≤'을 '...'으로 인쇄하는 이유는 무엇입니까? 이것은 pdf 또는 eps에서만 발생합니다. png를 사용하는 경우 output is fine입니다.

답변

2

cairo PDF 백엔드를 사용할 때 작동해야합니다. 내가 확인하지 않았지만

cairo_pdf(file="bchart.pdf", width=10, height=10, pointsize=10) 

이 잘 폴 머렐으로, PDF 인코딩 할 Including fancy glyphs in R Graphics PDF output를 참조 할 수도 있습니다.

+0

아마도 인코딩 문제 일 수 있습니다. ''latin1' 언어가 아닌 언어는 매일 이것을 다루는데 그것은별로 좋지 않습니다. –

+0

완벽! 많은 감사, chl. – user702432

관련 문제