@@ -299,7 +299,7 @@ The :mod:`matplotlib.nxutils` provides two high performance methods:
299299for a single point use :func: `~matplotlib.nxutils.pnpoly ` and for an
300300array of points use :func: `~matplotlib.nxutils.points_inside_poly `.
301301For a discussion of the implementation see `pnpoly
302- <http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html> `_.
302+ <http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html> `_.
303303
304304.. sourcecode :: ipython
305305
@@ -334,5 +334,140 @@ For a discussion of the implementation see `pnpoly
334334 Out[32]: array([False, False, False, False, False, False, False, True, False, True], dtype=bool)
335335
336336.. htmlonly ::
337-
337+
338338 For a complete example, see :ref: `event_handling-lasso_demo `.
339+
340+
341+ .. _how-to-submit-patch :
342+
343+ How do I submit a patch?
344+ ========================
345+
346+ First obtain a copy of matplotlib svn (see :ref: `install-svn `) and
347+ make your changes to the matplotlib source code or documentation and
348+ apply a `svn diff `. If it is feasible, do your diff from the top
349+ level directory, the one that contains :file: `setup.py `. Eg,::
350+
351+ > cd /path/to/matplotlib/source
352+ > svn diff > mypatch.diff
353+
354+ and then post your patch to the `matplotlib-devel
355+ <http://sourceforge.net/mail/?group_id=80706> `_ mailing list. If you
356+ do not get a response within 24 hours, post your patch to the
357+ sourceforge patch `tracker
358+ <http://sourceforge.net/tracker2/?atid=560722&group_id=80706&func=browse> `_,
359+ and follow up on the mailing list with a link to the sourceforge patch
360+ submissions. If you still do not hear anything within a week (this
361+ shouldn't happen!), send us a kind and gentle reminder on the mailing
362+ list.
363+
364+ If you have made lots of local changes and do not want to a diff
365+ against the entire tree, but rather against a single directory or
366+ file, that is fine, but we do prefer svn diffs against HEAD.
367+
368+ You should check out the guide to developing matplotlib to make sure
369+ your patch abides by our coding conventions
370+ :ref: `developers-guide-index `.
371+
372+
373+ .. _howto-click-maps :
374+
375+ Clickable images for HTML
376+ =========================
377+
378+ Andrew Dalke of `Dalke Scientific <http://www.dalkescientific.com >`_
379+ has written a nice `article
380+ <http://www.dalkescientific.com/writings/diary/archive/2005/04/24/interactive_html.html> `_
381+ on how to make html click maps with matplotlib agg PNGs. We would
382+ also like to add this functionality to SVG and add a SWF backend to
383+ support these kind of images. If you are interested in contributing
384+ to these efforts that would be great.
385+
386+ .. _howto-set-zorder :
387+
388+ How do I control the depth of plot elements?
389+ =============================================
390+
391+ Within an axes, the order that the various lines, markers, text,
392+ collections, etc appear is determined by the
393+ :meth: `matplotlib.artist.Artist.set_zorder ` property. The default
394+ order is patches, lines, text, with collections of lines and
395+ collections of patches appearing at the same level as regular lines
396+ and patches, respectively::
397+
398+ line, = ax.plot(x, y, zorder=10)
399+
400+
401+
402+ .. htmlonly ::
403+
404+ See :ref: `pylab_examples-zorder_demo ` for a complete example.
405+
406+ You can also use the Axes property
407+ :meth: `matplotlib.axes.Axes.set_axisbelow ` to control whether the grid
408+ lines are placed above or below your other plot elements.
409+
410+ .. _howto-axis-equal :
411+
412+ How to I make the aspect ratio for plots equal?
413+ ===============================================
414+
415+ The Axes property :meth: `matplotlib.axes.Axes.set_aspect ` controls the
416+ aspect ratio of the axes. You can set it to be 'auto', 'equal', or
417+ some ratio which controls the ratio::
418+
419+ ax = fig.add_subplot(111, aspect='equal')
420+
421+
422+
423+ .. htmlonly ::
424+
425+ See :ref: `pylab_examples-equal_aspect_ratio ` for a complete example.
426+
427+
428+ .. _howto-movie :
429+
430+ How do I make a movie?
431+ ======================
432+
433+
434+ If you want to take an animated plot and turn it into a movie, the
435+ best approach is to save a series of image files (eg PNG) and use an
436+ external tool to convert them to a movie. You can use ` mencoder
437+ <http://www.mplayerhq.hu/DOCS/HTML/en/mencoder.html> `_,
438+ which is part of the `mplayer <http://www.mplayerhq.hu >`_ suite
439+ for this::
440+
441+
442+ #fps (frames per second) controls the play speed
443+ mencoder 'mf://*.png' -mf type=png:fps=10 -ovc \\
444+ lavc -lavcopts vcodec=wmv2 -oac copy -o animation.avi
445+
446+ The swiss army knife of image tools, ImageMagick's `convert
447+ <http://www.imagemagick.org/script/convert.php> `_ works for this as
448+ well.<p>
449+
450+ Here is a simple example script that saves some PNGs, makes them into
451+ a movie, and then cleans up::
452+
453+ import os, sys
454+ import matplotlib.pyplot as plt
455+
456+ files = []
457+ fig = plt.figure(figsize=(5,5))
458+ ax = fig.add_subplot(111)
459+ for i in range(50): # 50 frames
460+ ax.cla()
461+ ax.imshow(rand(5,5), interpolation='nearest')
462+ fname = '_tmp%03d.png'%i
463+ print 'Saving frame', fname
464+ fig.savefig(fname)
465+ files.append(fname)
466+
467+ print 'Making movie animation.mpg - this make take a while'
468+ os.system("mencoder 'mf://_tmp*.png' -mf type=png:fps=10 \\
469+ -ovc lavc -lavcopts vcodec=wmv2 -oac copy -o animation.mpg")
470+
471+ .. htmlonly ::
472+
473+ See :ref: `animation-movie_demo ` for a complete example.
0 commit comments