如何更改 RStudio 中 PerformanceAnalytics 包生成的绘图的大小(宽度和高度)?
How to change size (width & height) of a plot produced by PerformanceAnalytics package in RStudio?
代码如下:
charts.PerformanceSummary(dret_data, main='Portfolio Performance',
Rf=0.015/252, plot.engine='default')
情节在笔记本中看起来是压缩的,下面是片段(我想把它放大):
在查看文档时,没有提到任何关于绘图大小调整的内容:
?charts.PerformanceSummary
有没有办法以某种方式解决这个问题并控制 R 笔记本中 performanceAnalytics 包中绘图的宽度和高度?
如果您将 RStudio 笔记本用于代码和输出,则需要调整块(或文档)选项中的 fig.width and/or fig.height。
下面是fig.height3和5的区别:
```{r fig.height=3}
library(PerformanceAnalytics)
charts.PerformanceSummary(managers)
```{r fig.height=5}
library(PerformanceAnalytics)
charts.PerformanceSummary(managers)
编辑:
放大标题:
# Keep original par settings for later
opar <- par()
#change cex.main to whatever you want. Normal is 1.2 I think
par('cex.main' = 2)
#Plot now has larger title
charts.PerformanceSummary(managers)
# reset par settings
par(opar)
代码如下:
charts.PerformanceSummary(dret_data, main='Portfolio Performance',
Rf=0.015/252, plot.engine='default')
情节在笔记本中看起来是压缩的,下面是片段(我想把它放大):
在查看文档时,没有提到任何关于绘图大小调整的内容:
?charts.PerformanceSummary
有没有办法以某种方式解决这个问题并控制 R 笔记本中 performanceAnalytics 包中绘图的宽度和高度?
如果您将 RStudio 笔记本用于代码和输出,则需要调整块(或文档)选项中的 fig.width and/or fig.height。
下面是fig.height3和5的区别:
```{r fig.height=3}
library(PerformanceAnalytics)
charts.PerformanceSummary(managers)
```{r fig.height=5}
library(PerformanceAnalytics)
charts.PerformanceSummary(managers)
编辑:
放大标题:
# Keep original par settings for later
opar <- par()
#change cex.main to whatever you want. Normal is 1.2 I think
par('cex.main' = 2)
#Plot now has larger title
charts.PerformanceSummary(managers)
# reset par settings
par(opar)