Cairo - アールメカブ

アールメカブ


Cairo

Rの備忘録

自分で R をコンパイルする場合,以下が必要

sudo apt-get install libcairo2-dev
sudo apt-get install libxt-dev

ライブラリをインストール

install.packages("Cairo")
library(Cairo)

# フォントの確認

CairoFontMatch(font = "gothic")

# つかえるフォントは

$  fc-list 

# フォントの設定 例えば

CairoFonts(
  regular="IPA P明朝,IPAPMincho:style=Regular",
  bold="IPA Pゴシック,IPAPGothic:style=Regular,Bold",
  italic="IPA P明朝,IPAPMincho:style=Regular,Italic",
  bolditalic="IPA Pゴシック,IPAPGothic:style=Regular,Bold Italic,BoldItalic")
CairoFonts(regular="VL ゴシック,VL Gothic:style=regular")
CairoFonts(regular="IPA P明朝,IPAPMincho:style=Regular")
# CairoFonts(regular="VL Gothic:style=regular")

# ディスプレイに表示

CairoX11()
biplot(res.pc, cex = 1.2)

# PDF PS を作成 # パスは絶対パス,チルダやドットは使えない

CairoPDF(file = "hoge.pdf")
biplot(res.pc, cex = 1.2)
dev.off()
CairoPS(file = "Fig1.6", bg="white")
dev.off()

# 他に CairoPNG CairoPS などの関数もある

?Cairo
 
Link: R_old_tips3(1745d) Rの備忘録(3782d)
Last-modified: 2010-07-02 (金) 16:30:10 (5047d)