heatmaply
heatmaply copied to clipboard
Row labels missing when row_dend_left = TRUE
I am moving the the dendrogram to the lefthand side by setting row_dend_left = TRUE
, but the row labels disappear. Here is a reproducible example:
heatmaply(mtcars, k_col = 2, width = "100%", row_dend_left = TRUE) %>%
layout(xaxis= list(tickangle = 45), margin = list(b = 90))
heatmaply(mtcars, k_col = 2, width = "100%", row_dend_left = FALSE) %>%
layout(xaxis= list(tickangle = 45), margin = list(b = 90))
I have tried adding extra space using margin - list(r = 180)
in case it was just getting cutoff, but nothing shows up still.
Any help would be appreciated.
- Kristen
Hi Kristen, I fear that this parameter is currently not working properly (I should probably remove it for the next release). Sadly, since it appears that ggplot2 does not support placing the Y-axis on the right side of the figures, I don't see a way this ability will be added (unless I'll re-implement the labels text only, but I suspect I won't wish to go down that path soon).
With regards, Tal
Thank you for letting me know.
Hi Tal,
I can confirm the same issue as @kbeck527. I wouldn't recommend removing the row_dend_left = TRUE
feature, as 99.9% of all biological heatmaps I've ever seen have included this dendrogram on the left (and the row labels on the right).
Best regards,
Bohdan
Thanks Bohdan, This is currently a problem to implement since right side axis labels are not implemented in ggplot2. But I'll keep this open for the future in case I'll get to implement this in another way that would solve this (specifically, to add a panel with text that would replace the ggplot2 default labels).
With regards, Tal
Thank you very much, Tal. That would, indeed, be a nice useful addition to your (already) fantastic R package.
Kind regards, Bohdan
This feature may become possible with ggplot v2.2 (scheduled for release very soon): https://blog.rstudio.org/2016/09/30/ggplot2-2-2-0-coming-soon/
Thanks @Alanocallaghan . I've also noticed it when this was announced :)
I am looking forward to see if it can indeed be used. You are welcome to give it a look yourself, the ggplot github reop has that version. I won't get to do it myself in the next two weeks.
With regards, Tal
p.s. @Alanocallaghan : could you please send me your email? (to: [email protected] )
@talgalili
I've made some progress on this and #20, by adding an option to use native plot_ly
functionality (in lieu of ggplotly
). I'll try to do some informal testing and maybe write some formal testthat
tests for the package when I get time and submit a PR.
Feel free to have a look and do some informal testing too if you have time; you can switch to plotly
functionality using the parameter plot_method = "plotly"
- the default is still to use ggplotly
Should clarify this is on my fork https://github.com/Alanocallaghan/heatmaply
This is now possible when using the new option, plot_method = "plotly"
. Hopefully, it will be possible in ggplotly; once this PR is resolved, it will be fixed with plot_method = "ggplot" (currently the default)
Hi @Alanocallaghan How would you make this look o.k.:
library(heatmaply)
heatmaply(mtcars, plot_method = "plotly", row_dend_left = TRUE)
?
(thanks)
I would add left and possibly top margin to the plot. Unfortunately plotly does not dodge legends, but I may have though of a hack/workaround to avoid this.
Try now; I permanently moved the legend off the left side of the plot. It may make more sense to add parameters to move the x and y location, because I don't know if you could design a method that would always dodge all elements without taking up unnecessary amounts of space
I'm off to Pesach dinner. I'll continue this tomorrow :)
Hag Sameach (happy holiday) if you're celebrating one of them (Pesach/easter), Tal
Depends https://github.com/ropensci/plotly/pull/929
Row label is still omitted when the dendrogram is on the left. Is this issue able to be fixed? Thanks!
As noted above, it depends on ropensci/plotly#929 being resolved.
Sorry, I read through that thread too but the current status wasn't clear to me. The most recent comment is over a year old. Thanks.
No worries, I had to check also. Just pinged Carson regarding it - I'd like to contribute but I think it grew in scope far beyond my knowledge of the plotly package. Cheers Alan