Print high quality plots in R when manipulating plot interactively -


i need print haplotype network png in high quality. however, plot way want it, need change things using interactive function. when use png() print plot, i'm not able make these changes, because prints pdf rather plot window. there way change print plot window png?

a reproducible example of plot:

install.packages("pegas") library(pegas) data(woodmouse) net <- haplonet(haplotype(woodmouse)) plot(net) o <- replot() # interactive ## click rearrange network @ will... ## different plot using same coordinates: plot(net, bg = "red", labels = false, show.mutation = 2) replot(o) # not interactive 

i don't want use export button in rstudio because graphs produces of low quality.

you can save current plot variable using recordplot(), change graphic device png , replay saved plot using replayplot. example:

#same data above o <- plot(net, bg = "red", labels = false, show.mutation = 2) replot() # interactive - thing  myplot <- recordplot() png("recordedplot.png") replayplot(myplot) dev.off() 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -