Answers.Body: <p>You don't, simple as that, it is too many in both columns and rows to show them all. You could shrink size, but then it becomes unreadable. You can highlight individual genes (rows) that are important to support the message you want to send with that experiment, with packages such as <a href="https://jokergoo.github.io/ComplexHeatmap-reference/book/index.html" rel="nofollow noreferrer">ComplexHeatmap</a>, see the <a href="https://jokergoo.github.io/ComplexHeatmap-reference/book/heatmap-annotations.html#mark-annotation" rel="nofollow noreferrer">Mark annotation</a> section.</p>
  <p>Alternatively, you can use something like hierarchical clustering to form groups, then make functional annotations (such as REACTOME terms) and then annotate eaqch cluster with selected terms, again to support the message you want to send. Go through the ComplexHeatmap manual, lots of examples with code there to get inspiration from.</p>
  <p>As for the columns, you could use <a href="https://jokergoo.github.io/ComplexHeatmap-reference/book/heatmap-annotations.html#block-annotation" rel="nofollow noreferrer">block annotations</a> to color-highlight columns bhelonging to the same experimental group, or split the heatmap by these groups to put some visual separation/guidance.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-31T16:59:54.993Z
Answers.Text: Thank you @ATpoint
Answers.UserDisplayName: Mahendra Singh
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-31T11:01:34.710Z
Answers.LastActivityDate: 2022-12-31T11:01:34.710Z
Answers.UserDisplayName: ATpoint
Answers.Body: <p><em>[note: This is a generic answer; the post was not specific enough for me to be able to include any more useful detail]</em></p>
  <p>A heatmap of 235 rows and 570 columns is within the realm of what should be explorable / visible with a bit of tweaking. I have needed to do this with large heatmap plots - for example, single cell data with 500 genes and 2000 cells, where I care about the genes but not the cell IDs. My usual approach is to make the dimensions of the output image larger, and also reduce the text size.</p>
  <p>The method of doing that depends a lot on how the plot was generated initially. For example, if using a base R package:</p>
  <pre><code>pdf(&quot;output_file_name.pdf&quot;, width=57, height=23.5); # about 10 squares per inch
  ## &lt;plot generation function&gt;
  dev.off()
  </code></pre>
  <p>If using ggplot:</p>
  <pre><code>library(tidyverse);
  input_data %&gt;%
    ggplot() +
    aes(...) +
    # &lt;plot generation function&gt;
  ggsave(&quot;output_file_name.pdf&quot;, width=57, height=23.5);
  </code></pre>
  <p>Changing the function used to display the heatmap can sometimes help as well (e.g. <code>pheatmap</code> instead of <code>heatmap</code>).</p>
  <p>Within the functions, text size can often be reduced to help with this as well (e.g. <code>cex = 0.2</code>). There is a limit to how much this can be done, as most PDF viewing programs have a zoom limit - I think Adobe Reader's limit is 6400% (i.e. 64 times magnification) - as well as maximum page dimension limits.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-07T06:44:13.410Z
Answers.Text: Thank you @gringer♦
Answers.UserDisplayName: Mahendra Singh
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-03T03:42:40.150Z
Answers.Text: This was useful, gringer.
Answers.UserDisplayName: Jamie Watts
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-05T19:44:04.667Z
Answers.LastActivityDate: 2023-01-05T19:49:36.570Z
Answers.LastEditDate: 2023-01-05T19:49:36.570Z
Answers.UserDisplayName: gringer
Body: <p>I have plotted a heat-map with 235 rows and 570 columns which is below: how do we make clear names of row and columns on this graph using R?</p>
  <p><a href="https://i.sstatic.net/9s74d.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/9s74d.png" alt="enter image description here" /></a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-01-01T21:29:36.147Z
Comments.Text: Please show the command you used to create that heatmap. Answers will differ depending on what library / function you're using.
Comments.UserDisplayName: gringer
Tags: <rna-seq><ggplot2>
Title: Display row and column names in R
ThreadText: # Display row and column names in R
  
  (Asked by: username_0 on 2022-12-31)
  
  I have plotted a heat-map with 235 rows and 570 columns which is below: how do we make clear names of row and columns on this graph using R?
  
  [![enter image description here](https://i.sstatic.net/9s74d.png)](https://i.sstatic.net/9s74d.png)
  
  **Tags:** rna-seq, ggplot2
  
  > **Comments:**
  > **username_1**: Please show the command you used to create that heatmap. Answers will differ depending on what library / function you're using.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2022-12-31. Score: 4
  
  You don't, simple as that, it is too many in both columns and rows to show them all. You could shrink size, but then it becomes unreadable. You can highlight individual genes (rows) that are important to support the message you want to send with that experiment, with packages such as [ComplexHeatmap](https://jokergoo.github.io/ComplexHeatmap-reference/book/index.html), see the [Mark annotation](https://jokergoo.github.io/ComplexHeatmap-reference/book/heatmap-annotations.html#mark-annotation) section.
  
  Alternatively, you can use something like hierarchical clustering to form groups, then make functional annotations (such as REACTOME terms) and then annotate eaqch cluster with selected terms, again to support the message you want to send. Go through the ComplexHeatmap manual, lots of examples with code there to get inspiration from.
  
  As for the columns, you could use [block annotations](https://jokergoo.github.io/ComplexHeatmap-reference/book/heatmap-annotations.html#block-annotation) to color-highlight columns bhelonging to the same experimental group, or split the heatmap by these groups to put some visual separation/guidance.
  
  > **Comments:**
  > **username_0**: Thank you @username_2  
  
  ---
  
  ### Answer by username_1 on 2023-01-05. Score: 2
  
  *[note: This is a generic answer; the post was not specific enough for me to be able to include any more useful detail]*
  
  A heatmap of 235 rows and 570 columns is within the realm of what should be explorable / visible with a bit of tweaking. I have needed to do this with large heatmap plots - for example, single cell data with 500 genes and 2000 cells, where I care about the genes but not the cell IDs. My usual approach is to make the dimensions of the output image larger, and also reduce the text size.
  
  The method of doing that depends a lot on how the plot was generated initially. For example, if using a base R package:
  
  ```
  pdf("output_file_name.pdf", width=57, height=23.5); # about 10 squares per inch
  ## <plot generation function>
  dev.off()
  
  ```
  
  If using ggplot:
  
  ```
  library(tidyverse);
  input_data %>%
    ggplot() +
    aes(...) +
    # <plot generation function>
  ggsave("output_file_name.pdf", width=57, height=23.5);
  
  ```
  
  Changing the function used to display the heatmap can sometimes help as well (e.g. `pheatmap` instead of `heatmap`).
  
  Within the functions, text size can often be reduced to help with this as well (e.g. `cex = 0.2`). There is a limit to how much this can be done, as most PDF viewing programs have a zoom limit - I think Adobe Reader's limit is 6400% (i.e. 64 times magnification) - as well as maximum page dimension limits.
  
  > **Comments:**
  > **username_0**: Thank you @username_1♦  
  > **username_3**: This was useful, username_1.  
  
  ---
  
  