Upload
alice-tucker
View
217
Download
0
Tags:
Embed Size (px)
Citation preview
MLOSS: Whistler 2008
MLOSS: Whistler 2008
MLOSS: Whistler 2008
MLOSS: Whistler 2008
MLOSS: Whistler 2008
Copy the great architecturesE Tufte
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])
MLOSS: Whistler 2008
Fits your brain: “hello world” in 4 languages
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
MLOSS: Whistler 2008
Third party libraries
MLOSS: Whistler 2008
Fits your brain (part II):
But I think this is the
python
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
MLOSS: Whistler 2008
bar demo
MLOSS: Whistler 2008
stacked bar
MLOSS: Whistler 2008
pie demo
MLOSS: Whistler 2008
subplot demo
MLOSS: Whistler 2008axes demo
MLOSS: Whistler 2008
MLOSS: Whistler 2008
scatter demo
MLOSS: Whistler 2008
legend demo
MLOSS: Whistler 2008
histogram demo
MLOSS: Whistler 2008
log demo
MLOSS: Whistler 2008
polar demo
MLOSS: Whistler 2008
text alignment
MLOSS: Whistler 2008
MLOSS: Whistler 2008
matplotlib screenshotTeX support
MLOSS: Whistler 2008
layer image
MLOSS: Whistler 2008
basemap toolkit (courtesy of NOAA)
MLOSS: Whistler 2008
cylindrical equidistant, mercator, lambert conformal conic, lambert azimuthal equal area, albers equal area conic and stereographic.
basemaptoolkit
MLOSS: Whistler 2008
finance demo
MLOSS: Whistler 2008
MLOSS: Whistler 2008
Michelle SannerScripps
MLOSS: Whistler 2008
Hubble Space Telescope
(courtesy of STScI)
MLOSS: Whistler 2008
MLOSS: Whistler 2008
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')
MLOSS: Whistler 2008
MLOSS: Whistler 2008
backends