@@ -1193,23 +1193,27 @@ def _get_verts_in_data_coords(self, trans, xys):
11931193 def _process_unit_info (self , xdata = None , ydata = None , kwargs = None ):
11941194 'look for unit kwargs and update the axis instances as necessary'
11951195
1196- if self .xaxis is None or self .xaxis is None : return
1197-
1196+ if self .xaxis is None or self .yaxis is None : return
11981197
1198+ #print 'processing', self.get_geometry()
11991199 if xdata is not None :
12001200 self .xaxis .update_units (xdata )
1201+ #print '\tset from xdata', self.xaxis.units
12011202
12021203 if ydata is not None :
12031204 self .yaxis .update_units (ydata )
1205+ #print '\tset from ydata', self.yaxis.units
12041206
12051207 # process kwargs 2nd since these will override default units
12061208 if kwargs is not None :
12071209 xunits = kwargs .pop ( 'xunits' , self .xaxis .units )
12081210 if xunits != self .xaxis .units :
1211+ #print '\tkw setting xunits', xunits
12091212 self .xaxis .set_units (xunits )
12101213
12111214 yunits = kwargs .pop ('yunits' , self .yaxis .units )
12121215 if yunits != self .yaxis .units :
1216+ #print '\tkw setting yunits', yunits
12131217 self .yaxis .set_units (yunits )
12141218
12151219 def in_axes (self , xwin , ywin ):
@@ -3122,10 +3126,12 @@ def make_iterable(x):
31223126 else :
31233127 raise ValueError , 'invalid orientation: %s' % orientation
31243128
3125- left = npy .asarray (left )
3126- height = npy .asarray (height )
3127- width = npy .asarray (width )
3128- bottom = npy .asarray (bottom )
3129+
3130+ # do not convert to array here as unit info is lost
3131+ #left = npy.asarray(left)
3132+ #height = npy.asarray(height)
3133+ #width = npy.asarray(width)
3134+ #bottom = npy.asarray(bottom)
31293135
31303136 if len (linewidth ) == 1 : linewidth = linewidth * nbars
31313137
@@ -3169,14 +3175,14 @@ def make_iterable(x):
31693175 # lets do some conversions now
31703176 if self .xaxis is not None :
31713177 xconv = self .xaxis .converter
3172- if ( xconv ) :
3178+ if xconv is not None :
31733179 units = self .xaxis .get_units ()
31743180 left = xconv .convert ( left , units )
31753181 width = xconv .convert ( width , units )
31763182
31773183 if self .yaxis is not None :
31783184 yconv = self .yaxis .converter
3179- if ( yconv ) :
3185+ if yconv is not None :
31803186 units = self .yaxis .get_units ()
31813187 bottom = yconv .convert ( bottom , units )
31823188 height = yconv .convert ( height , units )
@@ -3216,12 +3222,14 @@ def make_iterable(x):
32163222
32173223 if xerr is not None or yerr is not None :
32183224 if orientation == 'vertical' :
3219- x = left + 0.5 * width
3220- y = bottom + height
3225+ # using list comps rather than arrays to preserve unit info
3226+ x = [l + 0.5 * w for l , w in zip (left , width )]
3227+ y = [b + h for b ,h in zip (bottom , height )]
32213228
32223229 elif orientation == 'horizontal' :
3223- x = left + width
3224- y = bottom + 0.5 * height
3230+ # using list comps rather than arrays to preserve unit info
3231+ x = [l + w for l ,w in zip (left , width )]
3232+ y = [b + 0.5 * h for b ,h in zip (bottom , height )]
32253233
32263234 self .errorbar (
32273235 x , y ,
0 commit comments