@@ -1198,23 +1198,27 @@ def _get_verts_in_data_coords(self, trans, xys):
11981198 def _process_unit_info (self , xdata = None , ydata = None , kwargs = None ):
11991199 'look for unit kwargs and update the axis instances as necessary'
12001200
1201- if self .xaxis is None or self .xaxis is None : return
1202-
1201+ if self .xaxis is None or self .yaxis is None : return
12031202
1203+ #print 'processing', self.get_geometry()
12041204 if xdata is not None :
12051205 self .xaxis .update_units (xdata )
1206+ #print '\tset from xdata', self.xaxis.units
12061207
12071208 if ydata is not None :
12081209 self .yaxis .update_units (ydata )
1210+ #print '\tset from ydata', self.yaxis.units
12091211
12101212 # process kwargs 2nd since these will override default units
12111213 if kwargs is not None :
12121214 xunits = kwargs .pop ( 'xunits' , self .xaxis .units )
12131215 if xunits != self .xaxis .units :
1216+ #print '\tkw setting xunits', xunits
12141217 self .xaxis .set_units (xunits )
12151218
12161219 yunits = kwargs .pop ('yunits' , self .yaxis .units )
12171220 if yunits != self .yaxis .units :
1221+ #print '\tkw setting yunits', yunits
12181222 self .yaxis .set_units (yunits )
12191223
12201224 def in_axes (self , xwin , ywin ):
@@ -3114,10 +3118,12 @@ def make_iterable(x):
31143118 else :
31153119 raise ValueError , 'invalid orientation: %s' % orientation
31163120
3117- left = npy .asarray (left )
3118- height = npy .asarray (height )
3119- width = npy .asarray (width )
3120- bottom = npy .asarray (bottom )
3121+
3122+ # do not convert to array here as unit info is lost
3123+ #left = npy.asarray(left)
3124+ #height = npy.asarray(height)
3125+ #width = npy.asarray(width)
3126+ #bottom = npy.asarray(bottom)
31213127
31223128 if len (linewidth ) == 1 : linewidth = linewidth * nbars
31233129
@@ -3161,14 +3167,14 @@ def make_iterable(x):
31613167 # lets do some conversions now
31623168 if self .xaxis is not None :
31633169 xconv = self .xaxis .converter
3164- if ( xconv ) :
3170+ if xconv is not None :
31653171 units = self .xaxis .get_units ()
31663172 left = xconv .convert ( left , units )
31673173 width = xconv .convert ( width , units )
31683174
31693175 if self .yaxis is not None :
31703176 yconv = self .yaxis .converter
3171- if ( yconv ) :
3177+ if yconv is not None :
31723178 units = self .yaxis .get_units ()
31733179 bottom = yconv .convert ( bottom , units )
31743180 height = yconv .convert ( height , units )
@@ -3208,12 +3214,14 @@ def make_iterable(x):
32083214
32093215 if xerr is not None or yerr is not None :
32103216 if orientation == 'vertical' :
3211- x = left + 0.5 * width
3212- y = bottom + height
3217+ # using list comps rather than arrays to preserve unit info
3218+ x = [l + 0.5 * w for l , w in zip (left , width )]
3219+ y = [b + h for b ,h in zip (bottom , height )]
32133220
32143221 elif orientation == 'horizontal' :
3215- x = left + width
3216- y = bottom + 0.5 * height
3222+ # using list comps rather than arrays to preserve unit info
3223+ x = [l + w for l ,w in zip (left , width )]
3224+ y = [b + 0.5 * h for b ,h in zip (bottom , height )]
32173225
32183226 self .errorbar (
32193227 x , y ,
0 commit comments