Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very inflexible plotting - allow instead for an axis as argument #92

Closed
nemonominem opened this issue Jul 23, 2021 · 2 comments
Closed
Assignees

Comments

@nemonominem
Copy link

The way some of the plotting is done right now is very limiting.
For instance kats/detectors/cusum_detection.py ends with a plt.show().

It would be better to allow the caller to manage the figure itself and pass an axis (as in most typical graphing utilities). This way one could build composite figures or decide where to plot (to an html file for instance).

@michaelbrundage
Copy link
Contributor

Totally agree, and I've been submitting diffs to address this. Methods are being changed to accept plt.Axes and other user-configurable properties as appropriate, return plt.Axes, and not invoke plt.show.

@michaelbrundage michaelbrundage self-assigned this Jul 26, 2021
@michaelbrundage
Copy link
Contributor

Hi @nemonominem, I'm going to resolve this issue. There's never-ending work to further improve our APIs, but over a series of more than a dozen diffs I've removed all the plt.show() and sns.set() invocations (except for one lingering one in detectors/bocpd.py) and updated most plot() methods to accept plt.Axes (except when the method generates multiple plots), give users more control over some previously hard-coded values, and return plt.Axes or a sequence of plt.Axes so that users can further modify the plots before rendering. If you run into more limitations with the plotting methods, please open new issues for the specific problems. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants