@@ -1093,21 +1093,31 @@ def hlines(self, y, xmin, xmax, colors=None, linestyles='solid',
1093
1093
1094
1094
lines = mcoll .LineCollection (masked_verts , colors = colors ,
1095
1095
linestyles = linestyles , label = label )
1096
+ if 'transform' in kwargs :
1097
+ lines .set_transform (kwargs ['transform' ])
1096
1098
self .add_collection (lines , autolim = False )
1099
+ self ._unstale_viewLim ()
1097
1100
lines ._internal_update (kwargs )
1098
1101
1099
1102
if len (y ) > 0 :
1100
1103
# Extreme values of xmin/xmax/y. Using masked_verts here handles
1101
1104
# the case of y being a masked *object* array (as can be generated
1102
1105
# e.g. by errorbar()), which would make nanmin/nanmax stumble.
1103
- minx = np .nanmin (masked_verts [..., 0 ])
1104
- maxx = np .nanmax (masked_verts [..., 0 ])
1105
- miny = np .nanmin (masked_verts [..., 1 ])
1106
- maxy = np .nanmax (masked_verts [..., 1 ])
1106
+ if self .name == "rectilinear" :
1107
+ datalim = lines .get_datalim (self .transData )
1108
+ minx = np .nanmin (datalim .xmin )
1109
+ maxx = np .nanmax (datalim .xmax )
1110
+ miny = np .nanmin (datalim .ymin )
1111
+ maxy = np .nanmax (datalim .ymax )
1112
+ else :
1113
+ minx = np .nanmin (masked_verts [..., 0 ])
1114
+ maxx = np .nanmax (masked_verts [..., 0 ])
1115
+ miny = np .nanmin (masked_verts [..., 1 ])
1116
+ maxy = np .nanmax (masked_verts [..., 1 ])
1117
+
1107
1118
corners = (minx , miny ), (maxx , maxy )
1108
1119
self .update_datalim (corners )
1109
1120
self ._request_autoscale_view ()
1110
-
1111
1121
return lines
1112
1122
1113
1123
@_preprocess_data (replace_names = ["x" , "ymin" , "ymax" , "colors" ],
@@ -1173,21 +1183,31 @@ def vlines(self, x, ymin, ymax, colors=None, linestyles='solid',
1173
1183
1174
1184
lines = mcoll .LineCollection (masked_verts , colors = colors ,
1175
1185
linestyles = linestyles , label = label )
1186
+ if 'transform' in kwargs :
1187
+ lines .set_transform (kwargs ['transform' ])
1176
1188
self .add_collection (lines , autolim = False )
1189
+ self ._unstale_viewLim ()
1177
1190
lines ._internal_update (kwargs )
1178
1191
1179
1192
if len (x ) > 0 :
1180
1193
# Extreme values of x/ymin/ymax. Using masked_verts here handles
1181
1194
# the case of x being a masked *object* array (as can be generated
1182
1195
# e.g. by errorbar()), which would make nanmin/nanmax stumble.
1183
- minx = np .nanmin (masked_verts [..., 0 ])
1184
- maxx = np .nanmax (masked_verts [..., 0 ])
1185
- miny = np .nanmin (masked_verts [..., 1 ])
1186
- maxy = np .nanmax (masked_verts [..., 1 ])
1196
+ if self .name == "rectilinear" :
1197
+ datalim = lines .get_datalim (self .transData )
1198
+ minx = np .nanmin (datalim .xmin )
1199
+ maxx = np .nanmax (datalim .xmax )
1200
+ miny = np .nanmin (datalim .ymin )
1201
+ maxy = np .nanmax (datalim .ymax )
1202
+ else :
1203
+ minx = np .nanmin (masked_verts [..., 0 ])
1204
+ maxx = np .nanmax (masked_verts [..., 0 ])
1205
+ miny = np .nanmin (masked_verts [..., 1 ])
1206
+ maxy = np .nanmax (masked_verts [..., 1 ])
1207
+
1187
1208
corners = (minx , miny ), (maxx , maxy )
1188
1209
self .update_datalim (corners )
1189
1210
self ._request_autoscale_view ()
1190
-
1191
1211
return lines
1192
1212
1193
1213
@_preprocess_data (replace_names = ["positions" , "lineoffsets" ,
0 commit comments