Skip to content

MRG, BUG: Fix behavior with constrained_layout=True#9561

Merged
drammock merged 1 commit intomne-tools:mainfrom
larsoner:constrained
Jul 12, 2021
Merged

MRG, BUG: Fix behavior with constrained_layout=True#9561
drammock merged 1 commit intomne-tools:mainfrom
larsoner:constrained

Conversation

@larsoner
Copy link
Copy Markdown
Member

Fixes evoked.plot_topomap when passing axes from a fig created with constrained_layout=True

def connect(self):
"""Connect to all the events we need."""
self.cidpress = self.cbar.patch.figure.canvas.mpl_connect(
self.cidpress = self.cbar.ax.figure.canvas.mpl_connect(
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just because cbar.patch is deprecated now, and all we need is the figure so we might as well go through ax instead

Copy link
Copy Markdown
Member

@drammock drammock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so the problem is with calling subplots_adjust? seems like we might need similar changes elsewhere?

Copy link
Copy Markdown
Member

@agramfort agramfort left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@drammock merge if happy

@larsoner
Copy link
Copy Markdown
Member Author

so the problem is with calling subplots_adjust? seems like we might need similar changes elsewhere?

Yes and yes. I'm fine with doing the updates piecemeal as we encounter them. This at least takes care of plot_topomap

@drammock drammock merged commit 80e4910 into mne-tools:main Jul 12, 2021
@larsoner larsoner deleted the constrained branch July 12, 2021 23:33
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

Successfully merging this pull request may close these issues.

3 participants