@@ -2190,39 +2190,17 @@ def bar(self, *args, **kwargs):
2190
2190
adjust_xlim = True
2191
2191
x = 0
2192
2192
2193
- x , height , width , y , linewidth = np .broadcast_arrays (
2194
- # Make args iterable too.
2195
- np .atleast_1d (x ), height , width , y , linewidth )
2196
-
2197
2193
if orientation == 'vertical' :
2198
2194
self ._process_unit_info (xdata = x , ydata = height , kwargs = kwargs )
2199
2195
if log :
2200
2196
self .set_yscale ('log' , nonposy = 'clip' )
2201
-
2202
- tick_label_axis = self .xaxis
2203
- tick_label_position = x
2204
2197
elif orientation == 'horizontal' :
2205
2198
self ._process_unit_info (xdata = width , ydata = y , kwargs = kwargs )
2206
2199
if log :
2207
2200
self .set_xscale ('log' , nonposx = 'clip' )
2208
-
2209
- tick_label_axis = self .yaxis
2210
- tick_label_position = y
2211
2201
else :
2212
2202
raise ValueError ('invalid orientation: %s' % orientation )
2213
2203
2214
- linewidth = itertools .cycle (np .atleast_1d (linewidth ))
2215
- color = itertools .chain (itertools .cycle (mcolors .to_rgba_array (color )),
2216
- # Fallback if color == "none".
2217
- itertools .repeat ([0 , 0 , 0 , 0 ]))
2218
- if edgecolor is None :
2219
- edgecolor = itertools .repeat (None )
2220
- else :
2221
- edgecolor = itertools .chain (
2222
- itertools .cycle (mcolors .to_rgba_array (edgecolor )),
2223
- # Fallback if edgecolor == "none".
2224
- itertools .repeat ([0 , 0 , 0 , 0 ]))
2225
-
2226
2204
# lets do some conversions now since some types cannot be
2227
2205
# subtracted uniformly
2228
2206
if self .xaxis is not None :
@@ -2237,6 +2215,30 @@ def bar(self, *args, **kwargs):
2237
2215
if yerr is not None :
2238
2216
yerr = self .convert_yunits (yerr )
2239
2217
2218
+ x , height , width , y , linewidth = np .broadcast_arrays (
2219
+ # Make args iterable too.
2220
+ np .atleast_1d (x ), height , width , y , linewidth )
2221
+
2222
+ # Now that units have been converted, set the tick locations.
2223
+ if orientation == 'vertical' :
2224
+ tick_label_axis = self .xaxis
2225
+ tick_label_position = x
2226
+ elif orientation == 'horizontal' :
2227
+ tick_label_axis = self .yaxis
2228
+ tick_label_position = y
2229
+
2230
+ linewidth = itertools .cycle (np .atleast_1d (linewidth ))
2231
+ color = itertools .chain (itertools .cycle (mcolors .to_rgba_array (color )),
2232
+ # Fallback if color == "none".
2233
+ itertools .repeat ([0 , 0 , 0 , 0 ]))
2234
+ if edgecolor is None :
2235
+ edgecolor = itertools .repeat (None )
2236
+ else :
2237
+ edgecolor = itertools .chain (
2238
+ itertools .cycle (mcolors .to_rgba_array (edgecolor )),
2239
+ # Fallback if edgecolor == "none".
2240
+ itertools .repeat ([0 , 0 , 0 , 0 ]))
2241
+
2240
2242
# We will now resolve the alignment and really have
2241
2243
# left, bottom, width, height vectors
2242
2244
if align == 'center' :
0 commit comments