@@ -946,6 +946,7 @@ def _process_args(self, *args, **kwargs):
946
946
min = seg .min (axis = 0 )
947
947
max = seg .max (axis = 0 )
948
948
havelimits = True
949
+
949
950
if havelimits :
950
951
self .ax .update_datalim ([min , max ])
951
952
self .ax .autoscale_view (tight = True )
@@ -1291,17 +1292,31 @@ def _process_args(self, *args, **kwargs):
1291
1292
self .zmax = args [0 ].zmax
1292
1293
else :
1293
1294
x , y , z = self ._contour_args (args , kwargs )
1294
-
1295
+
1296
+ _mask = ma .getmask (z )
1297
+ if _mask is ma .nomask :
1298
+ _mask = None
1299
+ C = _cntr .Cntr (x , y , z .filled (), _mask )
1300
+
1301
+ t = self .ax .transData if self .transform is None else self .transform
1302
+
1303
+ # if the transform is not trans data, and some part of it
1304
+ # contains transData, transform the xs and ys to data coordinates
1305
+ if (t != self .ax .transData and
1306
+ any (t .contains_branch_seperately (self .ax .transData ))):
1307
+ trans_to_data = self .transform - self .ax .transData
1308
+ pts = (np .vstack ([x .flat , y .flat ]).T )
1309
+ transformed_pts = trans_to_data .transform (pts )
1310
+ x = transformed_pts [..., 0 ]
1311
+ y = transformed_pts [..., 1 ]
1312
+
1295
1313
x0 = ma .minimum (x )
1296
1314
x1 = ma .maximum (x )
1297
1315
y0 = ma .minimum (y )
1298
1316
y1 = ma .maximum (y )
1299
1317
self .ax .update_datalim ([(x0 ,y0 ), (x1 ,y1 )])
1300
1318
self .ax .autoscale_view (tight = True )
1301
- _mask = ma .getmask (z )
1302
- if _mask is ma .nomask :
1303
- _mask = None
1304
- C = _cntr .Cntr (x , y , z .filled (), _mask )
1319
+
1305
1320
self .Cntr = C
1306
1321
1307
1322
def _get_allsegs_and_allkinds (self ):
0 commit comments