>>>>> "Gregory" == Gregory Piñero <[EMAIL PROTECTED]> writes:

    Gregory> On 8/3/06, John Hunter <[EMAIL PROTECTED]>
    Gregory> wrote:
    >> >>>>> "Gregory" == Gregory Piñero <[EMAIL PROTECTED]>
    >> writes:
    Gregory> bar centers on the y axis p1 = figure.gca().barh(pos,val)
    Gregory> figure.gca().set_yticks(pos)
    Gregory> figure.gca().set_yticklabels(('Tom', 'Dick', 'Harry',
    Gregory> 'Slim', 'Jim')) figure.gca().set_xlabel('Perfomance')
    Gregory> figure.gca().set_title('How fast do you want to go
    Gregory> today?')  canvas=FigureCanvasAgg(figure) return canvas
    >>
    Gregory> I changed the code to above but it still gives a similair
    Gregory> result.

The following, with svn mpl, works.  If it doesn't work for you, make
sure to upgrade your matplotlib; note the use of "align" which is a
fairly recent addition to mpl

    val = [2,5,3,6,3]    # the bar lengths
    pos = arange(5)+.5    # the bar centers on the y axis
    
    p1 = figure.gca().barh(pos,val, align='center')
    ax = figure.gca()
    ax.set_yticks(pos)
    ax.set_yticklabels(('Tom', 'Dick', 'Harry', 'Slim', 'Jim'))
    ax.set_xlabel('Perfomance')
    ax.set_title('How fast do you want to go today?')
    canvas=FigureCanvasAgg(figure)

JDH

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to