About this project
R and TikZ/pgfplots pipeline for generating publication-ready SEM path diagrams, CFA factor loadings plots, and statistical summary figures aligned to journal submission standards.
Background
Journal figures are a specific craft: they need to be precise enough to communicate statistical findings unambiguously, legible at the print dimensions specified by the journal, and consistent in typography and style with the manuscript body. Manually creating these in a GUI tool like Excel or even ggplot without a systematic template produces figures that look different from each other and often don't survive journal formatting requirements.
The pipeline starts from the model objects produced by lavaan (for SEM and CFA) and generates figures programmatically. That means if the model is re-estimated with updated data, re-running the pipeline re-generates all figures automatically — no manual updating of coefficient labels or significance stars. The TikZ integration for path diagrams gives precise control over layout that R's semPlot package alone doesn't provide.
The output format requirements vary by journal: some require EPS, some PDF, some TIFF at specific DPI. The pipeline handles these via exportation wrappers so you can generate all required formats from the same source in a single step. The reproducibility principle here is the same as for code: if a figure can't be regenerated from the data with a single command, it's a manual artefact and will diverge from the data eventually.
Highlights
- SEM path diagrams with standardised coefficients and significance stars
- CFA factor loading plots with confidence interval ribbons
- Histogram and violin plots for construct distribution reporting
- Output in PDF and EPS for journal submission compatibility
- Reproducible rendering pipeline — figures re-generated from data, not manual edits