This page gathers frequently asked questions regarding the dantro plotting interface.
Aside from these FAQs, make sure to have a look at other plotting-related documentation pages.
If you would like to add a question here, we are happy about contributions! Please visit the project page to open an issue or get more information about contributing.
To write plots to a custom output directory (other than the associated output directory of the
PlotManager), simply specify the
out_dir argument in the plot configuration.
The file extension of the plot can also be specified there, using the
my_plot: out_dir: ~/my/custom/output/directory # ... the rest of the plot configuration
You can only specify a directory here, not a full path; the full file path will be generated by the plot manager by adding the name of the plot and potentially existing sweep configurations to it.
If a relative path is given for
out_dir, it will be relative to the output directory of the associated
The file extension used in generating the output path can be adjusted for all plots associated with a plot creator or for a single plot, using its plot configuration.
To set a default extension, use the
default_ext argument to
BasePlotCreator or derived classes.
To specify it for a single plot, use the
file_ext argument, directly in its plot configuration:
my_plot: file_ext: pdf # ... the rest of the plot configuration
Also have a look at Plot Configuration Reference.
Follow these steps to achieve overwriting of existing plot output:
Tell the plot creator that it should not raise an error if a file already exists at the generated output path:
exist_ok=Truein the plot configuration
exist_ok=Trueto the plot creator during initialization
If you always desire this behavior for a specific plot creator, set the
OUT_PATH_EXIST_OKclass variable to
True. That variable defines the default behavior. It is overwritten by the
exist_okargument passed during initialization of a
BasePlotCreator(or derived creator) and by the value given in the plot configuration.
Tell the plot manager to overwrite existing plot configuration files that are stored alongside each plot; otherwise, this would also create conflict. To do so, pass
cfg_exists_action='overwrite'during the initialization of the
PlotManager. To suppress a warning, use
Yes. See Skipping Plots for more information.
When using the
PlotHelper, it automatically sets up a figure instance and an axis initially, even before the plot function is called.
However, they can be replaced using the
Yes. See Dynamically entering/exiting animation mode for more information.