Create side-by-side comparisons of published and reproduced figures
Source:R/figure_comparison.R
compare_figures.RdCombines each published figure with the corresponding reproduced figure into
one image, with a label below each, so that differences can be seen at a
glance in the certificate. Both images are scaled to the same width; only the
first page or frame of an image file is used. PDF and SVG figures are rendered
at a resolution that fits width. The font size of long labels is reduced
so that they fit. Include the comparisons in the
certificate with render_figure_comparisons.
Arguments
- published
Paths to the published figures, e.g., from
extract_pdf_figures.- reproduced
Paths to the reproduced figures, in the same order.
- output_dir
Directory to write the comparison images to; created if missing.
- names
File names of the comparison images, ending in
.jpg,.jpeg, or.png; defaultcomparison-1.jpg,comparison-2.jpg, etc.- labels
Labels for the published and the reproduced figure.
- layout
"vertical"(default) puts the published figure above the reproduced one,"horizontal"puts them side by side.- width
Width in pixels to which each figure is scaled.
- quality
JPEG quality of the comparison images.