2011-11-11 13 views
9

私はggplotグラフを作成した後、theme_get()を使用してすべてのテーマ要素の詳細を返すことができます。これは、strip.text.xなどのようなものを見つけるのに非常に役立ちました。しかし、私は理解できない2つのことがあります:異なる要素のggplotフォントサイズ

1)次のggplotグラフィックでは、「ウッドチャックでチャックされた木の割合」というフレーズを表すテーマ項目の名前は何ですか?私は、y軸のラベルを再フォーマットするにはどうすればよい

enter image description here

2)を読むために、10%、20、...の代わりに0.1、0.2の、...

答えて

4

(2)何をしたいことはformatterを使用することである場合:

dat <- data.frame(x=1:10,y=1:10) 

#For ggplot2 0.8.9  
ggplot(dat,aes(x = x/10,y=y/10)) + 
    geom_point() + 
    scale_x_continuous(formatter = "percent") 

#For ggplot2 0.9.0  
ggplot(dat,aes(x = x/10,y=y/10)) + 
    geom_point() + 
    scale_x_continuous(labels = percent_format()) 

enter image description here

7

の場合:大きなフォントへ1)であれば、$axis.title.y

p + theme(axis.title.x = element_text(size = 25)) 

ここで、pは既存のggplotオブジェクトです。

私は約2)手を知らない。

関連する問題