🌐 AI搜索 & 代理 主页
Skip to content

Conversation

@ksunden
Copy link
Member

@ksunden ksunden commented Nov 16, 2023

Closes #27333

PR summary

I would like to simplify down the reproducer further and add a test, but I think the code change itself is largely good.

Just uses path._iter_connected_components() to break apart the connected subpaths so that the MOVETO lines don't get considered as close.
There is a small amount of bookkeeping to make sure that the reported index includes all of the subpaths already processed.

PR checklist

@ksunden
Copy link
Member Author

ksunden commented Nov 16, 2023

Test is now written, I decided not to make it an image test, as all I really need to check is that the correct contour is chosen, and that can be done with a simple assertion.

However here are the images produced by that code if reviewers are interested:

Before the change:

before

With this patch:

after

The main point being that the MOVETO line of the 100 contour had been selected, but now it (correctly) selects the 0 contour.

@ksunden ksunden marked this pull request as ready for review November 16, 2023 21:06
@ksunden ksunden added this to the v3.8.2 milestone Nov 16, 2023
@tacaswell tacaswell merged commit 6bed824 into matplotlib:main Nov 16, 2023
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Nov 16, 2023
@ksunden ksunden deleted the contour-moveto branch November 17, 2023 00:36
ksunden added a commit that referenced this pull request Nov 17, 2023
…334-on-v3.8.x

Backport PR #27334 on branch v3.8.x (Omit MOVETO lines from nearest contour logic)
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.

[Bug]: Spurious lines added with some manually add contour labels

3 participants