Hi,

Pau <vim.u...@googlemail.com>
> Hello,
> 
> I am trying to print in the plot the value of a time variable which I
> obtain like this
> 
> Time       = MBH_inst[0]  # Column 1
> 
> This should be placed on the top right part of the plot showing the current
> time
> 
> Time = XXX yrs
> 
> But I do not know how to pass this to ax.annotate:
> 
> ax.annotate('Time = ', size=18, xy=(3, 1),  xycoords='data',
>             xytext=(0.8, 0.95), textcoords='axes fraction',
>             horizontalalignment='right', verticalalignment='top',
>             )

Maybe like this:

ax.annotate('Time = %f'%(MBH_inst[0],), size=18, xy=(3, 1),  xycoords='data',
            xytext=(0.8, 0.95), textcoords='axes fraction',
            horizontalalignment='right', verticalalignment='top',
            )
?

You can also adjust the number of shown digits right of the comma by setting 
it up like this: %0.2f etc.

Just look it up in the python documentation (search hints: python string 
format).


Wish you the best,

Malte

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to