barh gives me: ValueError: frames are not aligned

Hi Fine Matplotlib folks,

I'm getting this error message and I can figure it out:

Traceback (most recent call last):
...
  File "C:\automated tasks\GMVIEW-DEV\chart_gen.debug.py", line 26, in ?
    p1 = figure.gca().barh(ind, ddata['value'], width, color='r')
  File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 2499, in barh
    bottom = y - height/2.
ValueError: frames are not aligned

Here is the relevant code:
<code>
from __future__ import division
import os,sys
import datetime
import tempfile
import matplotlib
matplotlib.use('Agg') # force the antigrain backend
from matplotlib.dates import YearLocator, MonthLocator,
WeekdayLocator, DateFormatter, date2num
from matplotlib import rc
from matplotlib.backends.backend_agg import FigureCanvasAgg
from matplotlib.figure import Figure
from matplotlib.cbook import iterable
import matplotlib.numerix as nx

ddata={'label': ['REP1', 'REP2', 'REP3', 'REP4', 'REP5'], 'type':
'bar_sideways', 'value': ['23.00', '1381.56', '4606.69', '259.00',
'50.00'], 'money_format': '1', 'title': 'Sales from 2006-08-01 to
2006-08-02'}
height,width=3,4
figure = Figure(figsize=(width,height))
ax = figure.add_axes([0.2, 0.3, 0.7, 0.6])
from Numeric import arange #makes arrays
N=len(ddata['value'])
ind = arange(N) # the x locations for the groups
width=(figure.get_size_inches()[0]/len(ddata['value']))
width_gap=(.3*width)
width=width-width_gap # the width of the bars

#OFFENDING LINE
p1 = figure.gca().barh(ind, ddata['value'], width, color='r')

figure.gca().set_ylabel('$Amount')
if title:
    figure.gca().set_title('title', bbox={'facecolor':'0.8', 'pad':5})
locs = figure.gca().set_xticks(ind+width_gap)
labels = figure.gca().set_xticklabels(ddata['label'])
figure.gca().set_xlim(-width,len(ind))
#try to autoscale here
y_height=max(ddata['value'])+.2*max(ddata['value'])
y_increment=round(y_height/5,-1)
figure.gca().set_yticks(arange(0,y_height,y_increment))
canvas = FigureCanvasAgg(figure)
</code>

any help is greatly appriciated!

···

--
Gregory Piñero
Chief Innovation Officer
Blended Technologies
(www.blendedtechnologies.com)

Ok, figured it out. My values had to be floats. They were strings.
Sorry for the trouble.

···

On 8/3/06, Gregory Piñero <gregpinero@...287...> wrote:

Hi Fine Matplotlib folks,

I'm getting this error message and I can figure it out:

Traceback (most recent call last):
...
  File "C:\automated tasks\GMVIEW-DEV\chart_gen.debug.py", line 26, in ?
    p1 = figure.gca().barh(ind, ddata['value'], width, color='r')
  File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 2499, in barh
    bottom = y - height/2.
ValueError: frames are not aligned

Here is the relevant code:
<code>
from __future__ import division
import os,sys
import datetime
import tempfile
import matplotlib
matplotlib.use('Agg') # force the antigrain backend
from matplotlib.dates import YearLocator, MonthLocator,
WeekdayLocator, DateFormatter, date2num
from matplotlib import rc
from matplotlib.backends.backend_agg import FigureCanvasAgg
from matplotlib.figure import Figure
from matplotlib.cbook import iterable
import matplotlib.numerix as nx

ddata={'label': ['REP1', 'REP2', 'REP3', 'REP4', 'REP5'], 'type':
'bar_sideways', 'value': ['23.00', '1381.56', '4606.69', '259.00',
'50.00'], 'money_format': '1', 'title': 'Sales from 2006-08-01 to
2006-08-02'}
height,width=3,4
figure = Figure(figsize=(width,height))
ax = figure.add_axes([0.2, 0.3, 0.7, 0.6])
from Numeric import arange #makes arrays
N=len(ddata['value'])
ind = arange(N) # the x locations for the groups
width=(figure.get_size_inches()[0]/len(ddata['value']))
width_gap=(.3*width)
width=width-width_gap # the width of the bars

#OFFENDING LINE
p1 = figure.gca().barh(ind, ddata['value'], width, color='r')

figure.gca().set_ylabel('$Amount')
if title:
    figure.gca().set_title('title', bbox={'facecolor':'0.8', 'pad':5})
locs = figure.gca().set_xticks(ind+width_gap)
labels = figure.gca().set_xticklabels(ddata['label'])
figure.gca().set_xlim(-width,len(ind))
#try to autoscale here
y_height=max(ddata['value'])+.2*max(ddata['value'])
y_increment=round(y_height/5,-1)
figure.gca().set_yticks(arange(0,y_height,y_increment))
canvas = FigureCanvasAgg(figure)
</code>

any help is greatly appriciated!

--
Gregory Piñero
Chief Innovation Officer
Blended Technologies
(www.blendedtechnologies.com)

--
Gregory Piñero
Chief Innovation Officer
Blended Technologies
(www.blendedtechnologies.com)