@@ -2232,23 +2232,38 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
2232
2232
else :
2233
2233
raise ValueError ('invalid orientation: %s' % orientation )
2234
2234
2235
+ x , height , width , y , linewidth = np .broadcast_arrays (
2236
+ # Make args iterable too.
2237
+ np .atleast_1d (x ), height , width , y , linewidth )
2238
+
2235
2239
# lets do some conversions now since some types cannot be
2236
2240
# subtracted uniformly
2237
2241
if self .xaxis is not None :
2242
+ x0 = x
2238
2243
x = self .convert_xunits (x )
2239
- width = self .convert_xunits (width )
2244
+ try :
2245
+ width = self .convert_xunits (x0 + width ) - x
2246
+ except TypeError :
2247
+ width = self .convert_xunits (width )
2240
2248
if xerr is not None :
2241
- xerr = self .convert_xunits (xerr )
2249
+ try :
2250
+ xerr = self .convert_xunits (x0 + xerr ) - x
2251
+ except :
2252
+ xerr = self .convert_xunits (xerr )
2242
2253
2243
2254
if self .yaxis is not None :
2255
+ y0 = y
2244
2256
y = self .convert_yunits (y )
2245
- height = self .convert_yunits (height )
2257
+ try :
2258
+ height = self .convert_yunits (y0 + height ) - y
2259
+ except TypeError :
2260
+ height = self .convert_yunits (height )
2246
2261
if yerr is not None :
2247
- yerr = self .convert_yunits (yerr )
2262
+ try :
2263
+ yerr = self .convert_yunits (y0 + yerr ) - y
2264
+ except :
2265
+ yerr = self .convert_yunits (yerr )
2248
2266
2249
- x , height , width , y , linewidth = np .broadcast_arrays (
2250
- # Make args iterable too.
2251
- np .atleast_1d (x ), height , width , y , linewidth )
2252
2267
2253
2268
# Now that units have been converted, set the tick locations.
2254
2269
if orientation == 'vertical' :
0 commit comments