SIAM CSE 2009 scientific visualisation for python John Hunter Tradelink Chicago
SIAM CSE 2009 Talk outline The matplotlib community matplotlib 3 ways: shell (pylab), scripts and embedding (GUIs) Interactive demo
SIAM CSE 2009 The matplotlib community approx 15,000 downloads / month + linux, etc developers: 17 with commit rights, 4-5 active at one time mailing list: approx 1000 subscribers and 500+ posts / month institutional users – STScI, JPL, NOAA, NIST, Los Alamos,...
SIAM CSE 2009
nipy: pbrain
SIAM CSE 2009
basemap toolkit (courtesy of NOAA)
SIAM CSE 2009 cylindrical equidistant, mercator, lambert conformal conic, lambert azimuthal equal area, albers equal area conic and stereographic. basemap toolkit
SIAM CSE 2009 finance demo
SIAM CSE 2009 Hubble Space Telescope (courtesy of STScI)
SIAM CSE 2009
matplotlib 3 ways embedding in a webserver or GUI (Tk, GTK, WX, Cocoa, Qt, FLTK) production scripting interactive shell (pylab / pyplot)
SIAM CSE 2009 matplotlib API 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]) a ax.set_title('hi mom') ax.grid(True) ax.set_xlabel('time') ax.set_ylabel('volts') fig.savefig('test')
SIAM CSE 2009 Copy the great architectures E Tufte
SIAM CSE 2009 pylab interface Plotting should just work Easy plots should be easy GUI / interactive complexity should be managed ipython to the rescue IPython _cvs -- An enhanced Interactive Python. ? -> Introduction to IPython's features. %magic -> Information about IPython's 'magic' % functions. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. Welcome to pylab, a matplotlib-based Python environment help(matplotlib) -> generic matplotlib information help(pylab) -> matlab-compatible commands from matplotlib help(plotting) -> plotting commands In [1]: plot([1,2,3])
SIAM CSE 2009 interactive demo the interactive shell, rich data structures, numpy arrays, pylab mode rich text support, what you see is what you get, mathtext event handling, GUI embedding website - sphinx
SIAM CSE 2009 bar demo
SIAM CSE 2009 stacked bar
SIAM CSE 2009 pie demo
SIAM CSE 2009 subplot demo
SIAM CSE 2009 axes demo
SIAM CSE 2009
scatter demo
SIAM CSE 2009 legend demo
SIAM CSE 2009 histogram demo
SIAM CSE 2009 log demo
SIAM CSE 2009 polar demo
SIAM CSE 2009 text alignment
SIAM CSE 2009
matplotlib screenshot TeX support
SIAM CSE 2009 layer image
SIAM CSE 2009 Other visualization tools (and what they excel at) Enthought chaco: fast real time plotting and highly interactive figures VTK / tVTK / mayavi2: 3D viz PyX : high powered, full featured Postscript and TeX integration PIL: image manipulation
SIAM CSE 2009
backends
SIAM CSE 2009 Fits your brain: “hello world” in 4 languages
SIAM CSE 2009 Third party libraries
SIAM CSE 2009 Fits your brain (part II): But I think this is the python