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")