| 2270 | A triangular mesh is a `~matplotlib.tri.Triangulation` object. |
| 2271 | """ |
| 2272 | def __init__(self, triangulation, **kwargs): |
| 2273 | super().__init__(**kwargs) |
| 2274 | self._triangulation = triangulation |
| 2275 | self._shading = 'gouraud' |
| 2276 | |
| 2277 | self._bbox = transforms.Bbox.unit() |
| 2278 | |
| 2279 | # Unfortunately this requires a copy, unless Triangulation |
| 2280 | # was rewritten. |
| 2281 | xy = np.hstack((triangulation.x.reshape(-1, 1), |
| 2282 | triangulation.y.reshape(-1, 1))) |
| 2283 | self._bbox.update_from_data_xy(xy) |
| 2284 | |
| 2285 | def get_paths(self): |
| 2286 | if self._paths is None: |