thebioengineer/camcorder

Ability to overwrite previously generated intermediate plots saved on disk

Opened this issue · 2 comments

Hi everyone,
thanks for providing such a great package. I'm a big fan!

One question: I often use gg_record to save the intermediate plots to disk, to also share individual plots and not just the .gif. Currently, every intermediate plot is named automatically according to date and time. Therefore, if I run the code that creates the plots again, the old files do not get replaced but are added to the folder. Is it possible to provide a name for the intermediate plots (and then they could get automatically numbered) and overwrite the ones currently in the folder that have the same name?

Thanks!

Hi @pkollenda - could you go into some more detail as to how you would expect this to work? Not sure I understand why you would like to replace files?

My current thought is we could add a parameter into gg_record that is called "filename_pattern" or something, where you can pass a pattern to use when naming the files, lke "my_great_plot_{timestamp}" or "my_excellent_plot_{i}", where timestamp and i are reserved pattern identifiers that must exist in the naming pattern. but from then on, camcorder could either iterate and add a plot number (i) or a timestamp into the name but you could set the actual naming pattern.

Hey, I took an initial look at this idea in PR #53 - let me know if this seems along the right track for you!