Skip to content

Fix PlotItem.setAxisItems#1376

Merged
j9ac9k merged 3 commits intopyqtgraph:masterfrom
ixjlyons:issue-1358-setAxisItems
Sep 23, 2020
Merged

Fix PlotItem.setAxisItems#1376
j9ac9k merged 3 commits intopyqtgraph:masterfrom
ixjlyons:issue-1358-setAxisItems

Conversation

@ixjlyons
Copy link
Copy Markdown
Member

Fixes #1358

I believe this is the intention of the logic that's there currently. Technically, it does appear to be possible to use a single AxisItem for multiple PlotItems, but the conditions under which this works (and doesn't cause a segfault) aren't crystal clear to me. In the future, if someone figures out how to robustly detect when it's ok to do so, we can allow for it. For now this should make things work as intended and I'm pretty sure separate linked instances should work equivalently.

- Use extend so visibleAxes remains a flat list.
- More robust logic for detecting adding an AxisItem instance to
  mulitple plots and suggest a workaround in the error message.
@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Sep 23, 2020

Nice fix @ixjlyons Merging.

@j9ac9k j9ac9k merged commit a90c443 into pyqtgraph:master Sep 23, 2020
@ixjlyons ixjlyons deleted the issue-1358-setAxisItems branch September 26, 2020 15:05
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.

key error when setAxisItems in PlotItem

2 participants