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

  • SEARCH
  • Home
  • 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 8042009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:25:27+00:00 2026-06-05T04:25:27+00:00

The heatmap function in R is supposed to help a human being interpret the

  • 0

The heatmap function in R is supposed to help a human being interpret the relative values of the elements of a matrix. However, it seems not to color cells consistently within a given plot, which is a severe obstacle to interpreting the relative values correctly.

For example, let’s generate some data by concatenating columns of normal random variates:

foo <- cbind(replicate(10,rnorm(10)))

Now if we correlate the columns of foo, we can verify that we get 1’s in the diagonal entries since the correlation of any column with itself is 1:

cor.matrix <- cor(foo)

But when we plot:

heatmap(cor.matrix,Rowv=NA,Colv=NA)

(we’re suppressing the dendrogram reording here, although that doesn’t seem to matter)

the diagonal cells are not colored uniformly, as you can see: here

Can anyone explain what’s happening here?

  • 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-05T04:25:28+00:00Added an answer on June 5, 2026 at 4:25 am

    By default heatmap scales by “row”.

    heatmap(cor.matrix,Rowv=NA,Colv=NA, scale="none")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently trying to set up a heatmap of a matrix and highlight
I am making an heatmap using R and the function levelplot() from lattice. The
Here is data: set.seed(123) mat <- matrix(rnorm(5000, 0.5, 0.2), 50) heatmap (mat) mat[mat >
Consider a matrix whose values are all in the real interval [0,1]. I am
My question is almost exactly similar to this one . However , I'm not
heatmap.2 defaults to dist for calculating the distance matrix and hclust for clustering. Does
I have following matrix wanted to create heatmap in R E1 E2 P1 P2
I'm using R to create a heatmap from a matrix using heatmap.2 - and
I have a dendrogram plotted on a heatmap. How can I select and color
I'm trying to reproduce the heatmap presented on this blog by following their tutorial,

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.