4n4nd / prometheus-api-client-python

A python wrapper for the prometheus http api
MIT License
234 stars 77 forks source link

add controls to subplot() #252

Open mahtin opened 1 year ago

mahtin commented 1 year ago

Is your feature request related to a problem? Please describe.
No - not a problem. It's an honest-to-gosh simple request to make life easier.

When you call plot() you create a new window. Two calls, two windows created. If you could pass subplot() arguments to the underlying subplot() call, then you could control the layout with minimal extra code.

Describe the solution you'd like
Add **kwargs to plot() call such that subplot() can be controlled. I believe the following simple edit would work:

def plot(self, **kwargs):
    ...
    fig, axis = plt.subplots(**kwargs)
    ...

Describe alternatives you've considered
While it's very easy to loop and call subplot() myself, I feel that the cool way plot() was implemented should be retained; but with these added controls.

4n4nd commented 1 year ago

@mahtin that seems like a reasonable solution. Would you please make the changes and create a pull request for it?

Thanks!

mahtin commented 1 year ago

Would you ...

Yes. Done. See #253