Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Improved qhull triangulations with large x,y offset #8873

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 25, 2017

Conversation

ianthomas23
Copy link
Member

Fixes issue #8682.

Rather than changing the qhull options that we use, I am explicitly subtracting the means from the x, y coordinates before calling qhull to calculate the Delaunay triangulation. If you have coordinate positions offset and 1+offset, previously the triangulation would fail (merging 'nearby' points) for offset=1e5. Now it is OK for at least offset=1e15, but I've set the limit in the test to offset=1e10 in case different architectures/OSes give different numerical errors.

There are some minor changes to two of the test images, so I have added a API change note that other triangulations may be slightly modified by this change.

@eric-wieser
Copy link
Contributor

Can you add an image comparison test to demonstrate the plotting from #8682?

@eric-wieser
Copy link
Contributor

Tests are complaining about tri_smooth_contouring

@tacaswell tacaswell added this to the 2.1 (next point release) milestone Jul 14, 2017
@tacaswell
Copy link
Member

I am happy with checking that the triangulation is of a consistent size.

We might need to put a small threshold on that test now that we are pushing the precision of the system? I assume @ianthomas23 you are not on a mac?

@ianthomas23
Copy link
Member Author

@tacaswell You are correct, I use Linux.

Another option is to simplify the test script/image. At the moment it is a direct copy of one of the examples and has lots of very closely-spaced contours, some of them overlapping.

@tacaswell
Copy link
Member

Either option is fine.

@@ -0,0 +1,6 @@
Improved Delaunay triangulations with large offsets
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a mention of the Matplotlib methods that are affected by this change? Users might not be aware of what a Delaunay triangulation is or what Matplotlib is doing under the hood, but will be able to identify with a specific Matplotlib method that they use.

Copy link
Member

Choose a reason for hiding this comment

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

Ping @ianthomas23.

Copy link
Member Author

Choose a reason for hiding this comment

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

@dstansby @QuLogic My apologies, I thought I'd responded to this ages ago but evidently I didn't. I have amended the API change text now.

@QuLogic QuLogic merged commit f3101f6 into matplotlib:master Aug 25, 2017
@tacaswell
Copy link
Member

As always, thank you @ianthomas23 !

@ianthomas23 ianthomas23 deleted the 8682_qhull_large_offset branch July 8, 2021 18:23
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.

5 participants