Rendering¶
Command line¶
BDP package can be run from command line to render the images of the BDP diagrams described in Python.
Depending on the extension of the output file, BDP will generate either PDF or PNG. If output file is not specified, it will have the same name as the input, and generated extension will depend on the [-p] argument value.
usage: bdp [-h] [-o OUTPUT] [-d OUTDIR] [-p] [-c] [-r R] input
- Positional arguments:
input Input BDP file - Options:
-o=, --output= Output PDF or PNG file -d=, --outdir= Output directory -p=False Render PNG -c=False Clear intermediate files -r Number representing DPI resolution of the generated PNG
From Python¶
For rendering a BDP figure from the Python script, the render_fig() function can be used.
-
bdp.render.
render_fig
(fig, fout=None, outdir=None, options={})¶ Renders the BDP figure to PDF or PNG via Latex
Parameters: - fout (str) – Output PDF or PNG file
- outdir (str) – Output PDF or PNG file
- options (dict) – Dictionary of additional options: ‘c’, ‘p’ and ‘r’. Please take a look at command line arguments for additional info.