Add title to correlation chart

Hello,

I made a correlation chart and I would like to add a title.
I did not find any solution to this issue.

Here is my code :

library(PerformanceAnalytics)
chart.Correlation(pm_printps, histogram=TRUE, pch=19,
                  method = c("pearson"))

I tried this :

chart.Correlation(pm_printps, histogram=TRUE, pch=19, 
                  method = c("pearson"), 
                  title ="Pearson correlation")

but this did not work.

Any idea ?

Many thanks !

Marie-Laure

Hi @MLaure19,
There is no "title" argument to the chart.Correlation() function. A work-around is to place the title text in the margin of the plot using mtext(). I have used a built-in data set for this example:

library(PerformanceAnalytics)
data(managers)
chart.Correlation(managers[,1:3])
mtext("My Title Here", side=3, line=3)

HTH

Thanks @DavoWW

It worked great !!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.