A pandoc filter to generate figures from source code
Pandoc-plot is a pandoc filter designed to generate figures from source code directly within Pandoc documents. This tool simplifies the process of embedding dynamic visualizations by supporting multiple plotting tools (e.g., matplotlib, ggplot2) and enabling seamless integration into LaTeX/PDF workflows.
Key Features:
Support for various plotting libraries and frameworks
Automatic figure numbering and referencing
Cross-platform compatibility
Integration with Pandoc's ecosystem
Extensibility via plugins or custom rendering
Ideal for researchers, technical writers, and educators who need to include high-quality, reproducible figures in their documents. Pandoc-plot helps reduce manual work while maintaining document integrity and visual appeal. It can be installed via winget for easy setup across platforms.
README
pandoc-plot
A Pandoc filter to generate figures from code blocks in documents
pandoc-plot turns code blocks present in your documents (Markdown, LaTeX, etc.) into embedded figures, using your plotting toolkit of choice, including Matplotlib, ggplot2, MATLAB, Mathematica, and more.
Overview
This program is a Pandoc filter. It can therefore
be used in the middle of conversion from input format to output format,
replacing code blocks with figures.
The filter recognizes code blocks with classes that match plotting
toolkits. For example, using the matplotlib toolkit:
# My document
This is a paragraph.
```{.matplotlib}
import matplotlib.pyplot as plt
plt.figure()
plt.plot([0,1,2,3,4], [1,2,3,4,5])
plt.title('This is an example figure')
```
Putting the above in input.md, we can then generate the plot and embed
it in an HTML page:
To know which toolkits are useable on your machine (and which ones are
not available), you can check with the toolkits command:
pandoc-plot toolkits
Wish your plotting toolkit of choice was available? Please raise an
issue!
Documentation
You can find more information in the documentation, available either in the
source repository file MANUAL.md, on the webpage, or via the command pandoc-plot --manual.
Installation
Binaries and Installers
Windows, Linux, and Mac OS binaries are available on the GitHub release
page. There are
also Windows installers.