Hi All, I am trying to plot 4 graphs on to 1 page using layout(...), or par(mfcol = c(...)); with the function QQplot from the package PerformanceAnalytics. The problem is that, no matter what order I use, it only plots 3 graphs on to 1 page and the last QQplot is shunted to the next page. Also, this only happens to the QQplot, i.e. there is no problem with 4 Histograms. set.seed(1033) data <- matrix(rnorm(240), 240, 2) data[,2] <- rt(240, df = 7) tm <- ts(data, start = c(1990, 1), frequency = 12) ret.ts <- as.timeSeries(tm) layout(rbind(c(1, 2), c(3, 4))) #par(mfcol = c(2, 2)) chart.Histogram(ret.ts[, 1], main = "Density", breaks = 30, methods = "add.density") chart.Histogram(ret.ts[, 2], main = "Density", breaks = 30, methods = "add.density") chart.QQPlot(ret.ts[, 1]) chart.QQPlot(ret.ts[, 2]) Any suggestion please. Many thx. Rgds., Will [[alternative HTML version deleted]]
Joshua Ulrich
2011-Mar-25 13:37 UTC
[R] multiple plots with QQplot of PerformanceAnalytics
Please don't cross-post. -- Joshua Ulrich ?| ?FOSS Trading: www.fosstrading.com On Fri, Mar 25, 2011 at 8:33 AM, William Mok <wwl_mok at yahoo.co.uk> wrote:> Hi All, > > I am trying to plot 4 graphs on to 1 page using layout(...), or par(mfcol > c(...)); with the function QQplot from the package PerformanceAnalytics. > The problem is that, no matter what order I use, it only plots 3 graphs on to 1 > page and the last QQplot is shunted to the next page. > Also, this only happens to the QQplot, i.e. there is no problem with 4 > Histograms. > > > set.seed(1033) > data <- matrix(rnorm(240), 240, 2) > data[,2] <- rt(240, df = 7) > > tm <- ts(data, start = c(1990, 1), frequency = 12) > ret.ts <- as.timeSeries(tm) > > layout(rbind(c(1, 2), c(3, 4))) > #par(mfcol = c(2, 2)) > chart.Histogram(ret.ts[, 1], main = "Density", breaks = 30, methods > "add.density") > chart.Histogram(ret.ts[, 2], main = "Density", breaks = 30, methods > "add.density") > chart.QQPlot(ret.ts[, 1]) > chart.QQPlot(ret.ts[, 2]) > > Any suggestion please. Many thx. > > Rgds., > > Will > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >