@@ -1323,6 +1323,34 @@ def test_tricontourset_reuse():
13231323 assert tcs3 ._contour_generator == tcs1 ._contour_generator
13241324
13251325
1326+ @pytest .mark .parametrize ("plotter" , ["tricontour" , "tricontourf" ])
1327+ @check_figures_equal ()
1328+ def test_tricontour_triangles_kwarg (fig_test , fig_ref , plotter ):
1329+ # Passing triangles by keyword used to fall through to Collection.set().
1330+ x = [0.0 , 1.0 , 2.0 , 0.0 , 1.0 , 0.0 ]
1331+ y = [0.0 , 0.0 , 0.0 , 1.0 , 1.0 , 2.0 ]
1332+ z = [0.0 , 1.0 , 2.0 , 1.0 , 2.0 , 3.0 ]
1333+ triangles = [[0 , 1 , 3 ], [1 , 4 , 3 ], [1 , 2 , 4 ], [3 , 4 , 5 ]]
1334+ levels = [0.5 , 1.5 , 2.5 ]
1335+ getattr (fig_test .subplots (), plotter )(x , y , z , triangles = triangles ,
1336+ levels = levels )
1337+ getattr (fig_ref .subplots (), plotter )(x , y , triangles , z , levels = levels )
1338+
1339+
1340+ @check_figures_equal ()
1341+ def test_tricontour_set_data (fig_test , fig_ref ):
1342+ x = [0.0 , 0.5 , 1.0 , 0.0 , 0.5 , 0.0 ]
1343+ y = [0.0 , 0.0 , 0.0 , 0.5 , 0.5 , 1.0 ]
1344+ z1 = [0.0 , 1.0 , 2.0 , 1.0 , 2.0 , 3.0 ]
1345+ z2 = [3.0 , 2.0 , 1.0 , 2.0 , 1.0 , 0.0 ]
1346+ levels = [0.5 , 1.5 , 2.5 ]
1347+ triangles = [[0 , 1 , 3 ], [1 , 4 , 3 ], [1 , 2 , 4 ], [3 , 4 , 5 ]]
1348+ cs = fig_test .subplots ().tricontour (x , y , z1 , triangles = triangles ,
1349+ levels = levels )
1350+ cs .set_data (x , y , z2 , triangles = triangles )
1351+ fig_ref .subplots ().tricontour (x , y , z2 , triangles = triangles , levels = levels )
1352+
1353+
13261354@check_figures_equal ()
13271355def test_triplot_with_ls (fig_test , fig_ref ):
13281356 x = [0 , 2 , 1 ]
0 commit comments