2017-08-03 37 views
5

jupyterノートブックでRを使うと、最初にプロットサイズを普遍的に設定します。次に、異なるサイズの1つのプロットをプロットしたいと思います。R - jupyterでのggplotプロットサイズの変更

## load ggplot2 library 
library("ggplot2") 
## set universal plot size: 
options(repr.plot.width=6, repr.plot.height=4) 

## plot figure. This figure will be 6 X 4 
ggplot(iris, aes(x = Sepal.Length, y= Sepal.Width)) + geom_point() 

## plot another figure. This figure I would like to be 10X8 
ggplot(iris, aes(x = Sepal.Length, y= Sepal.Width)) + geom_point() + HOW DO i CHANGE THE SIZE? 

あなたが見ることができるように、私は10X8する2番目のプロット(とのみ2番目のプロット)を変更したいと思います。これはどうすればいいですか?

Rstudioではプロットのサイジングが問題ではないため、申し訳ありません。ここで

答えて

4

あなたが行く:

library(repr) 
options(repr.plot.width=10, repr.plot.height=8) 
ggplot(iris, aes(x = Sepal.Length, y= Sepal.Width)) + 
    geom_point() 
+0

'ライブラリ(のrepr)'の部分は私のために不必要でした – eddi

関連する問題