erdogant / distfit

distfit is a python library for probability density fitting.
https://erdogant.github.io/distfit
Other
370 stars 26 forks source link

in plot api, pass fig and ax to give more control to the user's code #13

Closed ksachdeva closed 3 years ago

ksachdeva commented 3 years ago

Thanks for this great library.

Purpose of this modification: I have been using it with a multivariate time series dataset. Each dimension gets its own plot and wanted to make use of subplots to see all the dimensions at the same time (in a grid for e.g.)

Notes: a) I have added fig as the parameter to the plotting API as well. Generally, it is not required. I have done it so as to not create a situation where the number of return values is 1. This way your function always return 2 values (the tuple).

b) Instead of using plt.xlim and plt.ylim, I am using ax.set_xlim & ax.set_ylim. This should work for previous version and for this modification as well.

c) For now if the method is 'discrete' then passed fig and axes are ignored since the plot_binom function creates subplots internally.

erdogant commented 3 years ago

Thank you! Great contribution!

erdogant commented 3 years ago

You can update to latest version using:

pip install -U distfit

Thank you!

ksachdeva commented 3 years ago

Much appreciated @erdogant and many thanks for this wonderful library.

regards Kapil