|
From: Chris B. <Chr...@no...> - 2005-05-13 17:53:37
|
Florian Lindner wrote: > Hello, > taken form the tutorial http://matplotlib.sourceforge.net/leftwich_tut.txt I > use the code: > > from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas > from matplotlib.figure import Figure > > fig = Figure() > canvas = FigureCanvas(fig) > ax = fig.add_subplot(111) > ax.plot([1,2,3]) > ax.set_title('hi mom') > ax.grid(True) > ax.set_xlabel('time') > ax.set_ylabel('volts') > canvas.print_figure('test') > > Which IMO uses the AGG backend (which works fine for my using the pylab > interface). > > But upon excecution I get: > > No module named pygtk > PyGTK version 1.99.16 or greater is required to run the GTK Matplotlib > backends while this shouldn't be necessary for this script, you might try: import matplotlib matplotlib.use("AGG") # I may have that string wrong. before any of the other imports. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |