mloss: whistler 2008 scientific visualisation for python john hunter tradelink chicago...

38
MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago [email protected]

Upload: alice-tucker

Post on 20-Jan-2016

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

scientific visualisation for python

John HunterTradelink [email protected]

Page 2: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

Page 3: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

Page 4: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

Page 5: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

Page 6: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

Copy the great architecturesE Tufte

Page 7: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

pylab interface• Plotting should just work

• Easy plots should be easy

• GUI / interactive complexity should be managed

• ipython to the rescue

IPython 0.6.12_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])

Page 8: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

Fits your brain: “hello world” in 4 languages

Page 9: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

scalable, versatile scales from interactive scripts to full blown apps doesn't force one programming paradigm on

you plays very well with other languages

Page 10: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

Third party libraries

Page 11: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

Fits your brain (part II):

But I think this is the

python

Page 12: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

interactive interlude

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

Page 13: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

bar demo

Page 14: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

stacked bar

Page 15: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

pie demo

Page 16: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

subplot demo

Page 17: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008axes demo

Page 18: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

Page 19: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

scatter demo

Page 20: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

legend demo

Page 21: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

histogram demo

Page 22: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

log demo

Page 23: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

polar demo

Page 24: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

text alignment

Page 25: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

Page 26: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

matplotlib screenshotTeX support

Page 27: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

layer image

Page 28: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

basemap toolkit (courtesy of NOAA)

Page 29: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

cylindrical equidistant, mercator, lambert conformal conic, lambert azimuthal equal area, albers equal area conic and stereographic.

basemaptoolkit

Page 30: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

finance demo

Page 31: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

Page 32: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

Michelle SannerScripps

Page 33: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

Hubble Space Telescope

(courtesy of STScI)

Page 34: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

Page 35: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

Page 36: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

The matplotlib APIfrom matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvasfrom matplotlib.figure import Figure

fig = Figure()canvas = FigureCanvas(fig)ax = fig.add_subplot(111)ax.plot([1,2,3]) aax.set_title('hi mom')ax.grid(True)ax.set_xlabel('time')ax.set_ylabel('volts')fig.savefig('test')

Page 37: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

Page 38: MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago jdh2358@gmail.com

MLOSS: Whistler 2008

backends