File tree 2 files changed +21
-0
lines changed
2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -2019,6 +2019,15 @@ def set_paths(self):
2019
2019
def get_datalim (self , transData ):
2020
2020
return (self .get_transform () - transData ).transform_bbox (self ._bbox )
2021
2021
2022
+ def get_coordinates (self ):
2023
+ """
2024
+ Return the x and y vertices of the mesh.
2025
+
2026
+ The shape of the returned coordinates is
2027
+ (*meshWidth* + 1, *meshHeight* + 1, 2).
2028
+ """
2029
+ return self ._coordinates
2030
+
2022
2031
@staticmethod
2023
2032
def convert_mesh_to_paths (meshWidth , meshHeight , coordinates ):
2024
2033
"""
Original file line number Diff line number Diff line change @@ -714,6 +714,18 @@ def test_singleton_autolim():
714
714
np .testing .assert_allclose (ax .get_xlim (), [- 0.06 , 0.06 ])
715
715
716
716
717
+ def test_quadmesh_get_xydata ():
718
+ x = [0 , 1 , 2 ]
719
+ y = [2 , 4 , 6 ]
720
+ z = np .ones (shape = (2 , 2 ))
721
+ xx , yy = np .meshgrid (x , y )
722
+ coll = plt .pcolormesh (xx , yy , z )
723
+
724
+ # shape (3, 3, 2)
725
+ coords = np .stack ([xx .T , yy .T ]).T
726
+ assert_array_equal (coll .get_xydata (), coords )
727
+
728
+
717
729
def test_quadmesh_set_array ():
718
730
x = np .arange (4 )
719
731
y = np .arange (4 )
You can’t perform that action at this time.
0 commit comments