Presentation is loading. Please wait.

Presentation is loading. Please wait.

Matplotlib: DANSE kickoff John D. Hunter, Ph.D.

Similar presentations


Presentation on theme: "Matplotlib: DANSE kickoff John D. Hunter, Ph.D."— Presentation transcript:

1 Matplotlib: DANSE kickoff John D. Hunter, Ph.D. http://matplotlib.sourceforge.net

2 Copy the great architectures E Tufte

3 # matplotlib 0.1 ~/python/matplot_gtk12> ls README matplotlib.py subplot_demo.py data simple_plot.py view_data.py matplot.py stock_demo.py vline_demo.py # matplotlib 0.84 80 python modules 21 files of extension code 110,000 lines of code 189 examples 2-5 active developers at any time; 25 contributors ~5000 downloads/month ~500 mailing list subscribers 18 backends

4 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]) Stateful Procedural Do-nothing

5 bar demo

6 stacked bar

7 pie demo

8 scatter demo

9 histogram demo

10 log demo

11 polar demo

12 layer image

13 subplot demo

14 axes demo

15 legend demo

16 text alignment

17 mathtext demo2

18

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

20 finance demo

21 EEG demo

22 VTK demo

23 Native mpl 3D examples/simple3d_oo.py

24 The 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')

25

26 backends

27 # choose numeric or numarray from the shell C:> python myscript.py --numarray # or in an rc file setting numerix : ‘numpy’ The numerix module

28 The GUI problem: the curse of python, part III GUI independent rendering GUI neutral event handling

29 font manager Cross platform font finding: win32, linux, OS X Configurable families: the font engine will pick the best font to match your requirements W3C compliant font.family : sans-serif font.style : normal font.variant : normal font.weight : medium font.stretch : normal font.size : medium font.serif : New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Bitstream Vera Serif, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif font.sans-serif : Lucida Grande, Verdana, Geneva, Lucida,

30 tex = r'$\cal{R}\prod_{i=\alpha_{i+1}}^\infty a_I … \rm{sin}(2 \pi f x_i)$' text(1, 1.6, tex, fontsize=30) mathtext demo

31 MATPLOTLIB CREDITS (in order of appearance…) Jeremy O'Donoghue wrote the wx backend Andrew Straw provided much of the log scaling architecture, the fill command, PIL support for imshow, and provided many examples Charles Twardy provided the impetus code for the legend class and has made countless bug reports and suggestions for improvement. Gary Ruben made many enhancements to errorbar to support x and y errorbar plots, and added a number of new marker types to plot. John Gill wrote the table class and examples David Moore wrote the paint backend Todd Miller contributed the TkAgg backend and the numerix module, which allows matplotlib to work with either numeric or numarray. He also ported image support to the postscript backend, with much pain and suffering. Paul Barrett overhauled font management to provide an improved, free-standing, platform independent font manager with a WC3 compliant font finder and cache mechanism and ported truetype and mathtext to PS Perry Greenfield overhauled and modernized the goals and priorities page, implemented an improved colormap framework, and has provided many suggestions and a lot of insight to the overall design and organization of matplotlib. Jared Wahlstrand wrote the SVG backend

32 MATPLOTLIB CREDITS (continued) Steve Chaplin is the GTK maintainer and wrote the Cairo and GTKCairo backends Jim Benson provided the patch to handle vertical mathttext Gregory Lielens provided the FltkAgg backend and several patches for the frontend, including contributions to toolbar2, and support for log ticking with alternate bases and major and minor log ticking Darren Dale did the work to do mathtext exponential labeling for log plots. Paul Mcguire provided the pyparsing module on which mathtext relies, and made a number of optimizations to the matplotlib mathtext grammar. Fernando Perez has provided numerous bug reports and patches for cleaning up backend imports and expanding pylab functionality, and provided matplotlib support in the pylab mode for ipython. He also provided the matshow command. Andrew Dalke of Dalke Scientific Software contributed the strftime formatting code to handle years earlier than 1900 Jochen Voss maintained the PS backend and has contributed several bugfixes. Nadia Dencheva of STScI provided the contouring and contour labeling code Baptiste Carvello provided the key ideas in a patch for proper shared axes support that underlies ganged plots and multiscale plots Sigve Tjoraand Ted Drain and colleagues at the JPL collaborated on the QtAgg backend Eric Firing added the contourf function and general contour refactoring


Download ppt "Matplotlib: DANSE kickoff John D. Hunter, Ph.D."

Similar presentations


Ads by Google