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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:52:54+00:00 2026-05-25T11:52:54+00:00

How do I make a heatmap with the Y axis labels on the left?

  • 0

How do I make a heatmap with the Y axis labels on the left? It seems to default to the right. Do I need to make a custom axis using axis()?

  • 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-05-25T11:52:54+00:00Added an answer on May 25, 2026 at 11:52 am

    In the heatmap function the positions of the axes are hard-coded. But it would be very easy to change just a single number to get it positioned on the other side. Type “heatmap” at your console and change the first argument from a 4 to a 2 in the second axis() call.

    All I changed was:

    axis(2, iy, labels = labRow, las = 2, line = -0.5, tick = 0,  # the 2 used to be 4
             cex.axis = cexRow)
    

    There still need to be changes in the margins to accommodate the switch. Changing the current value of 0 to 5 seemed to create adequate space in the example I was playing with from the help page:

    ...
    par(mar = c(margins[1L], 5, 0, margins[2L]))
    

    This was my test case:

    x  <- as.matrix(mtcars)
    rc <- rainbow(nrow(x), start=0, end=.3)
    cc <- rainbow(ncol(x), start=0, end=.3)
    utils::str(hv) # the two re-ordering index vectors
    
    ## no  dendrogram (nor color strip)
    heatmap.new(x, Colv = NA, Rowv=NA, col = cm.colors(256), scale="column",
            margins=c(5,2),
            xlab = "specification variables", ylab= "Car Models",
            main = "heatmap(<Mtcars data>, ..., scale = \"column\")")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

make is not only useful for building your programming project, but it seems to
I make a lot of web applications and from time to time I need
For my Windows Phone Mango app, I want to make overlay a heatmap on
I make the deployment site with TeamCity. Today there is a need to deploy
I'm using pygame (1.9.0rc3, though this also happens in 1.8.1) to create a heatmap.
make C++ functions or structs, classes (using meta-programming) determining maximum value for signed and
To make it more specific, I need an algorithm (recursive or not) that, given
I'm using R to create a heatmap from a matrix using heatmap.2 - and
I make an ajax request using jquery, this calls the following spring controller: @RequestMapping(value
I am writing a script to make a heatmap for scatter data on two

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.