You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Good catch! For now, please just use plt.close() manually after plotting the heatmap.
Although we could just add the plt.close() to the function just like it's there with the rest, I wouldn't be in favor of this for the following reasons:
As I remember the heatmap was originally implemented this way, to allow users to change the plot afterwards, for example by adding an additional background or else.
Closing the figure could therefore break some workflows that rely on this. We will need to deprecate first.
The workaround with manual plt.close()is easy and effective.
I'm not really sure how to handle this further. I would be definitely in favor of having consistent closing behaviour across all plotting methods.
Maybe this proposal would be the easiest to implement: add a close: bool | None = None argument to all plotting functions for the first iteration.
This way we can distinguish three cases:
True: close fig
False don't close fig
None use the previously implemented behavior (i.e. False in heatmap, else True).
In a followup we would then need to decide which behavior we would like to use as a default in the future (close or not).
We would then raise a DeprecationWarning for the implementations that are inconsistent and if close is None.
This way we can safely deprecate old behavior and make it finally consistent subsequently a few versions later.
Example: if we want to close the figure by default, we would raise a DeprecationWarning in heatmap() if close is None with the message, that passing None is deprecated and True will be the default in v0.x.y.
This sounds more complicated than it is actually, but this would be the proper way on how to make this consistent without breaking user workflows.
Question
pm.plotting.heatmap(dataset.gaze[0])
gives me the same figure twice no mattershow=True
orshow=False
The text was updated successfully, but these errors were encountered: