Просмотр исходного кода

render_plots can now specify output directory if saving to disk

Caleb Fangmeier лет назад: 6
Родитель
Сommit
a5b7279d72
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      filval/plotting.py

+ 2 - 2
filval/plotting.py

@@ -257,12 +257,12 @@ def grid_plot(subplots):
     return argdicts, docs, txts
 
 
-def render_plots(plots, exts=('png',), scale=1.0, to_disk=True):
+def render_plots(plots, exts=('png',), directory='output/figures/', scale=1.0, to_disk=True):
     for plot in plots:
         print(f'Building plot {plot.name}')
         plot.data = None
         if to_disk:
-            with lp.figure(plot.name.replace(' ', '_'), directory='output/figures',
+            with lp.figure(plot.name.replace(' ', '_'), directory=directory,
                            exts=exts,
                            size=(scale * 10, scale * 10)):
                 argdicts, docs, txts = grid_plot(plot.subplots)