when I generate pheatmap to file using do.call the bottom of the legend is not printed (but visible when not using the file output)
How can I add margins when plotting to file? I tried par() but it does not influence the plotting to file apparently...
Here is my code working for the first live plot but cutting the second in the legend.
# prepare output
filename <- pastesig.name,"-signature-heatmap.pdf",sep="")
outfile <- paste(basedir, filename, sep="/")
main.title <- pastesig.name,"signature", sep=" ")
# color pallet
col.pal <- brewer.pal(9,"Blues")
# define metrics for clustering
drows <- "euclidean"
dcols <- "euclidean"
clustmet <- "average"
# create heatmap
# type "?pheatmap()" for more help
hm.data <- log(selection[,2:length(selection)], 2)
hm.parameters <- list(hm.data,
color = col.pal,
fontsize = 8,
cellwidth = 12, cellheight = 12, scale = "none",
treeheight_row = 200,
kmeans_k = NA,
show_rownames = T,
show_colnames = T,
main = main.title,
clustering_method = clustmet,
cluster_rows = TRUE,
cluster_cols = TRUE,
clustering_distance_rows = drows,
clustering_distance_cols = dcols)
# To draw the heatmap on screen (comment-out if you run the script from terminal)
do.call("pheatmap", hm.parameters)
# To draw to file
do.call("pheatmap", c(hm.parameters, filename=outfile))