getting the dimensions of an axes

I am making a heat map and want to label each row. I thus need the font size of the text to scale with the number of rows in the heat map. Is there a way to find out the length in points of an axes object so I can divide this by the number of rows and thus figure out how big to make the text?

Thanks for the help

Assuming you start out with this:

    import matplotlib.pyplot as plt
    fig, ax1 = plt.subplots()

You can then do this:

    figsize = fig.get_size_inches()
    ax_pos = ax1.get_position().get_points()

The variable figsize is now a array of the figure's width and height. And
ax_pos is an array with the first row being the x-y location of the lower
left corner of the axes on the figure in figure fraction coordinates. The
second row is the width and height of the axes, again expressed as a
fraction of the total figure dimensions.

Hope that helps,
-paul

···

On Mon, Jan 21, 2013 at 4:28 AM, Kelson Zawack <kbz6@...163...> wrote:

a heat map and want to label each row. I thus need the font
size of the text to scale with the number of rows in the heat map. Is