WillianFuks / tfcausalimpact

Python Causal Impact Implementation Based on Google's R Package. Built using TensorFlow Probability.
Apache License 2.0
600 stars 72 forks source link

allow to skip `plot_show()` to be able to get the current axis #13

Closed kjappelbaum closed 3 years ago

kjappelbaum commented 3 years ago

Hi, thanks for this great library!

This PR does not do much, it only allows that users can get the current matplotlib axis to change the style of the plot or to save the figure. That is, it should also address dafiti/causalimpact#72.

Using the show argument is similar to what, for example, SHAP does https://github.com/slundberg/shap/blob/3711be957461c3747d4f788e8604c5568ffb2d90/shap/plots/_violin.py#L19-L27

kjappelbaum commented 3 years ago

Hi Will,

thanks for review and comments :) I'd hesitate to have a toggle on the return type of a function, i think plt.gcf() or plt.gca() should do the the job.

Cheers, Kevin

WillianFuks commented 3 years ago

Sounds great! I'll prepare to finish the PR now :)!