Finally figured it out after pulling some hear.

Using "axes.annotate" instead of "axes.text" worked for me, i.e. 
something like this:

axes.annotate(hstr, xy=(xCorr, yCorr), xytext=(0, 5), textcoords='offset 
points')

instead of what I did originally.

Werner

On 08/11/2010 16:21, Werner F. Bruhin wrote:
> I like to have 2 or 3 text elements "stacked" on top of each other on
> top of a bar.
>
> Currently it works for the first text element by doing:
>
> height = bar.get_height()
> xCorr = bar.get_x()
> yCorr = 0.20 + height
>
> txtax = axes.text(xCorr, yCorr, hstr)
>
> trying to add the second text just above the previous one I tried this:
>
> pCorr = yCorr + txtax.get_size() + 0.4
> txtax = axes.text(xCorr, pCorr, hstrPerc)
>
> It looks like my problem is that get_x() returns a value in ticks and
> txtax.get_size() is in pixels and I can't find a way to get at the
> height of the text element in ticks.
>
> Can anyone please push me in the right direction.
>
> Werner
>
>
>
>
> ------------------------------------------------------------------------------
> The Next 800 Companies to Lead America's Growth: New Video Whitepaper
> David G. Thomson, author of the best-selling book "Blueprint to a
> Billion" shares his insights and actions to help propel your
> business during the next growth cycle. Listen Now!
> http://p.sf.net/sfu/SAP-dev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>



------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to