Tôi đang tạo một barchart của sự phân bố của tỷ lệ "DISTANCE" trên biến "STATE" trong this dữ liệu. Mã của tôi như sau:R: Lattice messes lên huyền thoại trong 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()
Tệp pdf là here. Tại sao truyền thuyết in '≤' thành '...' khi '>' đang in tốt? Điều này chỉ xảy ra với pdf hoặc eps. Nếu tôi sử dụng png, output is fine.
Đây có thể là sự cố mã hóa. Các ngôn ngữ không phải là 'latin1' đối phó với điều này hàng ngày và nó không đẹp. –
Hoàn hảo! Rất cám ơn, chl. – user702432