kammerje / fouriever

A single toolkit for calibrations, correlations, and companion search for kernel-phase, aperture masking, and long-baseline interferometry data.
6 stars 6 forks source link

More flexible plotting options #8

Open vandalt opened 2 years ago

vandalt commented 2 years ago

Currently, figures are saved and closed internally. It would be nice to have the option to show the figure as well (with a switch in the function argument, or to make the figure accessible for users, so they can show it with plt.show(). This would especially nice for notebooks (e.g. the KPI Pipeline example).

vandalt commented 1 year ago

@kammerje I was taking a look into this to display fouriever plots in a notebook. I was wondering which option you preferred between:

  1. A show=False (off by default) argument in plotting functions
  2. Returning the figure object in plotting functions so users can use plt.show() and edit the figure in separate code

Option 1 has the advantage that behaviour by default is 100% the same as before (nothing returned and figure is closed at the end of each function). Option 2 would not cause figures anymore, but would have the upside to let users access the figure to modify it with custom code, use plt.show() externally, and even save the figure in a custom filename.

Let me know what you think.

Thanks!

kammerje commented 1 year ago

We could also add a return_figure keyword that is False by default.