Re: [matplotlib-devel] plot directive in reST tutorials

2009-02-17 Thread Michael Droettboom
That's a great suggestion. I'm not familiar at all with the doc test extension, so the plot directive doesn't do this. It gets a fresh namespace (though not a fresh interpreter) for each plot. To avoid complicating the merge further, I'd like to wait for Pauli Vertanen's merge of the new plot

Re: [matplotlib-devel] plot directive in reST tutorials

2009-02-16 Thread Matthew Brett
Hi guys, > You can now do: > > .. plot:: > > from matplotlib.pyplot import * > plot([1,2,3]) This is very nice - thank you for doing that. But, thinking about the online tutorials, you often want to do something as you can do with the sourcecode directive, as in: .. testcode:: impor

Re: [matplotlib-devel] plot directive in reST tutorials

2009-02-16 Thread Michael Droettboom
Sorry -- Ignore my last comment. I see the Scipy version already has the covered -- it's just in a different place. No problem. Cheers, Mike Michael Droettboom wrote: > Pauli Virtanen wrote: > >> Mon, 16 Feb 2009 13:26:40 -0500, Michael Droettboom wrote: >> [clip] >> >> >>> Anyway,

Re: [matplotlib-devel] plot directive in reST tutorials

2009-02-16 Thread Michael Droettboom
Pauli Virtanen wrote: > Mon, 16 Feb 2009 13:26:40 -0500, Michael Droettboom wrote: > [clip] > >> 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 rat

Re: [matplotlib-devel] plot directive in reST tutorials

2009-02-16 Thread Pauli Virtanen
Mon, 16 Feb 2009 13:26:40 -0500, Michael Droettboom wrote: [clip] > 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

Re: [matplotlib-devel] plot directive in reST tutorials

2009-02-16 Thread Gael Varoquaux
On Mon, Feb 16, 2009 at 01:26:40PM -0500, Michael Droettboom wrote: > > 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 mos

Re: [matplotlib-devel] plot directive in reST tutorials

2009-02-16 Thread Michael Droettboom
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 whet

Re: [matplotlib-devel] plot directive in reST tutorials

2009-02-16 Thread Pauli Virtanen
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.p

Re: [matplotlib-devel] plot directive in reST tutorials

2009-02-16 Thread Michael Droettboom
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 gener

Re: [matplotlib-devel] plot directive in reST tutorials

2009-02-16 Thread Michael Droettboom
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