Months are colored from red to green by their return. The color limit is the 95th percentile of the absolute returns, so a few extreme months do not wash out the rest.
Arguments
- calendar
Matrix from
monthly_returns().- label
Label of the index for the title, or
NULLfor none.- mode
"light"(the default) or"dark", to suit a light or dark page.
Examples
if (FALSE) { # interactive()
spx <- get_history("S&P 500", as.Date("1950-01-01"))
plot_returns_calendar(monthly_returns(spx), "S&P 500")
}