R/xgx_annotate_status_png.R
xgx_annotate_status_png.Rd
These function annotates a single png file or all files within a directory.
xgx_annotate_status_png(
file_or_dir,
script = "",
status = "DRAFT",
date_format = "%a %b %d %X %Y",
col = grDevices::grey(0.8, alpha = 0.7),
font = 2,
cex_status_mult = 7,
cex_footnote_mult = 0.8,
status_angle = 45,
x11 = FALSE
)
The png file to annotate or directory location for annotating png files. Note this will annotate just once, so if you generate multiple png files and then annotate at the end of your script it will have the correct script name on it. Then if you create new images in a different script in the same directory and then annotate with the script name the second script, the PNG files will show the correct script location for each file.
Script name to add as a footnote; By default this is empty, though it could name the script that
Draft or other status; If status="Final"
or
status=""
the status overlay will be removed. By default
the status is DRAFT.
Date format for adding the time the png was annotated.
Color for annotating the draft status
Font to use for the annotation function
Multiplication factor for the status annotation. By default 7
Multiplication factor for the footnote annotation. By default 0.8
Angle to rotate status
Display on the X11/Windows device
nothing
If a png file has been annotated once, this function will not annotate it again. Therefore, you can run this function on directories with different input script names and it will label each file based on when each file was run.
Based on code from MrFlick on Stack Overflow.