Closed chabrault closed 5 years ago
Sorry @chabrault I missed this. Can you post some example code please? I'd be happy to help in that case.
# Create 2 matrices to plot
set.seed(1)
mat1 <- matrix(ncol=100, nrow=5, 0)
random.row <- sample(1:5, size=4, replace=TRUE)
random.col <- sample(1:100, size=20, replace=TRUE)
mat1[random.row, random.col] <- 1
set.seed(2)
mat2 <- matrix(ncol=100, nrow=5, 0)
random.row <- sample(1:5, size=4, replace=TRUE)
random.col <- sample(1:100, size=20, replace=TRUE)
mat2[random.row, random.col] <- 1
# Plot
library(heatmaply)
(plot.mat1 <- heatmaply(mat1, dendogram="none", Rowv=NA, Colv=NA, showticklabels = c(F,T),
col=c("lavender", "turquoise"), scale="none",
node_type = "scatter", grid_size = 3, hide_colorbar = TRUE))
(plot.mat2 <- heatmaply(mat2, dendogram="none", Rowv=NA, Colv=NA, showticklabels = c(F,T),
col=c("orange", "brown"), scale="none",
node_type = "scatter", grid_size = 3, hide_colorbar = TRUE))
# Plot together
subplot(plot.mat1, plot.mat2, nrows=2)
Some code to produce 2 matrices which look like mine. I'd like to put a legend box for colors I used (lavender, turquoise, orange and brown) and to change the point shape (I can only change the size with grid_size, the shape is always a crescent).
Thank you !
Thanks! This is indeed possible within plotly and/or heatmaply but not necessarily straightforward. I'll try to put together a code example and if possible expose the functionality within heatmaply directly. Cheers
Although I would note that for me, the shape is a circle. Perhaps the window is so small that the circles overlap?
Are there plans to introduce this to heatmaply? If not, can we close this issue?
I think it's quite tricky as we'd have to pass in extra data to map to point shape etc. It also seems a bit of a niche application. I'd vote close but happy to see re-opened for a PR
Hello, I'm using heatmaply with node_type="scatter".
The type of point is half circle and I don't know how to change it. I can only change the size by grid_size.
I'm doing several different plots with different colors corresponding to factor parameters. I've set colors manually in "col" parameter according to that. I'd like to print a legend box where I can put the same colors and some text. Is it possible to do that inside the function or do I have to use layout function from plotly ?
Thank you for your function and sorry if the issue is not correctly written, I'm quite new on Github.
Best,
Charlotte