r - Display four lineChart() in different windows or simultaneously in R and ESS, quantmod
问题描述
How can I display these four lineChart() simultaneously or in one window ?
Having this code in one file:
library(quantmod)
getSymbols("XPT/USD",src="oanda")
getSymbols("XAU/USD",src="oanda")
lineChart(XAUUSD, subset='2018-03::2018-03')
lineChart(XAUUSD, subset='2018-04::2018-04')
lineChart(XPTUSD, subset='2018-03::2018-03')
lineChart(XPTUSD, subset='2018-04::2018-04')
When I evaluate the buffer it displays only the last lineChart.
Is this a property of ESS ? I want to clarify that I need the four graphs separately.
解决方案
quantmod 绘图功能,虽然很好,很强大,但不会尊重par(c(mfrow()))
或同样好(但鲜为人知layout()
),所以你必须创建新的绘图设备 - 通过x11()
或window()
- 并通过你的操作系统/窗口管理器安排它们.
为了我:
R> x11(); lineChart(XAUUSD, subset='2018-03::2018-03')
R> x11(); lineChart(XAUUSD, subset='2018-04::2018-04')
R> x11(); lineChart(XPTUSD, subset='2018-03::2018-03')
R> x11(); lineChart(XPTUSD, subset='2018-04::2018-04')
产生
并注意这是四个不同的窗口。参见dev.new()
anddev.next()
和那些函数。
推荐阅读
- swiftui - 来自 Data SwiftUI 的基于列表的视图
- vb.net - 如何按字母对组合框中的项目进行排序
- ruby-on-rails - 如何在 Rails 中共享多个路由的条件重定向逻辑?
- angular - Angular 9 Ivy - 通用类型 'ɵɵFactoryDef' 需要 2 个类型参数
- r - 无法在 R 中的地理地图上覆盖县?
- javascript - 如何在来自api的reactjs中添加所有产品数量
- html - 移动布局中显示更多宽度
- angular - 离子角度服务器端渲染中未定义 self
- json - 我们如何在freshservice webservice的响应体中获取JSON内容?
- php - Laravel 图片上传问题