joshuaulrich/xtsExtra

[R-Forge #5871] plot2.xts - fix title and label compression in multi.panel plots

Closed this issue · 1 comments

Submitted by: Peter Carl
Assigned to: Nobody
R-Forge link

The plot title and the panel titles in multi.panel plots are cut off when the geometry is reset.

The main title should be completely unaffected by the number of panels appearing, but that area appears to be reduced in size.

Panel titles seem to extend above the plot area allowed, as well.

pcc

Followups:

Date: 2014-08-30 15:46
Sender: Ross Bennett
fixed in commit r837

Date: 2014-08-14 20:29
Sender: Peter Carl
This may or may not be helpful, but in base graphics I use the following to place text into multiple panel plots:

add_label <- function(xfrac, yfrac, label, pos = 4, ylog, ...) {
  u <- par('usr')
  x <- u[1] + xfrac * (u[2] - u[1])
  y <- u[4] - yfrac * (u[4] - u[3])
  if(ylog)
    text(x, 10^y, label, pos = pos, ...)
  else
    text(x, y, label, pos = pos, ...)
}

I can then place the label with:
add_label(0.01, 0.10, label = labels[i], cex = 1, col=text.col, ylog=ylog)

The ylog argument allows the correct placement when the y axis is a log axis.

HTH,

pcc

Fixed in commit r837. There is only so much that can be done with the geometry of multiple panels in and how many panels can be in a single plot