Thanks for your help I use the code below , but the plot wont be diplayed on my screen .
matplotlib.use('TkAgg') import matplotlib.pylab as plt fig = plt.figure() ax = fig.add_subplot(111) ax.plot(x, y, marker='o', linestyle='', markerfacecolor='green') ax.set_title('Some random dots') ax.set_xlabel('x') ax.set_ylabel('y') ax.grid(True) fig.savefig('myplot.png', dpi=100) plt.show() Would you please help me ? 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 > > -- View this message in context: http://www.nabble.com/Backend-Agg---show-plot-tp15527044p15527408.html Sent from the matplotlib - users mailing list archive at Nabble.com. ------------------------------------------------------------------------- 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