4. Functions¶
4.1. savefig()¶
Saves the current plot as PyPDF file.
savefig(fname,
pack_list = [],
cleanup = True,
multiple = 'pickle',
force_pickle = False,
verbose = True
prompt_overwrite = False,
**kwargs)
| fname: | str Filename of the output file. |
|---|---|
| pack_list: | list, default = List with filenames that will be embedded in the PyPDF-file. The generating script is added separately and should not be included here. See Packing and unpacking for more details. |
| multiple: | str, default = How to handle multiple plots in a single generating script. Can be any of |
| cleanup: | bool, default = Whether or not to cleanup files that have been embedded in the PyPDF file. Set to |
| force_pickle: | bool, default = Pickles the figure and embeds a Python script that unpickles and reads the figure again. This can be useful when dealing with very large source files, see Pickling for more details. |
| verbose: | bool, default = Wether or not to show verbose comments during saving. |
| prompt_overwrite: | |
bool, default = Wether or not to prompt when the output file already exists and is about to be overwritten. If |
|
| **kwargs: | Any keyword arguments accepted by |
4.2. unpack()¶
Extracts the files embedded in the PyPDF-file. Must be called before embedded files are read by the generating script. This can be guaranteed by importing the backend using pypdfplot.backend.unpack, which automatically calls unpack() with its default parameters. See Packing and unpacking for more details.
unpack(fname = None,
verbose = True)
| fname: | str, default = Filename of the PyPDF file to unpack. If |
|---|---|
| verbose: | bool, default = Wether or not to show verbose comments during extraction. |
4.3. fix_pypdf()¶
Fixes PyPDF files that have been severed, e.g. because they were saved as ‘regular’ PDF-files outside of pypdfplot. See PyPDF compliance types for more details.
fix_pypdf(input_fname,
output_fname = None,
verbose = True)
| input_fname: | str Filename of the severed PyPDF file |
|---|---|
| output_fname: | str, default = Filename of the fixed output PyPDF file. If |
| verbose: | bool, default = Wether or not to show verbose comments during fixing. |