Pauli Virtanen wrote: > Mon, 16 Feb 2009 10:30:47 -0500, Michael Droettboom wrote: > > >> 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. >> > > Scipy's plot directive has had this feature for some time: > > http://svn.scipy.org/svn/numpy/trunk/doc/sphinxext/plot_directive.py > > plus some extra features. I think it should contain all the features in > matplotlib's version; but OTOH, I haven't tried to build matplotlib docs > using it. > I think we really should merge it back *now*! > (Re: Gael's thread; sorry, I've been lazy pushing the changes back...) > We've clearly all been bad about forking this stuff all over the place. I was completely unaware it was being used for Scipy. It's unfortunate the suggestion to install this stuff as part of matplotlib wasn't made earlier.
Anyway, the current version in matplotlib handles files in a way that behaves well with Sphinx (which I see is a TODO list item in the numpy version). It also uses the Sphinx extension API rather than the old and brittle way of defining directives etc. So those things will need to be merged with the other changes made on the Numpy side. > The "official" version of the plot directive should IMO end up either > in Sphinx or matplotlib repository. It's probably OK to require matplotlib > SVN version to build Scipy docs for a while... > I think it makes the most sense for this to be part of matplotlib, since it fundamentally requires matplotlib -- that prevents Sphinx from growing a matplotlib dependency. Mike -- 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