Wookai / paper-tips-and-tricks

Best practice and tips & tricks to write scientific papers in LaTeX, with figures generated in Python or Matlab.
MIT License
3.63k stars 254 forks source link

One script per figure #4

Open petebachant opened 5 years ago

petebachant commented 5 years ago

Just adding a comment here that I prefer to use one script (usually plot.py at top level) that has a positional command line argument (using argparse) for which figure(s) to create. This seems cleaner to me because you can keep your plotting functions all in one file, and generate multiple figures with a single command.

Wookai commented 5 years ago

I usually end up with a hybrid approach, where figures that are related (e.g. plots of a CDF or results plots) are generated by the same script but I have different scripts for each type of figure. They all use plot_utils to set the global parameters such as font size, line width, etc., though.

I think the main point is to have script(s) that allow you to generate your figures in one click. Whether your have one big script with parameters or different scripts is more a matter of taste in my opinion :).

Sarayutnang2099 commented 5 years ago

@petebachant