How to save a better resolution graphs from viewer pane

I used heatmaply and argument worked well. I know the plot saves in the "Viewer" tab. The resolution of the plot is too low.
Is there any way to save a high resolution plot from the viewer pane?
Also I used below mentioned code to change the colour of the plot, but it didn't work.

scale_fill_gradient_fun = scale_color_gradient(low = "#ddebe8", high = "#02362b",
space = "Lab", na.value = "grey50", guide = "colourbar", aesthetics = "colour")

What is wrong with this code?

Can you provide the full code including a reproducible example ?

Hi @ssumd,
If you are making your heat map with ggplot, then check out the ggsave() function which allows you to define the size of the graphic and the resolution when writing the file to disk (using code rather than the "Viewer").
HTH

Hi @JossChavez ,
Here is the full code.
heatmaply(y, Rowv = FALSE,Colv = FALSE, row_text_angle = 0,
column_text_angle = 90, fontsize_row = 11,
fontsize_col = 11,colorbar_thickness = 20, xlab = "Seasons", ylab = "Species",
scale_fill_gradient_fun = scale_color_gradient(low = "#ddebe8", high = "#02362b",
space = "Lab", na.value = "grey50", guide = "colourbar", aesthetics = "colour"))

Hi @DavoWW,
Thanks for the reply. I tried this code
ggsave(filename = p, plot = last_plot(), device = NULL, path = NULL,
scale = 1, width = NA,
height = NA,
dpi = 300)
and it did not work. The error message was
Error: device must be NULL, a string or a function.

Hi @ssumd,
Since your graphic is created using plotly it appears that saving it as a static file is non-trivial, as I found out when I Googled "save plotly object to image file in R".
Sorry I can't be more help.

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.