From: John H. <jdh...@ac...> - 2006-08-03 21:39:27
|
>>>>> "Gregory" =3D=3D Gregory Pi=F1ero <gre...@gm...> writes: Gregory> On 8/3/06, John Hunter <jdh...@ac...> Gregory> wrote: >> >>>>> "Gregory" =3D=3D Gregory Pi=F1ero <gre...@gm...> >> writes: Gregory> bar centers on the y axis p1 =3D 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=3DFigureCanvasAgg(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 =3D [2,5,3,6,3] # the bar lengths pos =3D arange(5)+.5 # the bar centers on the y axis =20 p1 =3D figure.gca().barh(pos,val, align=3D'center') ax =3D 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=3DFigureCanvasAgg(figure) JDH |