Skip to content

Commit bdbaf73

Browse files
author
James Evans
committed
Made a change to Axes.bar to preprocess the units so that it can perform un-unitized mathematics.
svn path=/trunk/matplotlib/; revision=3259
1 parent be73ef4 commit bdbaf73

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

lib/matplotlib/axes.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3092,6 +3092,20 @@ def make_iterable(x):
30923092

30933093
patches = []
30943094

3095+
# lets do some conversions now
3096+
xconv = self.xaxis.converter
3097+
if ( xconv ):
3098+
units = self.xaxis.get_units()
3099+
left = xconv.convert( left, units )
3100+
width = xconv.convert( width, units )
3101+
3102+
yconv = self.yaxis.converter
3103+
if ( yconv ):
3104+
units = self.yaxis.get_units()
3105+
bottom = yconv.convert( bottom, units )
3106+
height = yconv.convert( height, units )
3107+
3108+
30953109
if align == 'edge':
30963110
pass
30973111
elif align == 'center':
@@ -3108,6 +3122,9 @@ def make_iterable(x):
31083122
if h<0:
31093123
b += h
31103124
h = abs(h)
3125+
if w<0:
3126+
l += w
3127+
w = abs(w)
31113128
r = Rectangle(
31123129
xy=(l, b), width=w, height=h,
31133130
facecolor=c,

0 commit comments

Comments
 (0)