File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -1946,10 +1946,13 @@ def make_iterable(x):
1946
1946
if len (bottom ) == 1 :
1947
1947
bottom *= nbars
1948
1948
if nbars and cbook .is_sequence_of_strings (left ):
1949
- ticks_loc = [i + width [ i ] / 2 for i in range ( nbars )]
1949
+ ticks_loc = [i + w / 2 for i , w in enumerate ( width )]
1950
1950
self .xaxis .set_ticks (ticks_loc )
1951
1951
self .xaxis .set_ticklabels (left )
1952
- left = range (nbars )
1952
+ left = np .arange (nbars )
1953
+ if nbars and cbook .is_sequence_of_strings (bottom ):
1954
+ raise ValueError ('bottom must be scalar or sequence of scalar '
1955
+ 'for vertical bar' )
1953
1956
elif orientation == 'horizontal' :
1954
1957
self ._process_unit_info (xdata = width , ydata = bottom , kwargs = kwargs )
1955
1958
if log :
@@ -1966,10 +1969,13 @@ def make_iterable(x):
1966
1969
if len (height ) == 1 :
1967
1970
height *= nbars
1968
1971
if nbars and cbook .is_sequence_of_strings (bottom ):
1969
- ticks_loc = [i + height [ i ] / 2 for i in range ( nbars )]
1972
+ ticks_loc = [i + h / 2 for i , h in enumerate ( height )]
1970
1973
self .yaxis .set_ticks (ticks_loc )
1971
1974
self .yaxis .set_ticklabels (bottom )
1972
- bottom = range (nbars )
1975
+ bottom = np .arange (nbars )
1976
+ if nbars and cbook .is_sequence_of_strings (left ):
1977
+ raise ValueError ('left must be scalar or sequence of scalar '
1978
+ 'for horizontal bar' )
1973
1979
else :
1974
1980
raise ValueError ('invalid orientation: %s' % orientation )
1975
1981
You can’t perform that action at this time.
0 commit comments