I have asked this question on Stackoverflow alredy, but got no answer. Thread
I want to read out the position of an Axis-label to append a second text on the same line (colored) like this:
labelpos = ax.yaxis.label.get_window_extent()
box = labelpos.transformed(ax.transAxes.inverted())
but. the result is this:
And the same with the ticklabels:
extents1, extents2 = ax.yaxis.get_ticklabel_extents(renderer = fig.canvas.get_renderer())
box = extents2.transformed(ax.transAxes.inverted())
After some research I have found my problem could lay way deeper, for the
matplotlib.artist.Artist.get_window_extent it says from here:
Be careful when using this function, the results will not update if
the artist window extent of the artist changes.
Soo… could it be that the labels getting moved by the artist and it is not possible to read out the current position?