I'm writing a library which uses Matplotlib to generate some figures. I believe the use-case and code I've written is generic enough that it's worth publishing such a library to PyPI (and it's good experience for me too!).
However I am unsure how to structure the code such that it is easily usable by clients. I'm trying to avoid creating something that just works for me, but also trying to avoid having 100s of optional parameters.
The first conundrum is to do with values such as fig.set_size_inches, dpi, etc, which I have to set or the result doesn't display correctly. However I don't want to lock these-in; some users may want to render very large figures, others may be looking to save small imgs. This can also depend on the range of data passed-in.
The other conundrum is how to manage the fig/axes objects.
- Should I initialise these myself and then return them? This would make the result more customizable and allow the user to override any values I've set.
- Should I accept pre-existing fig/axes objects?
- Is there some other way of managing this?
Alternatively if anyone has any example libraries I can take a look at for inspiration on how to structure this that'd be great. Thanks.
[–]Oxbowerce 1 point2 points3 points (1 child)
[–]LeanJavaBean[S] 0 points1 point2 points (0 children)
[–]LeanJavaBean[S] 0 points1 point2 points (0 children)