>>> David Goldsmith <[EMAIL PROTECTED]> 06/19/08 9:39 AM >>> Hi! I'm having trouble figuring out how to plot an array as an image with the OO interface - please help (e.g., w/ an example). Thanks,
DG >>> >From the examples >http://matplotlib.sourceforge.net/matplotlib_examples_0.98.0.zip ../examples/api/agg_oo.py -------------------------------------------- #!/usr/bin/env python """ A pure OO (look Ma, no pylab!) example using the agg backend """ 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') -------------------------------------------- You can replace the call to ax.plot() with a call to ax.imshow() or ax.pcolor() Hope that gets you going. Cheers, Scott Please find our Email Disclaimer here: http://www.ukzn.ac.za/disclaimer/ ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users