joshuaulrich/xtsExtra

[R-Forge #5872] plot2.xts - separate chart title from panel titles in multi.panel

Closed this issue · 1 comments

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

Currently the column name of the first column is used as the chart title in a multi.panel chart. In the panels below that, the column names are used as panel titles.

Instead, the chart title should be determined in the same way it is in a single panel chart. The first panel would be like those below it, in that it would have a panel title determined from the column name.

In the example attached, the chart title should be 'Cumulative Returns'; the first panel title would be 'Convertible Arbitrage'.

Followups:

Date: 2014-09-01 01:48
Sender: Ross Bennett
I don't know of a way to keep the header panel size from moving. I'm not sure this is possible since all the panels are sized based on aspect ratio.

Date: 2014-08-31 19:05
Sender: Peter Carl
Also, the label for 'main' and the first sub-panel should be different; currently they are the same.

For example, in:

plot2_xts(R, multi.panel=TRUE, yaxis.same=TRUE, type='h')

The 'main' title is 'Convertible Arbitrage' as is the first sub-title. The main title should be 'R' or whatever.

Date: 2014-08-31 18:16
Sender: Peter Carl
That works, thanks, but here are a couple of thoughts...

This behavior should probably be the same whether in multi.panel mode or not. For example, when calling:

plot2_xts(R, FUN='CumReturns', panels = c('addReturns(type='h')', 'addDrawdowns()'))

The subtitles remain above the plot. Also, that top panel is missing a subtitle.

That particular plot (with the drawdowns panel) is making me think that having the titles above the plot is preferable even in multi-panel because the label doesn't tangle with the data.

Is there a way to keep that whitespace that contains the subtitle from compressing when panels are added? In essence, when a panel is added the buffer wouldn't change size but the plot area would...

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

fixed in commit r837