I have a lot of code to perform some bioinformatics analyis and at some point I need to save some plots. I cannot use ggsave because of the package I am making the plot with, the plots are saved as recordedplot objects. I tried to create a minum reproducible example but I can’t understand what causes it. What i know is that sometimes does not work.
Some examples:
(https://github.com/kevinblighe/CorLevelPlot) this package and this function:
png(file=paste0(output_dir, "mri_correlation_heatmap.png"))
CorLevelPlot(heatmap.data,
x = names(heatmap.data)[(length(heatmap.data)-2):length(heatmap.data)],
y = names(heatmap.data)[1:(length(heatmap.data)-9)],
col = c("blue1", "skyblue", "white", "pink", "red"))
dev.off()
or this (https://github.com/jinworks/CellChat?tab=readme-ov-file)
png(file=paste0(output_dir, name, ".png"))
netAnalysis_contribution(cellchat, signaling = pathways.show)
dev.off()
I know this is not ver helpful in the way that a lot of information is missing, but the point is: this code works, but only when I debug it one line at a time, if I run it withut debugging, it saves a white image. I cannot understand how to try to solve it.
Thank you in advance
edo988811 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.