I’m using xtsExtra to plot two xts objects.
Consider the following call to plot.xts:
plot.xts(merge(a,b),screens=c(1,2))
which is used to plot the xts objects a and b in two separate panels.
How do I control the spacing of the y-axes? Specifically, I’m running into the problem where the y-axis labels come too close or even overlap.
Ideally, I would like to specify a minimum padding which is to be maintained between the two y-axis labels. Any help is appreciated!
EDIT: A reproducible example:
#install if needed
#install.packages("xtsExtra", repos="http://R-Forge.R-project.org")
library(xtsExtra)
ab=structure(c(-1, 0.579760106421202, -0.693649703427259, 0.0960078627769613,
0.829770469089809, -0.804276208608663, 0.72574639798749, 0.977165659135716,
-0.880178529686181, -0.662078620277974, -1, 2.35268982675599,
-0.673979231663719, 0.0673890875594205, 1.46584597734824, 0.38403707067242,
-1.53638088345349, 0.868743976582955, -1.8394614923913, 0.246736581314485
), .Dim = c(10L, 2L), .Dimnames = list(NULL, c("a", "b")), index = structure(c(1354683600,
1354770000, 1354856400, 1354942800, 1355029200, 1355115600, 1355202000,
1355288400, 1355374800, 1355461200), tzone = "", tclass = "Date"), class = c("xts",
"zoo"), .indexCLASS = "Date", .indexTZ = "", tclass = "Date", tzone = "")
plot.xts(ab,screens=c(1,2))
which produces:

Sorry this took so long. I was trying to figure out why my graph starts at Dec 04, 2012 and ends at Dec 13, 2012, when yours starts at Dec 05, 2012 and ends at Dec 14 2012. Can you check to make sure that the
abyou posted above is the sameabyou used to plot your graph?Also, I used library
xtsinstead ofxtsExtra. Is there a reason to usextsExtra?Here’s the code: