Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8692409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:18:30+00:00 2026-06-13T00:18:30+00:00

I’m trying to plot a huge matrix of correlation coefficients, and currently, my plot

  • 0

I’m trying to plot a huge matrix of correlation coefficients, and currently, my plot looks like this:
Notice that some cells are missing correlation coefficients

Notice that some cells are missing correlation coefficients (ignore for now that lack of symmetry of the plot, unless you happen know why that’s the case, too). I believe that the values are not, in fact, missing, but simply too small to appear, because they are scaled by the value of their correlation coefficient.

Looking at the documentation for chart.Correlation(), I was able to find a function from which much of the content of chart.Correlation() was modeled:

panel.cor <- function(x, y, digits=2, prefix="", cex.cor)
{
    usr <- par("usr"); on.exit(par(usr))
    par(usr = c(0, 1, 0, 1))
    r <- abs(cor(x, y))
    txt <- format(c(r, 0.123456789), digits=digits)[1]
    txt <- paste(prefix, txt, sep="")
    if(missing(cex.cor)) cex <- 0.8/strwidth(txt)    
    test <- cor.test(x,y)
    # borrowed from printCoefmat
    Signif <- symnum(test$p.value, corr = FALSE, na = FALSE,
                  cutpoints = c(0, 0.001, 0.01, 0.05, 0.1, 1),
                  symbols = c("***", "**", "*", ".", " "))

    text(0.5, 0.5, txt, cex = cex * r)
    text(.8, .8, Signif, cex=cex, col=2)
}
pairs(USJudgeRatings[,c(2:3,6,1,7)], lower.panel=panel.smooth, upper.panel=panel.cor)

If I change:

text(0.5, 0.5, txt, cex = cex * r)

To:

text(0.5, 0.5, txt, cex = 0.8)

I get roughly the effect I’m looking for. The problem is that I have no idea how to change this parameter using chart.Correlation() itself. Does issue this make sense?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:18:31+00:00Added an answer on June 13, 2026 at 12:18 am

    Here’s a hack that modifies the function to allow what you want. This adds a user-settable exponent argument to the function that allows you to change the cex value to cex*[correlation]^cex.cor.scale.

    It spits out warnings because of the way ... is handled; they’re annoying but harmless.

    It would probably be best to contact the maintainer and ask them if they’d be willing to enhance the function, or start creating your own modified version of the package.

    edit: slightly more robust changes to the relevant lines

    library("PerformanceAnalytics")
    ## turn the function into a character string
    tmpstr <- deparse(chart.Correlation)
    ## modify the relevant lines
    panelcorline <- grep("^ *panel.cor",tmpstr)
    tmpstr[panelcorline] <- paste(tmpstr[panelcorline],"cex.cor.scale=1,")
    rscaleline <- grep("^ *text\\(0.5",tmpstr)
    tmpstr[rscaleline] <- gsub("cex \\* r","cex*r^cex.cor.scale",tmpstr[rscaleline])
    ## convert back to a function (don't mask the original function)
    my.chart.Correlation <- eval(parse(text=tmpstr))
    

    Test it out:

    data(managers)
    chart.Correlation(managers[,1:8], histogram=TRUE, pch="+")
    ## no scaling
    my.chart.Correlation(managers[,1:8], histogram=TRUE, pch="+",cex.cor.scale=0)
    ## enhanced scaling
    my.chart.Correlation(managers[,1:8], histogram=TRUE, pch="+",cex.cor.scale=2)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I've got a string that has curly quotes in it. I'd like to replace
I am trying to render a haml file in a javascript response like so:
I would like to run a str_replace or preg_replace which looks for certain words
I know there's a lot of other questions out there that deal with this
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.