---------- Forwarded message ----------
From: Scott Sinclair <sco...@gm...>
Date: 17 May 2011 14:52
Subject: Re: [Matplotlib-users] result in the graph
To: Waleria <wal...@gm...>
On 17 May 2011 14:35, Waleria <wal...@gm...> wrote:
> Hello all,
>
> I have this code: http://dpaste.com/543369/ (part that generates the chart)
> . So i need to show a result in the graph, i have the line 69 (variable
> x_sqr) in code, i need to show tthe result of variable in the graph. How can
> i do this?
How about:
import matplotlib.pyplot as plt
x_sqr = 42.42
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(range(5))
ax.text(3, 2, r'x$^2$ = %.2f' % x_sqr)
plt.show()
Cheers,
Scott
|