A preliminary version of this is committed on the branch and trunk. You can now do:
.. plot:: from matplotlib.pyplot import * plot([1,2,3]) One open API question is whether to implicitly "from matplotlib.pyplot import *" or "from matplotlib import pyplot as plt" or nothing. I generally don't like "import *" or implicit things, so I've decided to do none of the above. But I could see how it might be nice to reduce the verbosity of these little code examples to import something be default. Let me know if you feel strongly about changing it. It has also been moved to the installed source directory, so other projects no longer need to copy it. Just change the entry in the extensions list in the Sphinx conf.py from 'plot_directive' to 'matplotlib.sphinxext.plot_directive' and remove your local copy of the extension. Mike Michael Droettboom wrote: > Has anyone else had a chance to look at this? It seems fairly > straightforward and I may have a go at this this morning if no one else > has already. > > Mike > > Fernando Perez wrote: > >> Howdy, >> >> recently, Matthew Brett pointed out that reST supports a mode that's >> very handy for writing tutorial-like documents that contain code >> blocks including their output, and they can even be run as tests. >> Here's a simple example with its corresponding source: >> >> http://neuroimaging.scipy.org/site/doc/manual/html/users/analysis_pipeline.html >> http://neuroimaging.scipy.org/site/doc/manual/html/_sources/users/analysis_pipeline.txt >> >> and they can even use the MPL math support, as seen here: >> >> http://neuroimaging.scipy.org/site/doc/manual/html/users/glm_spec.html >> http://neuroimaging.scipy.org/site/doc/manual/html/_sources/users/glm_spec.txt >> >> But we were thinking it would be great to have also plot support for >> this, without being forced to use standalone scripts like in mpl's >> current form of the plot directive. I unfortunately have to go now >> and will be mostly offline for a week, but I just had a chat about >> this with John, so I want to leave some context in here in case this >> is of interest to you guys. If there's a discussion on the API, I'll >> do my best to keep up, but I'm also cc'ing the nipy list so those >> interested can pitch in (though we should keep the conversation to the >> MPL list, where the plot machinery is implemented). >> >> Cheers, >> >> f >> >> ------------------------------------------------------------------------------ >> Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) >> software. With Adobe AIR, Ajax developers can use existing skills and code to >> build responsive, highly engaging applications that combine the power of >> local >> resources and data with the reach of the web. Download the Adobe AIR SDK and >> Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com >> _______________________________________________ >> Matplotlib-devel mailing list >> Matplotlib-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel >> >> > > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel