Conversation
There was a problem hiding this comment.
Hi @JamesVarndell, nice that you found something to try and amend this behaviour! Broadly speaking, looks good and I don't have any specific comments on the code, but I have some general comments that I think might be important.
From what I saw, this does modify the global params until we call style_context.__exit__, which happens via fig.show() or fig.save(). Therefore, I can foresee two potentially problematic situations which we may want to consider
- User is in a jupyter notebook and does not call
fig.show()since it's kind of optional there. - User calls
plt.show(). I must admit I have done this a few times
Both of these scenarios would result in the global params still being modified in a non-temporary fashion. That said, I am not completely set that we have to support these two cases. It could also be okay to say that those are user errors, but we should decide. Either way, this is still an improvement on the existing behaviour, so I am not blocking
Edit: after some discussion, we have chosen to go with this approach, which also aligns with how seaborn have done things.
Description
Closes #83.
Contributor Declaration
By opening this pull request, I affirm the following: