Question: [How to Save plots in R] DiffBind
gravatar for chiefcat
2.9 years ago by
chiefcat150 wrote:


I'm trying to use a R package for the first time.

Does anyone know how to save/ export a plot (e.g. heatmap) in DiffBind?

Example: in there example ( Heatmap was generated by




What should I add in order to save the plot directly from the command? Thanks!!

chip-seq diffbind R • 1.8k views
ADD COMMENTlink modified 2.9 years ago by Rory Stark730 • written 2.9 years ago by chiefcat150

This doesn't look like a bioinformatics question to me and might get closed for that reason. Meanwhile, try this:

ADD REPLYlink written 2.9 years ago by WouterDeCoster44k

Additionally, using RStudio will let you see your plots, adjust any plotting settings, and then save them as an image quite easily. Useful if you think you're going to have to mess with your figures repeatedly or if you want to view dataframes, etc directly in a table format.

Won't work on a headless server though, obviously.

ADD REPLYlink written 2.9 years ago by jared.andrews076.4k
gravatar for Rory Stark
2.9 years ago by
Rory Stark730
University of Cambridge, Cancer Research UK - Cambridge Institute
Rory Stark730 wrote:

The comment above is the correct answer to the question. Before plotting, call one of the functions that redirects the plot to a file, such as jpeg(), pdf(), or png(). After plotting, call to close the file. You can do multiple plots before calling and they will all end up in the same file.

ADD COMMENTlink written 2.9 years ago by Rory Stark730

Hi @Rory, How can we save an image from DiffBind with 300 dpi resolution.

I tried

tiff(file = "final.tiff", units = "px", res = 300)

but got an error:

Error in : figure margins too large.

Can you please help?


ADD REPLYlink modified 11 months ago • written 11 months ago by Researcher50
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1747 users visited in the last hour