ggtree icon indicating copy to clipboard operation
ggtree copied to clipboard

Feature Request: Adding text/values to gheatmap layers

Open ghost opened this issue 6 years ago • 5 comments

Hi there,

I would find very useful if it would be possible to add values to gheatmap cells. The gheatmap function allows to easily display a matrix of cells colored from values taken in a dataframe. However, I can't find a way to display the values from which the colors are drawn. As an example, the regular heatmap.2 function include the "cellnote =" argument which read a list of strings that will be displayed within each color cell.

Looking forward to hear back from this suggestion. Let me know if this require more details.

All the best, and thanks for the great work you guys are doing.

Adrien

ghost avatar Oct 24 '18 09:10 ghost

For gheatmap to automatically add text label, there are some issues need to be considered:


Currently you can use the methods introduced in https://github.com/GuangchuangYu/plotting_tree_with_data.

What you need is using facet_plot to visualize heatmap by geom_tile and text by geom_text.

GuangchuangYu avatar Oct 29 '18 02:10 GuangchuangYu

Hi @GuangchuangYu ,

Thank you for creating a wonderful package ggtree.

After 3 years, I also have the same question as @ghost. I have created a heatmap using gheatmap and I want fill my cells with values (numbers in my case). Can please redirect how we can use ggfittext or any other to achieve the same.

Thanks in advance.

ramadatta avatar Oct 28 '21 02:10 ramadatta

I would say that this issue was solved in the ggtreeExtra package, see examples in https://github.com/YuLab-SMU/plotting-tree-with-data-using-ggtreeExtra.

GuangchuangYu avatar Oct 28 '21 03:10 GuangchuangYu

Hi there,

I actually am looking to do this same thing as ghost and ramadatta, but I'm not sure what examples you're referring to in https://github.com/YuLab-SMU/plotting-tree-with-data-using-ggtreeExtra ?

goeckeritz avatar Mar 16 '24 23:03 goeckeritz