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 8727209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:23:48+00:00 2026-06-13T08:23:48+00:00

As the above screenshot showed, I used the function heatmap.2() here. how can I

  • 0

enter image description here

As the above screenshot showed, I used the function heatmap.2() here.

how can I change ‘Value‘ in the color coded bar to any other name?

One can just use the data from gplots package:

 library(gplots)

 data(mtcars)

 x  <- as.matrix(mtcars)

 rc <- rainbow(nrow(x), start=0, end=.3)

 cc <- rainbow(ncol(x), start=0, end=.3)

 heatmap.2(x, key=TRUE)

Many thanks 🙂

  • 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-13T08:23:49+00:00Added an answer on June 13, 2026 at 8:23 am

    It’s hard-coded. You will need to change it in the code. It appears about midway down the section that draws the key and the line is:

    else mtext(side = 1, "Value", line = 2)
    

    This is the section of the heatmap.2 code that creates the key (at least up to the point where the word “Value” appears) :

     if (key) {
            par(mar = c(5, 4, 2, 1), cex = 0.75)
            tmpbreaks <- breaks
            if (symkey) {
                max.raw <- max(abs(c(x, breaks)), na.rm = TRUE)
                min.raw <- -max.raw
                tmpbreaks[1] <- -max(abs(x), na.rm = TRUE)
                tmpbreaks[length(tmpbreaks)] <- max(abs(x), na.rm = TRUE)
            }
            else {
                min.raw <- min(x, na.rm = TRUE)
                max.raw <- max(x, na.rm = TRUE)
            }
            z <- seq(min.raw, max.raw, length = length(col))
            image(z = matrix(z, ncol = 1), col = col, breaks = tmpbreaks, 
                xaxt = "n", yaxt = "n")
            par(usr = c(0, 1, 0, 1))
            lv <- pretty(breaks)
            xv <- scale01(as.numeric(lv), min.raw, max.raw)
            axis(1, at = xv, labels = lv)
            if (scale == "row") 
                mtext(side = 1, "Row Z-Score", line = 2)
            else if (scale == "column") 
                mtext(side = 1, "Column Z-Score", line = 2)
            else mtext(side = 1, "Value", line = 2)
     .... lots more code below
    

    You should type heatmap.2 , then copy the source code to an editor and then use the search function to find “Value”. Change “Value” to something else (in quotes) and then type heatmap.2 <- and paste in the code and hit return. (Unless you save this it will only persist as long as the session continues.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone explain the weird presentation behavior in the UI screenshot above? As you
Here is a screenshot of the problem: Chrome/Firefox. An unexpected margin appears above the
Screenshot: As can be seen in the picture above for some reason I get
Is there any way other than thumbnail method to take a screenshot of an
Above is my schema. What you can't see in tblPatientVisits is the foreign key
In regards to the above and/or including other methods, if you are searching for
![alt text][1] The above screenshot shows some artifacting which is occuring during a software
Please have a look at the screenshot above, the string for the text is
I used to post image with text in it. These are generally a screenshot.
I am using UITextView in above screenshot. But problem is when I am trying

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.