From: <jd...@us...> - 2008-09-13 14:28:15
|
Revision: 6089 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6089&view=rev Author: jdh2358 Date: 2008-09-13 14:28:09 +0000 (Sat, 13 Sep 2008) Log Message: ----------- replaced ipython run magic with code.InteractiveConsole.runsource Modified Paths: -------------- trunk/matplotlib/doc/sphinxext/plot_directive.py trunk/matplotlib/lib/matplotlib/text.py Modified: trunk/matplotlib/doc/sphinxext/plot_directive.py =================================================================== --- trunk/matplotlib/doc/sphinxext/plot_directive.py 2008-09-12 21:21:16 UTC (rev 6088) +++ trunk/matplotlib/doc/sphinxext/plot_directive.py 2008-09-13 14:28:09 UTC (rev 6089) @@ -13,7 +13,7 @@ source will be included inline, as well as a link to the source. """ -import sys, os, glob, shutil +import sys, os, glob, shutil, code from docutils.parsers.rst import directives try: @@ -26,11 +26,16 @@ import matplotlib -import IPython.Shell + matplotlib.use('Agg') import matplotlib.pyplot as plt -mplshell = IPython.Shell.MatplotlibShell('mpl') +#import IPython.Shell +#mplshell = IPython.Shell.MatplotlibShell('mpl') +console = code.InteractiveConsole() +def runfile(fname): + source = file(fname).read() + return console.runsource(source) options = {'alt': directives.unchanged, 'height': directives.length_or_unitless, @@ -58,7 +63,7 @@ def makefig(fullpath, outdir): """ - run a pyplot script and save the low and high res PNGs and a PDF in _static + run a pyplot script<t and save the low and high res PNGs and a PDF in _static """ fullpath = str(fullpath) # todo, why is unicode breaking this @@ -88,7 +93,8 @@ plt.close('all') # we need to clear between runs matplotlib.rcdefaults() - mplshell.magic_run(fullpath) + runfile(fullpath) + for format, dpi in formats: outname = os.path.join(outdir, '%s.%s' % (basename, format)) if os.path.exists(outname): continue Modified: trunk/matplotlib/lib/matplotlib/text.py =================================================================== --- trunk/matplotlib/lib/matplotlib/text.py 2008-09-12 21:21:16 UTC (rev 6088) +++ trunk/matplotlib/lib/matplotlib/text.py 2008-09-13 14:28:09 UTC (rev 6089) @@ -41,10 +41,11 @@ # these are not available for the object inspector until after the # class is build so we define an initial set here for the init # function and they will be overridden after object defn -artist.kwdocd['Text'] = """\ +artist.kwdocd['Text'] = """ ========================== ========================================================================= + Property Value + ========================== ========================================================================= alpha float - ========================== ========================================================================= animated [True | False] backgroundcolor any matplotlib color bbox rectangle prop dict plus key 'pad' which is a pad in points @@ -1003,7 +1004,7 @@ annotation to the point. Valid keys are ========= =========================================================== - Key Description + Key Description ========= =========================================================== width the width of the arrow in points frac the fraction of the arrow length occupied by the head @@ -1021,7 +1022,7 @@ coordinates of *xy* and *xytext*. ================= =================================================== - Property Description + Property Description ================= =================================================== 'figure points' points from the lower left corner of the figure 'figure pixels' pixels from the lower left corner of the figure This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |