0

I successfully created a script which produces a nice plot in RStudio:

abscissa = nrow(LoopVariable) library(plotrix) plotCI(1:abscissa, LoopVariable[ ,13], uiw=LoopVariable[ ,"F_corrected_normed_error"], err="y", main=(LoopVariable[1,"Samples..Sample_ID"]), xlab="", ylab="correct Y axis", pch=19) abline(h=LoopVariable[1,"mean_fraction-modern"], lwd=2, col="red") mtext("no additional error added")

So far so good. Then I wrote this code:

png(filename=paste0("I:/C14Data/QualityControl/Johannes/code_output/", RNumberList[i], "_", date, " (R#_yyyy-mm-dd_hh-mm-ss).png"), type="cairo", units="cm", width=abscissa, height=10, pointsize=12, res=96) plotCI(1:abscissa, LoopVariable[ ,13], uiw=LoopVariable[ ,"F_corrected_normed_error"], err="y", main=(LoopVariable[1,"Samples..Sample_ID"]), xlab="", ylab="fraction modern", pch=19) dev.off() This exports a png file just as I want it, BUT: How can I add the following two lines to the export function and get it to look excactly the same as the previous code?: abline(h=LoopVariable[1,"mean_fraction-modern"], lwd=2, col="red") mtext("no additional error added")

Johannes
  • 69
  • 1
  • 7
  • 1
    What exactly is wrong when you just add those two lines? Do you not know where to add them? You should just put them in before the `dev.off()`. – MrFlick Sep 01 '14 at 03:40
  • Thanks `@MrFlick'. I tried this before and it did not work. Perhaps I need to restart RStudio more frequently. – Johannes Sep 01 '14 at 03:43
  • 4
    What does "did not work" mean exactly? Did you get an error? Was a file not created at all? Was a file created but without the abline? It helps to be as specific as possible. It would also be helpful to make a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) that we could also run to reproduce the error. – MrFlick Sep 01 '14 at 04:00

0 Answers0