2009-06-17から1日間の記事一覧

latticeパッケージのplotで画面の分割

明示的にprintで描画し,オプションで指定する。 fac1 <- factor(c(rep(1,1), rep(2,2), rep(3,3))) fac2 <- factor(c(rep(1,3), rep(2,2), rep(3,1))) print(histogram(fac1), more=TRUE, split=c(1,1,2,1)) # split=c(行方向の描画位置, 列方向の描画位置,…

グラフィックスの保存と日本語フォントの指定(eps,pdf)

最近のRはフォントを指定しなくても(多分)ちゃんと日本語を出してくれる。 ただ,ゴシックか明朝かを指定したい場合がある。 dev.copy2eps(file="ファイル名.eps", family="Japan1HeiMin") # 他に指定できるのは"Japan1","Japan1HeiMin", # "Japan1Gothi…

latticeパッケージのplotを白黒にする

メモ。白黒かつ背景は透明。 library(lattice) ltheme <- canonical.theme(color = FALSE) ## in-built B&W theme ltheme$strip.background$col <- "transparent" ## change strip bg lattice.options(default.theme = ltheme) ## set as default ソース