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