Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

Nicolas P. Rougier: - Researcher in computational cognitive neuroscience, located in Bordeaux, France - Inria (the French institute for computer science) - Institute of Neurodegenerative Diseases - Author of several scientific computing books (All Free!) - Python & OpenGL for Scientific Visualization - From Python to Numpy - Scipy Lecture Notes Jake VanderPlas: - Visiting Researcher Google Seattle Office - Former Director of Open Software at the University of Washington’s eScience institute - Contributions made in - Scikit-Learn - SciPy - AstroPy - Altair

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

Part One: The Origin Story

Slide 5

Slide 5 text

Matplotlib was created by John D. Hunter in 2003 to visualize electrocorticography data. In a post to the official python mailing list John writes ... My goal is to make high quality, publication quality plotting easy in python, with a syntax familiar to matlab users.

Slide 6

Slide 6 text

Matplotlib was created by John D. Hunter in 2003 to visualize electrocorticography data. In a post to the official python mailing list John writes ... My goal is to make high quality, publication quality plotting easy in python, with a syntax familiar to matlab users. Also motivated later in the post ... * make easy things easy (subplots, lines styles, colors) * make hard things possible (OO interface for full control)

Slide 7

Slide 7 text

Matplotlib Development Timeline

Slide 8

Slide 8 text

The Python Visualization Landscape

Slide 9

Slide 9 text

Important Questions: - Do you target desktop or web rendering? - Do you need complex 3D rendering? - Do you need publication quality? - Do you have very large data? - Is there an active community? - Are there documentation and tutorials?

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

Strengths: - Designed like MatLab: switching was easy

Slide 14

Slide 14 text

Strengths: - Designed like MatLab: switching was easy - Many rendering backends

Slide 15

Slide 15 text

Strengths: - Designed like MatLab: switching was easy - Many rendering backends - Can reproduce just about any plot (with a bit of effort)

Slide 16

Slide 16 text

Strengths: - Designed like MatLab: switching was easy - Many rendering backends - Can reproduce just about any plot (with a bit of effort) - Well-tested, standard tool for over a decade

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

Strengths: - Designed like MatLab: switching was easy - Many rendering backends - Can reproduce just about any plot (with a bit of effort) - Well-tested, standard tool for over a decade Weaknesses: - API is imperative & often overly verbose - Poor support for web/interactive graphics - Often slow for large & complicated data

Slide 21

Slide 21 text

Part Two: The Tale of Two API’s

Slide 22

Slide 22 text

Matplotlib is organized in a hierarchy.

Slide 23

Slide 23 text

Matplotlib is organized in a hierarchy. At the top of the hierarchy is the matplotlib "state-machine environment" which is provided by the matplotlib.pyplot module. At this level, simple functions are used to add plot elements (lines, images, text, etc.) to the current axes in the current figure.

Slide 24

Slide 24 text

Matplotlib is organized in a hierarchy. At the top of the hierarchy is the matplotlib "state-machine environment" which is provided by the matplotlib.pyplot module. At this level, simple functions are used to add plot elements (lines, images, text, etc.) to the current axes in the current figure. The next level down in the hierarchy is the first level of the object-oriented interface. At this level, the user uses pyplot to create figures, and axes objects which are then used for most plotting actions.

Slide 25

Slide 25 text

Matplotlib is organized in a hierarchy. At the top of the hierarchy is the matplotlib "state-machine environment" which is provided by the matplotlib.pyplot module. At this level, simple functions are used to add plot elements (lines, images, text, etc.) to the current axes in the current figure. The next level down in the hierarchy is the first level of the object-oriented interface. At this level, the user uses pyplot to create figures, and axes objects which are then used for most plotting actions. At the lowest level matplotlib manages a variety of graphics primitives and engines to render and display figures. ⫶

Slide 26

Slide 26 text

MATLAB-style Interface Object-Oriented Interface

Slide 27

Slide 27 text

MATLAB-style Interface Object-Oriented Interface plt.plot(x, y) plt.xlim(-1, 1) plt.title(“My Plot”) ...

Slide 28

Slide 28 text

MATLAB-style Interface Object-Oriented Interface plt.plot(x, y) plt.xlim(-1, 1) plt.title(“My Plot”) ... fig = plt.figure() ax = fig.add_axes([0.1,0.1,0.8,0.8]) ax.plot(x, y) ax.set(xlim=(-1, 1), title=”My Plot”) ...

Slide 29

Slide 29 text

Fast and Convenient Detailed and Powerful plt.plot(x, y) plt.xlim(-1, 1) plt.title(“My Plot”) ... fig = plt.figure() ax = fig.add_axes([0.1,0.1,0.8,0.8]) ax.plot(x, y) ax.set(xlim=(-1, 1), title=”My Plot”) ...

Slide 30

Slide 30 text

MATLAB-style Interface Object-Oriented Interface plt.gcf() or plt.gca()

Slide 31

Slide 31 text

Demo Time

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

No content