@@ -1101,14 +1101,25 @@ def hlines(self, y, xmin, xmax, colors=None, linestyles='solid',
1101
1101
# Extreme values of xmin/xmax/y. Using masked_verts here handles
1102
1102
# the case of y being a masked *object* array (as can be generated
1103
1103
# e.g. by errorbar()), which would make nanmin/nanmax stumble.
1104
- minx = np .nanmin (masked_verts [..., 0 ])
1105
- maxx = np .nanmax (masked_verts [..., 0 ])
1106
- miny = np .nanmin (masked_verts [..., 1 ])
1107
- maxy = np .nanmax (masked_verts [..., 1 ])
1104
+ updatex = True
1105
+ updatey = True
1106
+ if self .name == "rectilinear" :
1107
+ datalim = lines .get_datalim (self .transData )
1108
+ t = lines .get_transform ()
1109
+ updatex , updatey = t .contains_branch_seperately (self .transData )
1110
+ minx = np .nanmin (datalim .xmin )
1111
+ maxx = np .nanmax (datalim .xmax )
1112
+ miny = np .nanmin (datalim .ymin )
1113
+ maxy = np .nanmax (datalim .ymax )
1114
+ else :
1115
+ minx = np .nanmin (masked_verts [..., 0 ])
1116
+ maxx = np .nanmax (masked_verts [..., 0 ])
1117
+ miny = np .nanmin (masked_verts [..., 1 ])
1118
+ maxy = np .nanmax (masked_verts [..., 1 ])
1119
+
1108
1120
corners = (minx , miny ), (maxx , maxy )
1109
- self .update_datalim (corners )
1121
+ self .update_datalim (corners , updatex , updatey )
1110
1122
self ._request_autoscale_view ()
1111
-
1112
1123
return lines
1113
1124
1114
1125
@_preprocess_data (replace_names = ["x" , "ymin" , "ymax" , "colors" ],
@@ -1181,14 +1192,25 @@ def vlines(self, x, ymin, ymax, colors=None, linestyles='solid',
1181
1192
# Extreme values of x/ymin/ymax. Using masked_verts here handles
1182
1193
# the case of x being a masked *object* array (as can be generated
1183
1194
# e.g. by errorbar()), which would make nanmin/nanmax stumble.
1184
- minx = np .nanmin (masked_verts [..., 0 ])
1185
- maxx = np .nanmax (masked_verts [..., 0 ])
1186
- miny = np .nanmin (masked_verts [..., 1 ])
1187
- maxy = np .nanmax (masked_verts [..., 1 ])
1195
+ updatex = True
1196
+ updatey = True
1197
+ if self .name == "rectilinear" :
1198
+ datalim = lines .get_datalim (self .transData )
1199
+ t = lines .get_transform ()
1200
+ updatex , updatey = t .contains_branch_seperately (self .transData )
1201
+ minx = np .nanmin (datalim .xmin )
1202
+ maxx = np .nanmax (datalim .xmax )
1203
+ miny = np .nanmin (datalim .ymin )
1204
+ maxy = np .nanmax (datalim .ymax )
1205
+ else :
1206
+ minx = np .nanmin (masked_verts [..., 0 ])
1207
+ maxx = np .nanmax (masked_verts [..., 0 ])
1208
+ miny = np .nanmin (masked_verts [..., 1 ])
1209
+ maxy = np .nanmax (masked_verts [..., 1 ])
1210
+
1188
1211
corners = (minx , miny ), (maxx , maxy )
1189
- self .update_datalim (corners )
1212
+ self .update_datalim (corners , updatex , updatey )
1190
1213
self ._request_autoscale_view ()
1191
-
1192
1214
return lines
1193
1215
1194
1216
@_preprocess_data (replace_names = ["positions" , "lineoffsets" ,
0 commit comments