hi, try this. It is simpler then some of the examples:

import pylab
# func - list of X, Y coordinates
func = [ 0, 0, 1, 2, 2, 3, 3, 2, 4, 1, 5, 1.4, ]
#
pylab.plot(func[0::2], func[1::2], 'b-', linewidth=3)
pylab.title(' Plot for function ...')
pylab.xlabel(' X name ')
pylab.ylabel(' Y name ' )
pylab.grid(True)
pylab.show()
#pylab.savefig('blahblah.png', facecolor='lightgrey', edgecolor='w')
pylab.close()
#


sa6113 wrote:
Thanks alot for your help, I could show the plot on the screen on python 2.4
.
I've used pyhton 2.3 .


Eric Firing wrote:
sa6113 wrote:
How should I darw and show a plot using Backend Agg , I don't want to
save
figure , just show ?
If you don't want to save a figure, then you will need an interactive backend--not Agg, but TkAgg or GtkAgg etc. Then you end your script with "show()" (imported from pylab or matplotlib.pyplot), and the plot will be diplayed on your screen. (The plain Agg backend is useful only with "savefig(...)" to generate png files.)

Check out the "examples" directory in the distribution.

Eric

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users




--
Chris Kennedy                  http://www.coventor.com
Sr. Product Manager            Ph: 919-854-7500 x156
Cary, NC                       Fx: 919-854-7501
                          Mobile: 919-414-6653
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to