[SciPy-user] autolabels for barcharts

Timmie timmichelsen@gmx-topmail...
Thu Mar 5 08:49:16 CST 2009

I have a question regarding autolabels for bar charts.

It seems that the pie charts have already incorporated such a functionality [1].
Is there any reason why this isn't built in the bar chart function [2]?

The function I am referring to is:

def autolabel(rects):
    # attach some text labels
    for rect in rects:
        #~ print rect
        height = rect.get_height()
        print height
        ax.text(rect.get_x()+rect.get_width()/2., 1.05*height, '%d'%int(height),
                ha='center', va='bottom')

Thanks in advance for the clarification,



More information about the SciPy-user mailing list