{"action":"opened","issue":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/4424","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/4424/labels{/name}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/4424/comments","events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/4424/events","html_url":"https://github.com/matplotlib/matplotlib/issues/4424","id":75834425,"number":4424,"title":"mpl.tri.Triangulation does not work but plt.tricontourf does","user":{"login":"keltonhalbert","id":1411265,"avatar_url":"https://avatars.githubusercontent.com/u/1411265?v=3","gravatar_id":"","url":"https://api.github.com/users/keltonhalbert","html_url":"https://github.com/keltonhalbert","followers_url":"https://api.github.com/users/keltonhalbert/followers","following_url":"https://api.github.com/users/keltonhalbert/following{/other_user}","gists_url":"https://api.github.com/users/keltonhalbert/gists{/gist_id}","starred_url":"https://api.github.com/users/keltonhalbert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keltonhalbert/subscriptions","organizations_url":"https://api.github.com/users/keltonhalbert/orgs","repos_url":"https://api.github.com/users/keltonhalbert/repos","events_url":"https://api.github.com/users/keltonhalbert/events{/privacy}","received_events_url":"https://api.github.com/users/keltonhalbert/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-13T03:53:40Z","updated_at":"2015-05-13T03:53:40Z","closed_at":null,"body":"As described in the title, I can successfully plot data using tricontourf but cannot successfully do it by first creating triangles using tri.Triangulation.\r\n\r\nThe reason I would want to do this is because my data is on an unstructured grid that remains static, so it would be much more efficient if I could save the triangles to a file and load them any time I need to make a plot.\r\n\r\n\r\nHere's the error I get from Triangulation using the verbose flag:\r\n```\r\nQH6154 qhull precision error: initial facet 1 is coplanar with the interior point\r\nERRONEOUS FACET:\r\n- f1\r\n    - flags: bottom simplicial flipped\r\n    - normal:    0.3823   0.3824  -0.8412\r\n    - offset:   -2443442\r\n    - vertices: p3991443(v2) p946265(v1) p3857645(v0)\r\n    - neighboring facets: f2 f3 f4\r\n\r\nWhile executing:  | qhull d Qt Qbb Qc Qz\r\nOptions selected for Qhull 2012.1 2012/02/18:\r\n  run-id 777401308  delaunay  Qtriangulate  Qbbound-last  Qcoplanar-keep\r\n  Qz-infinity-point  _pre-merge  _zero-centrum  Qinterior-keep  Pgood\r\n  _max-width 1e+30  Error-roundoff 1.4e+15  _one-merge 9.7e+15\r\n  Visible-distance 2.8e+15  U-coplanar-distance 2.8e+15  Width-outside 5.5e+15\r\n  _wide-facet 1.7e+16\r\n\r\nprecision problems (corrected unless 'Q0' or an error)\r\n      2 flipped facets\r\n\r\nThe input to qhull appears to be less than 3 dimensional, or a\r\ncomputation has overflowed.\r\n\r\nQhull could not construct a clearly convex simplex from points:\r\n- p3867215(v3): 1.9e+06 1.9e+06 -7.7e-34\r\n- p3991443(v2): 6.4e+06    93 1.5e-17\r\n- p946265(v1): 1e+30 1e+30 9.1e+29\r\n- p3857645(v0):    89 6.4e+06 1.5e-17\r\n\r\nThe center point is coplanar with a facet, or a vertex is coplanar\r\nwith a neighboring facet.  The maximum round off error for\r\ncomputing distances is 1.4e+15.  The center point, facets and distances\r\nto the center point are as follows:\r\n\r\ncenter point  2.5e+29  2.5e+29 2.273e+29\r\n\r\nfacet p3991443 p946265 p3857645 distance=    0\r\nfacet p3867215 p946265 p3857645 distance=    0\r\nfacet p3867215 p3991443 p3857645 distance= -2.3e+29\r\nfacet p3867215 p3991443 p946265 distance= -3.5e+13\r\n\r\nThese points either have a maximum or minimum x-coordinate, or\r\nthey maximize the determinant for k coordinates.  Trial points\r\nare first selected from points that maximize a coordinate.\r\n\r\nThe min and max coordinates for each dimension are:\r\n  0:     89.26     1e+30  difference= 1e+30\r\n  1:     92.64     1e+30  difference= 1e+30\r\n  2:  -7.704e-34     1e+30  difference= 1e+30\r\n\r\nIf the input should be full dimensional, you have several options that\r\nmay determine an initial simplex:\r\n  - use 'QJ'  to joggle the input and make it full dimensional\r\n  - use 'QbB' to scale the points to the unit cube\r\n  - use 'QR0' to randomly rotate the input for different maximum points\r\n  - use 'Qs'  to search all points for the initial simplex\r\n  - use 'En'  to specify a maximum roundoff error less than 1.4e+15.\r\n  - trace execution with 'T3' to see the determinant for each point.\r\n\r\nIf the input is lower dimensional:\r\n  - use 'QJ' to joggle the input and make it full dimensional\r\n  - use 'Qbk:0Bk:0' to delete coordinate k from the input.  You should\r\n    pick the coordinate with the least range.  The hull will have the\r\n    correct topology.\r\n  - determine the flat containing the points, rotate the points\r\n    into a coordinate plane, and delete the other coordinates.\r\n  - add one or more points to make the input full dimensional.\r\nTraceback (most recent call last):\r\n  File \"mpas.py\", line 23, in <module>\r\n    triang = tri.Triangulation(x, y, mask=None)\r\n  File \"/glade/apps/opt/matplotlib/1.4.3/gnu-westmere/4.8.2/lib/python2.7/site-packages/matplotlib-1.4.3-py2.7-linux-x86_64.egg/matplotlib/tri/triangulation.py\", line 55, in __init__\r\n    self.triangles, self._neighbors = _qhull.delaunay(x, y)\r\nRuntimeError: Error in qhull Delaunay triangulation calculation: singular input data (exitcode=2)\r\n```"}}