From: <ds...@us...> - 2008-06-13 12:11:34
|
Revision: 5500 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5500&view=rev Author: dsdale Date: 2008-06-13 05:11:33 -0700 (Fri, 13 Jun 2008) Log Message: ----------- added api file for matplotlib configuration Modified Paths: -------------- trunk/matplotlib/doc/users/customizing.rst Added Paths: ----------- trunk/matplotlib/doc/api/matplotlib_configuration_api.rst Added: trunk/matplotlib/doc/api/matplotlib_configuration_api.rst =================================================================== --- trunk/matplotlib/doc/api/matplotlib_configuration_api.rst (rev 0) +++ trunk/matplotlib/doc/api/matplotlib_configuration_api.rst 2008-06-13 12:11:33 UTC (rev 5500) @@ -0,0 +1,24 @@ +************************ +matplotlib configuration +************************ + + +:mod:`matplotlib` +================= + +.. autofunction:: matplotlib.get_backend +.. autofunction:: matplotlib.get_configdir +.. autofunction:: matplotlib.interactive +.. autofunction:: matplotlib.rc +.. autofunction:: matplotlib.rcdefaults +.. autoclass:: matplotlib.RcParams +.. autofunction:: matplotlib.use +.. autoclass:: matplotlib.Verbose + + +:mod:`matplotlib.rcsetup` +============================= + +.. automodule:: matplotlib.rcsetup + :members: + :undoc-members: \ No newline at end of file Modified: trunk/matplotlib/doc/users/customizing.rst =================================================================== --- trunk/matplotlib/doc/users/customizing.rst 2008-06-12 22:06:09 UTC (rev 5499) +++ trunk/matplotlib/doc/users/customizing.rst 2008-06-13 12:11:33 UTC (rev 5500) @@ -20,13 +20,12 @@ specific customizations that you do not want to apply elsewhere. 2. :file:`.matplotlib/matplotlibrc`, for the user's default customizations. See :ref:`locating-matplotlib-config-dir`. -3. :file:`{INSTALL}/matplotlib/mpl-data/matplotlibrc`, where - :file:`{INSTALL}` is something like - :file:`/usr/lib/python2.5/site-packages` on Linux, and maybe - :file:`C:\\Python25\\Lib\\site-packages` on Windows. Every time you - install matplotlib, this file will be overwritten, so if you want - your customizations to be saved, please move this file to you - :file:`.matplotlib` directory. +3. :file:`{INSTALL}/matplotlib/mpl-data/matplotlibrc`, where :file:`{INSTALL}` + is something like :file:`/usr/lib/python2.5/site-packages` on Linux, and + maybe :file:`C:\\Python25\\Lib\\site-packages` on Windows. Every time you + install matplotlib, this file will be overwritten, so if you want your + customizations to be saved, please move this file to you :file:`.matplotlib` + directory. See below for a sample :ref:`matplotlibrc file<matplotlibrc-sample>`. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2008-06-13 14:10:28
|
Revision: 5503 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5503&view=rev Author: mdboom Date: 2008-06-13 07:10:02 -0700 (Fri, 13 Jun 2008) Log Message: ----------- Add plot directive to include inline plots and their source. Modified Paths: -------------- trunk/matplotlib/doc/conf.py trunk/matplotlib/doc/make.py trunk/matplotlib/doc/users/annotations.rst trunk/matplotlib/doc/users/artists.rst trunk/matplotlib/doc/users/figures/make.py trunk/matplotlib/doc/users/mathtext.rst trunk/matplotlib/doc/users/pyplot_tutorial.rst trunk/matplotlib/doc/users/text_intro.rst trunk/matplotlib/doc/users/text_props.rst Added Paths: ----------- trunk/matplotlib/doc/sphinxext/only_directives.py trunk/matplotlib/doc/sphinxext/plot_directive.py Modified: trunk/matplotlib/doc/conf.py =================================================================== --- trunk/matplotlib/doc/conf.py 2008-06-13 12:46:20 UTC (rev 5502) +++ trunk/matplotlib/doc/conf.py 2008-06-13 14:10:02 UTC (rev 5503) @@ -27,7 +27,8 @@ # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['mathpng', 'math_symbol_table', 'sphinx.ext.autodoc'] +extensions = ['mathpng', 'math_symbol_table', 'sphinx.ext.autodoc', + 'only_directives', 'plot_directive'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] Modified: trunk/matplotlib/doc/make.py =================================================================== --- trunk/matplotlib/doc/make.py 2008-06-13 12:46:20 UTC (rev 5502) +++ trunk/matplotlib/doc/make.py 2008-06-13 14:10:02 UTC (rev 5503) @@ -24,24 +24,32 @@ def html(): check_build() figs() - os.system('sphinx-build -b html -d build/doctrees . build/html') + if os.system('sphinx-build -b html -d build/doctrees . build/html'): + raise SystemExit("Building HTML failed.") + figures_dest_path = 'build/html/users/figures' + if os.path.exists(figures_dest_path): + shutil.rmtree(figures_dest_path) + shutil.copytree('users/figures', figures_dest_path) + def latex(): check_build() figs() if sys.platform != 'win32': # LaTeX format. - os.system('sphinx-build -b latex -d build/doctrees . build/latex') + if os.system('sphinx-build -b latex -d build/doctrees . build/latex'): + raise SystemExit("Building LaTeX failed.") # Produce pdf. os.chdir('build/latex') # Copying the makefile produced by sphinx... - os.system('pdflatex Matplotlib.tex') - os.system('pdflatex Matplotlib.tex') - os.system('makeindex -s python.ist Matplotlib.idx') - os.system('makeindex -s python.ist modMatplotlib.idx') - os.system('pdflatex Matplotlib.tex') + if (os.system('pdflatex Matplotlib.tex') or + os.system('pdflatex Matplotlib.tex') or + os.system('makeindex -s python.ist Matplotlib.idx') or + os.system('makeindex -s python.ist modMatplotlib.idx') or + os.system('pdflatex Matplotlib.tex')): + raise SystemExit("Rendering LaTeX failed.") os.chdir('../..') else: Added: trunk/matplotlib/doc/sphinxext/only_directives.py =================================================================== --- trunk/matplotlib/doc/sphinxext/only_directives.py (rev 0) +++ trunk/matplotlib/doc/sphinxext/only_directives.py 2008-06-13 14:10:02 UTC (rev 5503) @@ -0,0 +1,87 @@ +# +# A pair of directives for inserting content that will only appear in +# either html or latex. +# + +from docutils.nodes import Body, Element +from docutils.writers.html4css1 import HTMLTranslator +from sphinx.latexwriter import LaTeXTranslator +from docutils.parsers.rst import directives + +class html_only(Body, Element): + pass + +class latex_only(Body, Element): + pass + +def run(content, node_class, state, content_offset): + text = '\n'.join(content) + node = node_class(text) + state.nested_parse(content, content_offset, node) + return [node] + +try: + from docutils.parsers.rst import Directive +except ImportError: + from docutils.parsers.rst.directives import _directives + + def html_only_directive(name, arguments, options, content, lineno, + content_offset, block_text, state, state_machine): + return run(content, html_only, state, content_offset) + + def latex_only_directive(name, arguments, options, content, lineno, + content_offset, block_text, state, state_machine): + return run(content, latex_only, state, content_offset) + + for func in (html_only_directive, latex_only_directive): + func.content = 1 + func.options = {} + func.arguments = None + + _directives['htmlonly'] = html_only_directive + _directives['latexonly'] = latex_only_directive +else: + class OnlyDirective(Directive): + has_content = True + required_arguments = 0 + optional_arguments = 0 + final_argument_whitespace = True + option_spec = {} + + def run(self): + self.assert_has_content() + return run(self.content, self.node_class, + self.state, self.content_offset) + + class HtmlOnlyDirective(OnlyDirective): + node_class = html_only + + class LatexOnlyDirective(OnlyDirective): + node_class = latex_only + + directives.register_directive('htmlonly', HtmlOnlyDirective) + directives.register_directive('latexonly', LatexOnlyDirective) + +def setup(app): + app.add_node(html_only) + app.add_node(latex_only) + + # Add visit/depart methods to HTML-Translator: + def visit_perform(self, node): + pass + def depart_perform(self, node): + pass + def visit_ignore(self, node): + node.children = [] + def depart_ignore(self, node): + node.children = [] + + HTMLTranslator.visit_html_only = visit_perform + HTMLTranslator.depart_html_only = depart_perform + HTMLTranslator.visit_latex_only = visit_ignore + HTMLTranslator.depart_latex_only = depart_ignore + + LaTeXTranslator.visit_html_only = visit_ignore + LaTeXTranslator.depart_html_only = depart_ignore + LaTeXTranslator.visit_latex_only = visit_perform + LaTeXTranslator.depart_latex_only = depart_perform Added: trunk/matplotlib/doc/sphinxext/plot_directive.py =================================================================== --- trunk/matplotlib/doc/sphinxext/plot_directive.py (rev 0) +++ trunk/matplotlib/doc/sphinxext/plot_directive.py 2008-06-13 14:10:02 UTC (rev 5503) @@ -0,0 +1,85 @@ +"""A special directive for including a matplotlib plot. + +Given a path to a .py file, it includes the source code inline, then: + +- On HTML, will include a .png with a link to a high-res .png. + Underneath that, a [source] link will go to a plain text .py of + the source. + +- On LaTeX, will include a .pdf +""" + +from docutils.parsers.rst import directives + +try: + # docutils 0.4 + from docutils.parsers.rst.directives.images import align +except ImportError: + # docutils 0.5 + from docutils.parsers.rst.directives.images import Image + align = Image.align + +options = {'alt': directives.unchanged, + 'height': directives.length_or_unitless, + 'width': directives.length_or_percentage_or_unitless, + 'scale': directives.nonnegative_int, + 'align': align, + 'class': directives.class_option} + +template = """ +.. literalinclude:: %(reference)s.py + +.. htmlonly:: + + .. image:: %(reference)s.png + :target: %(reference)s.hires.png +%(options)s + + `[source] <%(reference)s.py>`_ + +.. latexonly:: + .. image:: %(reference)s.pdf +%(options)s + +""" + +def run(arguments, options, state_machine, lineno): + reference = directives.uri(arguments[0]) + if reference.endswith('.py'): + reference = reference[:-3] + options = [' :%s: %s' % (key, val) for key, val in + options.items()] + options = "\n".join(options) + lines = template % locals() + lines = lines.split('\n') + + state_machine.insert_input( + lines, state_machine.input_lines.source(0)) + return [] + +try: + from docutils.parsers.rst import Directive +except ImportError: + from docutils.parsers.rst.directives import _directives + + def plot_directive(name, arguments, options, content, lineno, + content_offset, block_text, state, state_machine): + return run(arguments, options, state_machine, lineno) + plot_directive.__doc__ = __doc__ + plot_directive.arguments = (1, 0, 1) + plot_directive.options = options + + _directives['plot'] = plot_directive +else: + class plot_directive(Directive): + required_arguments = 1 + optional_arguments = 0 + final_argument_whitespace = True + option_spec = options + def run(self): + return run(self.arguments, self.options, + self.state_machine, self.lineno) + plot_directive.__doc__ = __doc__ + + directives.register_directive('plot', plot_directive) + Modified: trunk/matplotlib/doc/users/annotations.rst =================================================================== --- trunk/matplotlib/doc/users/annotations.rst 2008-06-13 12:46:20 UTC (rev 5502) +++ trunk/matplotlib/doc/users/annotations.rst 2008-06-13 14:10:02 UTC (rev 5503) @@ -12,9 +12,7 @@ ``xy`` and the location of the text ``xytext``. Both of these arguments are ``(x,y)`` tuples. -.. literalinclude:: figures/annotation_basic.py - -.. image:: figures/annotation_basic.png +.. plot:: figures/annotation_basic.py :scale: 75 In this example, both the ``xy`` (arrow tip) and ``xytext`` locations @@ -73,9 +71,7 @@ ``fontsize are passed from the `~matplotlib.Axes.annotate` to the ``Text`` instance -.. literalinclude:: figures/annotation_polar.py - -.. image:: figures/annotation_polar.png +.. plot:: figures/annotation_polar.py :scale: 75 See the `annotations demo Modified: trunk/matplotlib/doc/users/artists.rst =================================================================== --- trunk/matplotlib/doc/users/artists.rst 2008-06-13 12:46:20 UTC (rev 5502) +++ trunk/matplotlib/doc/users/artists.rst 2008-06-13 14:10:02 UTC (rev 5503) @@ -604,9 +604,7 @@ Here is an example, not recommended for its beauty, which customizes the axes and tick properties -.. literalinclude:: figures/fig_axes_customize_simple.py - -.. image:: figures/fig_axes_customize_simple.png +.. plot:: figures/fig_axes_customize_simple.py :scale: 75 @@ -643,7 +641,5 @@ Here is an example which sets the formatter for the upper ticks with dollar signs and colors them green on the right side of the yaxis -.. literalinclude:: figures/dollar_ticks.py - -.. image:: figures/dollar_ticks.png +.. plot:: figures/dollar_ticks.py :scale: 75 Modified: trunk/matplotlib/doc/users/figures/make.py =================================================================== --- trunk/matplotlib/doc/users/figures/make.py 2008-06-13 12:46:20 UTC (rev 5502) +++ trunk/matplotlib/doc/users/figures/make.py 2008-06-13 14:10:02 UTC (rev 5503) @@ -7,27 +7,37 @@ mplshell = IPython.Shell.MatplotlibShell('mpl') +formats = [('png', 100), + ('hires.png', 200), + ('pdf', 72)] + def figs(): print 'making figs' import matplotlib.pyplot as plt for fname in glob.glob('*.py'): if fname==__file__: continue basename, ext = os.path.splitext(fname) - outfile = '%s.png'%basename + outfiles = ['%s.%s' % (basename, format) for format, dpi in formats] + all_exists = True + for format, dpi in formats: + if not os.path.exists('%s.%s' % (basename, format)): + all_exists = False + break - if os.path.exists(outfile): - print ' already have %s'%outfile - continue + if all_exists: + print ' already have %s'%fname else: print ' building %s'%fname - plt.close('all') # we need to clear between runs - mplshell.magic_run(basename) - plt.savefig(outfile) + plt.close('all') # we need to clear between runs + mplshell.magic_run(basename) + for format, dpi in formats: + plt.savefig('%s.%s' % (basename, format), dpi=dpi) print 'all figures made' def clean(): - patterns = ['#*', '*~', '*.png', '*pyc'] + patterns = (['#*', '*~', '*pyc'] + + ['*.%s' % format for format, dpi in formats]) for pattern in patterns: for fname in glob.glob(pattern): os.remove(fname) Modified: trunk/matplotlib/doc/users/mathtext.rst =================================================================== --- trunk/matplotlib/doc/users/mathtext.rst 2008-06-13 12:46:20 UTC (rev 5502) +++ trunk/matplotlib/doc/users/mathtext.rst 2008-06-13 14:10:02 UTC (rev 5503) @@ -271,9 +271,7 @@ Here is an example illustrating many of these features in context. -.. literalinclude:: figures/pyplot_mathtext.py - -.. image:: figures/pyplot_mathtext.png +.. plot:: figures/pyplot_mathtext.py :scale: 75 Modified: trunk/matplotlib/doc/users/pyplot_tutorial.rst =================================================================== --- trunk/matplotlib/doc/users/pyplot_tutorial.rst 2008-06-13 12:46:20 UTC (rev 5502) +++ trunk/matplotlib/doc/users/pyplot_tutorial.rst 2008-06-13 14:10:02 UTC (rev 5503) @@ -12,12 +12,9 @@ keeps track of the current figure and plotting area, and the plotting functions are directed to the current axes -.. literalinclude:: figures/pyplot_simple.py - -.. image:: figures/pyplot_simple.png +.. plot:: figures/pyplot_simple :scale: 75 - You may be wondering why the x-axis ranges from 0-3 and the y-axis from 1-4. If you provide a single list or array to the :func:`~matplotlib.pyplot.plot` command, matplotlib assumes it a @@ -39,9 +36,7 @@ The default format string is 'b-', which is a solid blue line. For example, to plot the above with red circles, you would issue -.. literalinclude:: figures/pyplot_formatstr.py - -.. image:: figures/pyplot_formatstr.png +.. plot:: figures/pyplot_formatstr.py :scale: 75 See the :func:`~matplotlib.pyplot.plot` documentation for a complete @@ -57,9 +52,7 @@ plotting several lines with different format styles in one command using arrays. -.. literalinclude:: figures/pyplot_three.py - -.. image:: figures/pyplot_three.png +.. plot:: figures/pyplot_three.py :scale: 75 .. _controlling-line-properties: @@ -164,9 +157,7 @@ to worry about this, because it is all taken care of behind the scenes. Below is an script to create two subplots. -.. literalinclude:: figures/pyplot_two_subplots.py - -.. image:: figures/pyplot_two_subplots.png +.. plot:: figures/pyplot_two_subplots.py :scale: 75 The :func:`~matplotlib.pyplot.figure` command here is optional because @@ -225,9 +216,7 @@ are used tox add text in the indicated locations (see :ref:`text-intro` for a more detailed example) -.. literalinclude:: figures/pyplot_text.py - -.. image:: figures/pyplot_text.png +.. plot:: figures/pyplot_text.py :scale: 75 @@ -273,9 +262,7 @@ the argument ``xy`` and the location of the text ``xytext``. Both of these arguments are ``(x,y)`` tuples. -.. literalinclude:: figures/pyplot_annotate.py - -.. image:: figures/pyplot_annotate.png +.. plot:: figures/pyplot_annotate.py :scale: 75 In this basic example, both the ``xy`` (arrow tip) and ``xytext`` Modified: trunk/matplotlib/doc/users/text_intro.rst =================================================================== --- trunk/matplotlib/doc/users/text_intro.rst 2008-06-13 12:46:20 UTC (rev 5502) +++ trunk/matplotlib/doc/users/text_intro.rst 2008-06-13 14:10:02 UTC (rev 5503) @@ -55,8 +55,6 @@ variety of font and other properties. The example below shows all of these commands in action. -.. literalinclude:: figures/text_commands.py - -.. image:: figures/text_commands.png +.. plot:: figures/text_commands.py :scale: 75 Modified: trunk/matplotlib/doc/users/text_props.rst =================================================================== --- trunk/matplotlib/doc/users/text_props.rst 2008-06-13 12:46:20 UTC (rev 5502) +++ trunk/matplotlib/doc/users/text_props.rst 2008-06-13 14:10:02 UTC (rev 5503) @@ -57,7 +57,5 @@ bounding box, with 0,0 being the lower left of the axes and 1,1 the upper right. -.. literalinclude:: figures/text_layout.py - -.. image:: figures/text_layout.png +.. plot:: figures/text_layout.py :scale: 75 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2008-06-13 14:40:46
|
Revision: 5505 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5505&view=rev Author: mdboom Date: 2008-06-13 07:40:39 -0700 (Fri, 13 Jun 2008) Log Message: ----------- Add "include-source" option. Modified Paths: -------------- trunk/matplotlib/doc/sphinxext/plot_directive.py trunk/matplotlib/doc/users/annotations.rst trunk/matplotlib/doc/users/artists.rst trunk/matplotlib/doc/users/mathtext.rst trunk/matplotlib/doc/users/pyplot_tutorial.rst trunk/matplotlib/doc/users/text_intro.rst trunk/matplotlib/doc/users/text_props.rst Modified: trunk/matplotlib/doc/sphinxext/plot_directive.py =================================================================== --- trunk/matplotlib/doc/sphinxext/plot_directive.py 2008-06-13 14:24:40 UTC (rev 5504) +++ trunk/matplotlib/doc/sphinxext/plot_directive.py 2008-06-13 14:40:39 UTC (rev 5505) @@ -3,10 +3,14 @@ Given a path to a .py file, it includes the source code inline, then: - On HTML, will include a .png with a link to a high-res .png. - Underneath that, a [source] link will go to a plain text .py of - the source. - On LaTeX, will include a .pdf + +This directive supports all of the options of the `image` directive, +except for `target` (since plot will add its own target). + +Additionally, if the :include-source: option is provided, the literal +source will be included inline, as well as a link to the source. """ from docutils.parsers.rst import directives @@ -25,9 +29,23 @@ 'width': directives.length_or_percentage_or_unitless, 'scale': directives.nonnegative_int, 'align': align, - 'class': directives.class_option} + 'class': directives.class_option, + 'include-source': directives.flag } -template = """ +template_no_source = """ +.. htmlonly:: + + .. image:: %(reference)s.png + :target: %(reference)s.hires.png +%(options)s + +.. latexonly:: + .. image:: %(reference)s.pdf +%(options)s + +""" + +template_source = """ .. literalinclude:: %(reference)s.py .. htmlonly:: @@ -36,7 +54,7 @@ :target: %(reference)s.hires.png %(options)s - `[original %(basename)s.py] <%(reference)s.py>`_ + `[%(basename)s.py] <%(reference)s.py>`_ .. latexonly:: .. image:: %(reference)s.pdf @@ -46,8 +64,16 @@ def run(arguments, options, state_machine, lineno): reference = directives.uri(arguments[0]) - if reference.endswith('.py'): - reference = reference[:-3] + print reference + for ext in ('.py', '.png', '.pdf'): + if reference.endswith(ext): + reference = reference[:-len(ext)] + break + if options.has_key('include-source'): + template = template_source + del options['include-source'] + else: + template = template_no_source options = [' :%s: %s' % (key, val) for key, val in options.items()] options = "\n".join(options) Modified: trunk/matplotlib/doc/users/annotations.rst =================================================================== --- trunk/matplotlib/doc/users/annotations.rst 2008-06-13 14:24:40 UTC (rev 5504) +++ trunk/matplotlib/doc/users/annotations.rst 2008-06-13 14:40:39 UTC (rev 5505) @@ -13,6 +13,7 @@ arguments are ``(x,y)`` tuples. .. plot:: figures/annotation_basic.py + :include-source: :scale: 75 In this example, both the ``xy`` (arrow tip) and ``xytext`` locations @@ -73,6 +74,7 @@ .. plot:: figures/annotation_polar.py :scale: 75 + :include-source: See the `annotations demo <http://matplotlib.sf.net/examples/pylab_examples/annotation_demo.py>`_ for more Modified: trunk/matplotlib/doc/users/artists.rst =================================================================== --- trunk/matplotlib/doc/users/artists.rst 2008-06-13 14:24:40 UTC (rev 5504) +++ trunk/matplotlib/doc/users/artists.rst 2008-06-13 14:40:39 UTC (rev 5505) @@ -135,7 +135,7 @@ Try creating the figure below. -.. image:: figures/fig_axes_labels_simple.png +.. plot:: figures/fig_axes_labels_simple :scale: 75 .. _customizing-artists: @@ -326,7 +326,7 @@ In [195]: fig.canvas.draw() -.. image:: figures/fig_x.png +.. plot:: figures/fig_x :scale: 75 @@ -606,6 +606,7 @@ .. plot:: figures/fig_axes_customize_simple.py :scale: 75 + :include-source: .. _tick-container: @@ -643,3 +644,4 @@ .. plot:: figures/dollar_ticks.py :scale: 75 + :include-source: Modified: trunk/matplotlib/doc/users/mathtext.rst =================================================================== --- trunk/matplotlib/doc/users/mathtext.rst 2008-06-13 14:24:40 UTC (rev 5504) +++ trunk/matplotlib/doc/users/mathtext.rst 2008-06-13 14:40:39 UTC (rev 5505) @@ -273,6 +273,7 @@ .. plot:: figures/pyplot_mathtext.py :scale: 75 + :include-source: Modified: trunk/matplotlib/doc/users/pyplot_tutorial.rst =================================================================== --- trunk/matplotlib/doc/users/pyplot_tutorial.rst 2008-06-13 14:24:40 UTC (rev 5504) +++ trunk/matplotlib/doc/users/pyplot_tutorial.rst 2008-06-13 14:40:39 UTC (rev 5505) @@ -14,6 +14,7 @@ .. plot:: figures/pyplot_simple :scale: 75 + :include-source: You may be wondering why the x-axis ranges from 0-3 and the y-axis from 1-4. If you provide a single list or array to the @@ -38,6 +39,7 @@ .. plot:: figures/pyplot_formatstr.py :scale: 75 + :include-source: See the :func:`~matplotlib.pyplot.plot` documentation for a complete list of line styles and format strings. The @@ -54,6 +56,7 @@ .. plot:: figures/pyplot_three.py :scale: 75 + :include-source: .. _controlling-line-properties: @@ -159,6 +162,7 @@ .. plot:: figures/pyplot_two_subplots.py :scale: 75 + :include-source: The :func:`~matplotlib.pyplot.figure` command here is optional because ``figure(1)`` will be created by default, just as a ``subplot(111)`` @@ -218,8 +222,8 @@ .. plot:: figures/pyplot_text.py :scale: 75 + :include-source: - All of the :func:`~matplotlib.pyplot.text` commands return an :class:`matplotlib.text.Text` instance. Just as with with lines above, you can customize the properties by passing keyword arguments @@ -264,6 +268,7 @@ .. plot:: figures/pyplot_annotate.py :scale: 75 + :include-source: In this basic example, both the ``xy`` (arrow tip) and ``xytext`` locations (text location) are in data coordinates. There are a Modified: trunk/matplotlib/doc/users/text_intro.rst =================================================================== --- trunk/matplotlib/doc/users/text_intro.rst 2008-06-13 14:24:40 UTC (rev 5504) +++ trunk/matplotlib/doc/users/text_intro.rst 2008-06-13 14:40:39 UTC (rev 5505) @@ -57,4 +57,4 @@ .. plot:: figures/text_commands.py :scale: 75 - + :include-source: Modified: trunk/matplotlib/doc/users/text_props.rst =================================================================== --- trunk/matplotlib/doc/users/text_props.rst 2008-06-13 14:24:40 UTC (rev 5504) +++ trunk/matplotlib/doc/users/text_props.rst 2008-06-13 14:40:39 UTC (rev 5505) @@ -59,3 +59,4 @@ .. plot:: figures/text_layout.py :scale: 75 + :include-source: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2008-06-13 17:19:03
|
Revision: 5513 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5513&view=rev Author: jdh2358 Date: 2008-06-13 10:18:41 -0700 (Fri, 13 Jun 2008) Log Message: ----------- moved figure autogen into plot directive Modified Paths: -------------- trunk/matplotlib/doc/devel/documenting_mpl.rst trunk/matplotlib/doc/make.py trunk/matplotlib/doc/sphinxext/plot_directive.py trunk/matplotlib/doc/users/annotations.rst trunk/matplotlib/doc/users/artists.rst trunk/matplotlib/doc/users/mathtext.rst trunk/matplotlib/doc/users/pyplot_tutorial.rst trunk/matplotlib/doc/users/text_intro.rst trunk/matplotlib/doc/users/text_props.rst Added Paths: ----------- trunk/matplotlib/doc/matplotlibrc trunk/matplotlib/doc/pyplots/ trunk/matplotlib/doc/pyplots/annotation_basic.py trunk/matplotlib/doc/pyplots/annotation_polar.py trunk/matplotlib/doc/pyplots/dollar_ticks.py trunk/matplotlib/doc/pyplots/fig_axes_customize_simple.py trunk/matplotlib/doc/pyplots/fig_axes_labels_simple.py trunk/matplotlib/doc/pyplots/fig_x.py trunk/matplotlib/doc/pyplots/make.py trunk/matplotlib/doc/pyplots/matplotlibrc trunk/matplotlib/doc/pyplots/pyplot_annotate.py trunk/matplotlib/doc/pyplots/pyplot_formatstr.py trunk/matplotlib/doc/pyplots/pyplot_mathtext.py trunk/matplotlib/doc/pyplots/pyplot_simple.py trunk/matplotlib/doc/pyplots/pyplot_text.py trunk/matplotlib/doc/pyplots/pyplot_three.py trunk/matplotlib/doc/pyplots/pyplot_two_subplots.py trunk/matplotlib/doc/pyplots/text_commands.py trunk/matplotlib/doc/pyplots/text_layout.py Removed Paths: ------------- trunk/matplotlib/doc/pyplots/annotation_basic.py trunk/matplotlib/doc/pyplots/annotation_polar.py trunk/matplotlib/doc/pyplots/dollar_ticks.py trunk/matplotlib/doc/pyplots/fig_axes_customize_simple.py trunk/matplotlib/doc/pyplots/fig_axes_labels_simple.py trunk/matplotlib/doc/pyplots/fig_x.py trunk/matplotlib/doc/pyplots/make.py trunk/matplotlib/doc/pyplots/matplotlibrc trunk/matplotlib/doc/pyplots/pyplot_annotate.py trunk/matplotlib/doc/pyplots/pyplot_formatstr.py trunk/matplotlib/doc/pyplots/pyplot_mathtext.py trunk/matplotlib/doc/pyplots/pyplot_simple.py trunk/matplotlib/doc/pyplots/pyplot_text.py trunk/matplotlib/doc/pyplots/pyplot_three.py trunk/matplotlib/doc/pyplots/pyplot_two_subplots.py trunk/matplotlib/doc/pyplots/text_commands.py trunk/matplotlib/doc/pyplots/text_layout.py trunk/matplotlib/doc/users/figures/ Modified: trunk/matplotlib/doc/devel/documenting_mpl.rst =================================================================== --- trunk/matplotlib/doc/devel/documenting_mpl.rst 2008-06-13 15:54:21 UTC (rev 5512) +++ trunk/matplotlib/doc/devel/documenting_mpl.rst 2008-06-13 17:18:41 UTC (rev 5513) @@ -102,14 +102,19 @@ Dynamically generated figures ----------------------------- -Each guide will have its own `figures/` directory for scripts to generate images -to be included in the documentation. It is not necessary to explicitly save -the figure in the script, a figure will be saved with the same name as the -filename when the documentation is generated. Matplotlib includes a Sphinx -extension for generating the images from the python script and including either -a png copy for html or a pdf for latex:: +The top level :file:`doc` dir has a folder called :file:`pyplots` in +which you should include any pyplot plotting scripts that you want to +generate figures for the documentation. It is not necessary to +explicitly save the figure in the script, this will be done +automatically at build time to insure that the code that is included +runs and produces the advertised figure. Several figures will be +saved with the same basnename as the filename when the documentation +is generated (low and high res PNGs, a PDF). Matplotlib includes a +Sphinx extension (file:`sphinxext/plot_directive.py`) for generating +the images from the python script and including either a png copy for +html or a pdf for latex:: - .. plot:: figures/pyplot_simple + .. plot:: pyplot_simple.py :scale: 75 :include-source: Modified: trunk/matplotlib/doc/make.py =================================================================== --- trunk/matplotlib/doc/make.py 2008-06-13 15:54:21 UTC (rev 5512) +++ trunk/matplotlib/doc/make.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -23,18 +23,18 @@ def html(): check_build() - figs() + #figs() if os.system('sphinx-build -b html -d build/doctrees . build/html'): raise SystemExit("Building HTML failed.") - figures_dest_path = 'build/html/users/figures' + figures_dest_path = 'build/html/pyplots' if os.path.exists(figures_dest_path): shutil.rmtree(figures_dest_path) - shutil.copytree('users/figures', figures_dest_path) + shutil.copytree('pyplots', figures_dest_path) def latex(): check_build() - figs() + #figs() if sys.platform != 'win32': # LaTeX format. if os.system('sphinx-build -b latex -d build/doctrees . build/latex'): @@ -57,9 +57,11 @@ def clean(): shutil.rmtree('build') + for fname in glob.glob('pyplots/*.png') + glob.glob('pyplots/*.pdf'): + os.remove(fname) def all(): - figs() + #figs() html() latex() Added: trunk/matplotlib/doc/matplotlibrc =================================================================== --- trunk/matplotlib/doc/matplotlibrc (rev 0) +++ trunk/matplotlib/doc/matplotlibrc 2008-06-13 17:18:41 UTC (rev 5513) @@ -0,0 +1,315 @@ +### MATPLOTLIBRC FORMAT + +# This is a sample matplotlib configuration file. It should be placed +# in HOME/.matplotlib/matplotlibrc (unix/linux like systems) and +# C:\Documents and Settings\yourname\.matplotlib (win32 systems) +# +# By default, the installer will overwrite the existing file in the +# install path, so if you want to preserve your's, please move it to +# your HOME dir and set the environment variable if necessary. +# +# This file is best viewed in a editor which supports python mode +# syntax highlighting +# +# Blank lines, or lines starting with a comment symbol, are ignored, +# as are trailing comments. Other lines must have the format +# +# key : val # optional comment +# +# Colors: for the color values below, you can either use +# - a matplotlib color string, such as r, k, or b +# - an rgb tuple, such as (1.0, 0.5, 0.0) +# - a hex string, such as ff00ff (no '#' symbol) +# - a scalar grayscale intensity such as 0.75 +# - a legal html color name, eg red, blue, darkslategray + +#### CONFIGURATION BEGINS HERE +# the default backend; one of GTK GTKAgg GTKCairo FltkAgg QtAgg TkAgg +# WX WXAgg Agg Cairo GD GDK Paint PS PDF SVG Template +backend : Agg +numerix : numpy # numpy, Numeric or numarray +#maskedarray : False # True to use external maskedarray module + # instead of numpy.ma; this is a temporary + # setting for testing maskedarray. +#interactive : False # see http://matplotlib.sourceforge.net/interactive.html +#toolbar : toolbar2 # None | classic | toolbar2 +#timezone : UTC # a pytz timezone string, eg US/Central or Europe/Paris + +# Where your matplotlib data lives if you installed to a non-default +# location. This is where the matplotlib fonts, bitmaps, etc reside +#datapath : /home/jdhunter/mpldata + + +### LINES +# See http://matplotlib.sourceforge.net/matplotlib.lines.html for more +# information on line properties. +#lines.linewidth : 1.0 # line width in points +#lines.linestyle : - # solid line +#lines.color : blue +#lines.marker : None # the default marker +#lines.markeredgewidth : 0.5 # the line width around the marker symbol +#lines.markersize : 6 # markersize, in points +#lines.dash_joinstyle : miter # miter|round|bevel +#lines.dash_capstyle : butt # butt|round|projecting +#lines.solid_joinstyle : miter # miter|round|bevel +#lines.solid_capstyle : projecting # butt|round|projecting +#lines.antialiased : True # render lines in antialised (no jaggies) + +### PATCHES +# Patches are graphical objects that fill 2D space, like polygons or +# circles. See +# http://matplotlib.sourceforge.net/matplotlib.patches.html for more +# information on patch properties +#patch.linewidth : 1.0 # edge width in points +#patch.facecolor : blue +#patch.edgecolor : black +#patch.antialiased : True # render patches in antialised (no jaggies) + +### FONT +# +# font properties used by text.Text. See +# http://matplotlib.sourceforge.net/matplotlib.font_manager.html for more +# information on font properties. The 6 font properties used for font +# matching are given below with their default values. +# +# The font.family property has five values: 'serif' (e.g. Times), +# 'sans-serif' (e.g. Helvetica), 'cursive' (e.g. Zapf-Chancery), +# 'fantasy' (e.g. Western), and 'monospace' (e.g. Courier). Each of +# these font families has a default list of font names in decreasing +# order of priority associated with them. +# +# The font.style property has three values: normal (or roman), italic +# or oblique. The oblique style will be used for italic, if it is not +# present. +# +# The font.variant property has two values: normal or small-caps. For +# TrueType fonts, which are scalable fonts, small-caps is equivalent +# to using a font size of 'smaller', or about 83% of the current font +# size. +# +# The font.weight property has effectively 13 values: normal, bold, +# bolder, lighter, 100, 200, 300, ..., 900. Normal is the same as +# 400, and bold is 700. bolder and lighter are relative values with +# respect to the current weight. +# +# The font.stretch property has 11 values: ultra-condensed, +# extra-condensed, condensed, semi-condensed, normal, semi-expanded, +# expanded, extra-expanded, ultra-expanded, wider, and narrower. This +# property is not currently implemented. +# +# The font.size property is the default font size for text, given in pts. +# 12pt is the standard value. +# +#font.family : sans-serif +#font.style : normal +#font.variant : normal +#font.weight : medium +#font.stretch : normal +# note that font.size controls default text sizes. To configure +# special text sizes tick labels, axes, labels, title, etc, see the rc +# settings for axes and ticks. Special text sizes can be defined +# relative to font.size, using the following values: xx-small, x-small, +# small, medium, large, x-large, xx-large, larger, or smaller +#font.size : 12.0 +#font.serif : Bitstream Vera Serif, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif +#font.sans-serif : Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif +#font.cursive : Apple Chancery, Textile, Zapf Chancery, Sand, cursive +#font.fantasy : Comic Sans MS, Chicago, Charcoal, Impact, Western, fantasy +#font.monospace : Bitstream Vera Sans Mono, Andale Mono, Nimbus Mono L, Courier New, Courier, Fixed, Terminal, monospace + +### TEXT +# text properties used by text.Text. See +# http://matplotlib.sourceforge.net/matplotlib.text.html for more +# information on text properties + +#text.color : black + +### LaTeX customizations. See http://www.scipy.org/Wiki/Cookbook/Matplotlib/UsingTex +#text.usetex : False # use latex for all text handling. The following fonts + # are supported through the usual rc parameter settings: + # new century schoolbook, bookman, times, palatino, + # zapf chancery, charter, serif, sans-serif, helvetica, + # avant garde, courier, monospace, computer modern roman, + # computer modern sans serif, computer modern typewriter + # If another font is desired which can loaded using the + # LaTeX \usepackage command, please inquire at the + # matplotlib mailing list +#text.latex.unicode : False # use "ucs" and "inputenc" LaTeX packages for handling + # unicode strings. +#text.latex.preamble : # IMPROPER USE OF THIS FEATURE WILL LEAD TO LATEX FAILURES + # AND IS THEREFORE UNSUPPORTED. PLEASE DO NOT ASK FOR HELP + # IF THIS FEATURE DOES NOT DO WHAT YOU EXPECT IT TO. + # preamble is a comma separated list of LaTeX statements + # that are included in the LaTeX document preamble. + # An example: + # text.latex.preamble : \usepackage{bm},\usepackage{euler} + # The following packages are always loaded with usetex, so + # beware of package collisions: color, geometry, graphicx, + # type1cm, textcomp. Adobe Postscript (PSSNFS) font packages + # may also be loaded, depending on your font settings +#text.dvipnghack : False # some versions of dvipng don't handle + # alpha channel properly. Use True to correct and flush + # ~/.matplotlib/tex.cache before testing +#text.markup : 'plain' # Affects how text, such as titles and labels, are + # interpreted by default. + # 'plain': As plain, unformatted text + # 'tex': As TeX-like text. Text between $'s will be + # formatted as a TeX math expression. + # This setting has no effect when text.usetex is True. + # In that case, all text will be sent to TeX for + # processing. + +# The following settings allow you to select the fonts in math mode. +# They map from a TeX font name to a fontconfig font pattern. +# These settings are only used if mathtext.fontset is 'custom'. +#mathtext.cal : cursive +#mathtext.rm : serif +#mathtext.tt : monospace +#mathtext.it : serif:italic +#mathtext.bf : serif:bold +#mathtext.sf : sans +#mathtext.fontset : cm # Should be 'cm' (Computer Modern), 'stix', + # 'stixsans' or 'custom' +#mathtext.fallback_to_cm : True # When True, use symbols from the Computer Modern + # fonts when a symbol can not be found in one of + # the custom math fonts. + +### AXES +# default face and edge color, default tick sizes, +# default fontsizes for ticklabels, and so on. See +# http://matplotlib.sourceforge.net/matplotlib.axes.html#Axes +#axes.hold : True # whether to clear the axes by default on +#axes.facecolor : white # axes background color +#axes.edgecolor : black # axes edge color +#axes.linewidth : 1.0 # edge linewidth +#axes.grid : False # display grid or not +#axes.titlesize : 14 # fontsize of the axes title +#axes.labelsize : 12 # fontsize of the x any y labels +#axes.labelcolor : black +#axes.axisbelow : False # whether axis gridlines and ticks are below + # the axes elements (lines, text, etc) +#axes.formatter.limits : -7, 7 # use scientific notation if log10 + # of the axis range is smaller than the + # first or larger than the second + +#polaraxes.grid : True # display grid on polar axes + +### TICKS +# see http://matplotlib.sourceforge.net/matplotlib.axis.html#Ticks +#xtick.major.size : 4 # major tick size in points +#xtick.minor.size : 2 # minor tick size in points +#xtick.major.pad : 4 # distance to major tick label in points +#xtick.minor.pad : 4 # distance to the minor tick label in points +#xtick.color : k # color of the tick labels +#xtick.labelsize : 12 # fontsize of the tick labels +#xtick.direction : in # direction: in or out + +#ytick.major.size : 4 # major tick size in points +#ytick.minor.size : 2 # minor tick size in points +#ytick.major.pad : 4 # distance to major tick label in points +#ytick.minor.pad : 4 # distance to the minor tick label in points +#ytick.color : k # color of the tick labels +#ytick.labelsize : 12 # fontsize of the tick labels +#ytick.direction : in # direction: in or out + + +### GRIDS +#grid.color : black # grid color +#grid.linestyle : : # dotted +#grid.linewidth : 0.5 # in points + +### Legend +#legend.isaxes : True +#legend.numpoints : 2 # the number of points in the legend line +#legend.fontsize : 14 +#legend.pad : 0.2 # the fractional whitespace inside the legend border +#legend.markerscale : 1.0 # the relative size of legend markers vs. original +# the following dimensions are in axes coords +#legend.labelsep : 0.010 # the vertical space between the legend entries +#legend.handlelen : 0.05 # the length of the legend lines +#legend.handletextsep : 0.02 # the space between the legend line and legend text +#legend.axespad : 0.02 # the border between the axes and legend edge +#legend.shadow : False + +### FIGURE +# See http://matplotlib.sourceforge.net/matplotlib.figure.html#Figure +#figure.figsize : 8, 6 # figure size in inches +#figure.dpi : 80 # figure dots per inch +#figure.facecolor : 0.75 # figure facecolor; 0.75 is scalar gray +#figure.edgecolor : white # figure edgecolor + +# The figure subplot parameters. All dimensions are fraction of the +# figure width or height +#figure.subplot.left : 0.125 # the left side of the subplots of the figure +#figure.subplot.right : 0.9 # the right side of the subplots of the figure +#figure.subplot.bottom : 0.1 # the bottom of the subplots of the figure +#figure.subplot.top : 0.9 # the top of the subplots of the figure +#figure.subplot.wspace : 0.2 # the amount of width reserved for blank space between subplots +#figure.subplot.hspace : 0.2 # the amount of height reserved for white space between subplots + +#figure.autolayout : False # when True, adjust the axes so that text doesn't overlap + +### IMAGES +#image.aspect : equal # equal | auto | a number +#image.interpolation : bilinear # see help(imshow) for options +#image.cmap : jet # gray | jet etc... +#image.lut : 256 # the size of the colormap lookup table +#image.origin : upper # lower | upper + + +### CONTOUR PLOTS +#contour.negative_linestyle : dashed # dashed | solid + +### SAVING FIGURES +# the default savefig params can be different for the GUI backends. +# Eg, you may want a higher resolution, or to make the figure +# background white +#savefig.dpi : 100 # figure dots per inch +#savefig.facecolor : white # figure facecolor when saving +#savefig.edgecolor : white # figure edgecolor when saving + +#cairo.format : png # png, ps, pdf, svg + +# tk backend params +#tk.window_focus : False # Maintain shell focus for TkAgg +#tk.pythoninspect : False # tk sets PYTHONINSEPCT + +# ps backend params +#ps.papersize : letter # auto, letter, legal, ledger, A0-A10, B0-B10 +#ps.useafm : False # use of afm fonts, results in small files +#ps.usedistiller : False # can be: None, ghostscript or xpdf + # Experimental: may produce smaller files. + # xpdf intended for production of publication quality files, + # but requires ghostscript, xpdf and ps2eps +#ps.distiller.res : 6000 # dpi +#ps.fonttype : 3 # Output Type 3 (Type3) or Type 42 (TrueType) + +# pdf backend params +#pdf.compression : 6 # integer from 0 to 9 + # 0 disables compression (good for debugging) +#pdf.fonttype : 3 # Output Type 3 (Type3) or Type 42 (TrueType) + +# svg backend params +#svg.image_inline : True # write raster image data directly into the svg file +#svg.image_noscale : False # suppress scaling of raster data embedded in SVG +#svg.embed_chars : True # embed character outlines in the SVG file + +# Set the verbose flags. This controls how much information +# matplotlib gives you at runtime and where it goes. The verbosity +# levels are: silent, helpful, debug, debug-annoying. Any level is +# inclusive of all the levels below it. If you setting is debug, +# you'll get all the debug and helpful messages. When submitting +# problems to the mailing-list, please set verbose to helpful or debug +# and paste the output into your report. +# +# The fileo gives the destination for any calls to verbose.report. +# These objects can a filename, or a filehandle like sys.stdout. +# +# You can override the rc default verbosity from the command line by +# giving the flags --verbose-LEVEL where LEVEL is one of the legal +# levels, eg --verbose-helpful. +# +# You can access the verbose instance in your code +# from matplotlib import verbose. +#verbose.level : silent # one of silent, helpful, debug, debug-annoying +#verbose.fileo : sys.stdout # a log filename, sys.stdout or sys.stderr Copied: trunk/matplotlib/doc/pyplots (from rev 5507, trunk/matplotlib/doc/users/figures) Deleted: trunk/matplotlib/doc/pyplots/annotation_basic.py =================================================================== --- trunk/matplotlib/doc/users/figures/annotation_basic.py 2008-06-13 14:57:50 UTC (rev 5507) +++ trunk/matplotlib/doc/pyplots/annotation_basic.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -1,16 +0,0 @@ -import numpy as np -import matplotlib.pyplot as plt - -fig = plt.figure() -ax = fig.add_subplot(111) - -t = np.arange(0.0, 5.0, 0.01) -s = np.cos(2*np.pi*t) -line, = ax.plot(t, s, lw=2) - -ax.annotate('local max', xy=(2, 1), xytext=(3, 1.5), - arrowprops=dict(facecolor='black', shrink=0.05), - ) - -ax.set_ylim(-2,2) -plt.show() Copied: trunk/matplotlib/doc/pyplots/annotation_basic.py (from rev 5512, trunk/matplotlib/doc/users/figures/annotation_basic.py) =================================================================== --- trunk/matplotlib/doc/pyplots/annotation_basic.py (rev 0) +++ trunk/matplotlib/doc/pyplots/annotation_basic.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -0,0 +1,16 @@ +import numpy as np +import matplotlib.pyplot as plt + +fig = plt.figure() +ax = fig.add_subplot(111) + +t = np.arange(0.0, 5.0, 0.01) +s = np.cos(2*np.pi*t) +line, = ax.plot(t, s, lw=2) + +ax.annotate('local max', xy=(2, 1), xytext=(3, 1.5), + arrowprops=dict(facecolor='black', shrink=0.05), + ) + +ax.set_ylim(-2,2) +plt.show() Deleted: trunk/matplotlib/doc/pyplots/annotation_polar.py =================================================================== --- trunk/matplotlib/doc/users/figures/annotation_polar.py 2008-06-13 14:57:50 UTC (rev 5507) +++ trunk/matplotlib/doc/pyplots/annotation_polar.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -1,21 +0,0 @@ -import numpy as np -import matplotlib.pyplot as plt - -fig = plt.figure() -ax = fig.add_subplot(111, polar=True) -r = np.arange(0,1,0.001) -theta = 2*2*np.pi*r -line, = ax.plot(theta, r, color='#ee8d18', lw=3) - -ind = 800 -thisr, thistheta = r[ind], theta[ind] -ax.plot([thistheta], [thisr], 'o') -ax.annotate('a polar annotation', - xy=(thistheta, thisr), # theta, radius - xytext=(0.05, 0.05), # fraction, fraction - textcoords='figure fraction', - arrowprops=dict(facecolor='black', shrink=0.05), - horizontalalignment='left', - verticalalignment='bottom', - ) -plt.show() Copied: trunk/matplotlib/doc/pyplots/annotation_polar.py (from rev 5512, trunk/matplotlib/doc/users/figures/annotation_polar.py) =================================================================== --- trunk/matplotlib/doc/pyplots/annotation_polar.py (rev 0) +++ trunk/matplotlib/doc/pyplots/annotation_polar.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -0,0 +1,21 @@ +import numpy as np +import matplotlib.pyplot as plt + +fig = plt.figure() +ax = fig.add_subplot(111, polar=True) +r = np.arange(0,1,0.001) +theta = 2*2*np.pi*r +line, = ax.plot(theta, r, color='#ee8d18', lw=3) + +ind = 800 +thisr, thistheta = r[ind], theta[ind] +ax.plot([thistheta], [thisr], 'o') +ax.annotate('a polar annotation', + xy=(thistheta, thisr), # theta, radius + xytext=(0.05, 0.05), # fraction, fraction + textcoords='figure fraction', + arrowprops=dict(facecolor='black', shrink=0.05), + horizontalalignment='left', + verticalalignment='bottom', + ) +plt.show() Deleted: trunk/matplotlib/doc/pyplots/dollar_ticks.py =================================================================== --- trunk/matplotlib/doc/users/figures/dollar_ticks.py 2008-06-13 14:57:50 UTC (rev 5507) +++ trunk/matplotlib/doc/pyplots/dollar_ticks.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -1,17 +0,0 @@ -import numpy as np -import matplotlib.pyplot as plt -import matplotlib.ticker as ticker - -fig = plt.figure() -ax = fig.add_subplot(111) -ax.plot(100*np.random.rand(20)) - -formatter = ticker.FormatStrFormatter('$%1.2f') -ax.yaxis.set_major_formatter(formatter) - -for tick in ax.yaxis.get_major_ticks(): - tick.label1On = False - tick.label2On = True - tick.label2.set_color('green') - - Copied: trunk/matplotlib/doc/pyplots/dollar_ticks.py (from rev 5512, trunk/matplotlib/doc/users/figures/dollar_ticks.py) =================================================================== --- trunk/matplotlib/doc/pyplots/dollar_ticks.py (rev 0) +++ trunk/matplotlib/doc/pyplots/dollar_ticks.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -0,0 +1,17 @@ +import numpy as np +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker + +fig = plt.figure() +ax = fig.add_subplot(111) +ax.plot(100*np.random.rand(20)) + +formatter = ticker.FormatStrFormatter('$%1.2f') +ax.yaxis.set_major_formatter(formatter) + +for tick in ax.yaxis.get_major_ticks(): + tick.label1On = False + tick.label2On = True + tick.label2.set_color('green') + + Deleted: trunk/matplotlib/doc/pyplots/fig_axes_customize_simple.py =================================================================== --- trunk/matplotlib/doc/users/figures/fig_axes_customize_simple.py 2008-06-13 14:57:50 UTC (rev 5507) +++ trunk/matplotlib/doc/pyplots/fig_axes_customize_simple.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -1,27 +0,0 @@ -import numpy as np -import matplotlib.pyplot as plt - -# plt.figure creates a matplotlib.figure.Figure instance -fig = plt.figure() -rect = fig.figurePatch # a rectangle instance -rect.set_facecolor('lightgoldenrodyellow') - -ax1 = fig.add_axes([0.1, 0.3, 0.4, 0.4]) -rect = ax1.axesPatch -rect.set_facecolor('lightslategray') - - -for label in ax1.xaxis.get_ticklabels(): - # label is a Text instance - label.set_color('red') - label.set_rotation(45) - label.set_fontsize(16) - -for line in ax1.yaxis.get_ticklines(): - # line is a Line2D instance - line.set_color('green') - line.set_markersize(25) - line.set_markeredgewidth(3) - - - Copied: trunk/matplotlib/doc/pyplots/fig_axes_customize_simple.py (from rev 5512, trunk/matplotlib/doc/users/figures/fig_axes_customize_simple.py) =================================================================== --- trunk/matplotlib/doc/pyplots/fig_axes_customize_simple.py (rev 0) +++ trunk/matplotlib/doc/pyplots/fig_axes_customize_simple.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -0,0 +1,27 @@ +import numpy as np +import matplotlib.pyplot as plt + +# plt.figure creates a matplotlib.figure.Figure instance +fig = plt.figure() +rect = fig.figurePatch # a rectangle instance +rect.set_facecolor('lightgoldenrodyellow') + +ax1 = fig.add_axes([0.1, 0.3, 0.4, 0.4]) +rect = ax1.axesPatch +rect.set_facecolor('lightslategray') + + +for label in ax1.xaxis.get_ticklabels(): + # label is a Text instance + label.set_color('red') + label.set_rotation(45) + label.set_fontsize(16) + +for line in ax1.yaxis.get_ticklines(): + # line is a Line2D instance + line.set_color('green') + line.set_markersize(25) + line.set_markeredgewidth(3) + + + Deleted: trunk/matplotlib/doc/pyplots/fig_axes_labels_simple.py =================================================================== --- trunk/matplotlib/doc/users/figures/fig_axes_labels_simple.py 2008-06-13 14:57:50 UTC (rev 5507) +++ trunk/matplotlib/doc/pyplots/fig_axes_labels_simple.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -1,19 +0,0 @@ -import numpy as np -import matplotlib.pyplot as plt - -fig = plt.figure() -fig.subplots_adjust(top=0.8) -ax1 = fig.add_subplot(211) -ax1.set_ylabel('volts') -ax1.set_title('a sine wave') - -t = np.arange(0.0, 1.0, 0.01) -s = np.sin(2*np.pi*t) -line, = ax1.plot(t, s, color='blue', lw=2) - -ax2 = fig.add_axes([0.15, 0.1, 0.7, 0.3]) -n, bins, patches = ax2.hist(np.random.randn(1000), 50, - facecolor='yellow', edgecolor='yellow') -ax2.set_xlabel('time (s)') - - Copied: trunk/matplotlib/doc/pyplots/fig_axes_labels_simple.py (from rev 5512, trunk/matplotlib/doc/users/figures/fig_axes_labels_simple.py) =================================================================== --- trunk/matplotlib/doc/pyplots/fig_axes_labels_simple.py (rev 0) +++ trunk/matplotlib/doc/pyplots/fig_axes_labels_simple.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -0,0 +1,19 @@ +import numpy as np +import matplotlib.pyplot as plt + +fig = plt.figure() +fig.subplots_adjust(top=0.8) +ax1 = fig.add_subplot(211) +ax1.set_ylabel('volts') +ax1.set_title('a sine wave') + +t = np.arange(0.0, 1.0, 0.01) +s = np.sin(2*np.pi*t) +line, = ax1.plot(t, s, color='blue', lw=2) + +ax2 = fig.add_axes([0.15, 0.1, 0.7, 0.3]) +n, bins, patches = ax2.hist(np.random.randn(1000), 50, + facecolor='yellow', edgecolor='yellow') +ax2.set_xlabel('time (s)') + + Deleted: trunk/matplotlib/doc/pyplots/fig_x.py =================================================================== --- trunk/matplotlib/doc/users/figures/fig_x.py 2008-06-13 14:57:50 UTC (rev 5507) +++ trunk/matplotlib/doc/pyplots/fig_x.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -1,12 +0,0 @@ -import numpy as np -import matplotlib.pyplot as plt -import matplotlib.lines as lines -fig = plt.figure() - -l1 = lines.Line2D([0, 1], [0, 1], transform=fig.transFigure, figure=fig) - -l2 = lines.Line2D([0, 1], [1, 0], transform=fig.transFigure, figure=fig) - -fig.lines.extend([l1, l2]) - - Copied: trunk/matplotlib/doc/pyplots/fig_x.py (from rev 5512, trunk/matplotlib/doc/users/figures/fig_x.py) =================================================================== --- trunk/matplotlib/doc/pyplots/fig_x.py (rev 0) +++ trunk/matplotlib/doc/pyplots/fig_x.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -0,0 +1,12 @@ +import numpy as np +import matplotlib.pyplot as plt +import matplotlib.lines as lines +fig = plt.figure() + +l1 = lines.Line2D([0, 1], [0, 1], transform=fig.transFigure, figure=fig) + +l2 = lines.Line2D([0, 1], [1, 0], transform=fig.transFigure, figure=fig) + +fig.lines.extend([l1, l2]) + + Deleted: trunk/matplotlib/doc/pyplots/make.py =================================================================== --- trunk/matplotlib/doc/users/figures/make.py 2008-06-13 14:57:50 UTC (rev 5507) +++ trunk/matplotlib/doc/pyplots/make.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -1,68 +0,0 @@ -#!/usr/bin/env python -import sys, os, glob -import matplotlib -import IPython.Shell -#matplotlib.rcdefaults() -matplotlib.use('Agg') - -mplshell = IPython.Shell.MatplotlibShell('mpl') - -formats = [('png', 100), - ('hires.png', 200), - ('pdf', 72)] - -def figs(): - print 'making figs' - import matplotlib.pyplot as plt - for fname in glob.glob('*.py'): - if fname==__file__: continue - basename, ext = os.path.splitext(fname) - outfiles = ['%s.%s' % (basename, format) for format, dpi in formats] - all_exists = True - for format, dpi in formats: - if not os.path.exists('%s.%s' % (basename, format)): - all_exists = False - break - - if all_exists: - print ' already have %s'%fname - else: - print ' building %s'%fname - plt.close('all') # we need to clear between runs - mplshell.magic_run(basename) - for format, dpi in formats: - plt.savefig('%s.%s' % (basename, format), dpi=dpi) - print 'all figures made' - - -def clean(): - patterns = (['#*', '*~', '*pyc'] + - ['*.%s' % format for format, dpi in formats]) - for pattern in patterns: - for fname in glob.glob(pattern): - os.remove(fname) - print 'all clean' - - - -def all(): - figs() - -funcd = {'figs':figs, - 'clean':clean, - 'all':all, - } - -if len(sys.argv)>1: - for arg in sys.argv[1:]: - func = funcd.get(arg) - if func is None: - raise SystemExit('Do not know how to handle %s; valid args are'%( - arg, funcd.keys())) - func() -else: - all() - - - - Copied: trunk/matplotlib/doc/pyplots/make.py (from rev 5512, trunk/matplotlib/doc/users/figures/make.py) =================================================================== --- trunk/matplotlib/doc/pyplots/make.py (rev 0) +++ trunk/matplotlib/doc/pyplots/make.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -0,0 +1,68 @@ +#!/usr/bin/env python +import sys, os, glob +import matplotlib +import IPython.Shell +#matplotlib.rcdefaults() +matplotlib.use('Agg') + +mplshell = IPython.Shell.MatplotlibShell('mpl') + +formats = [('png', 100), + ('hires.png', 200), + ('pdf', 72)] + +def figs(): + print 'making figs' + import matplotlib.pyplot as plt + for fname in glob.glob('*.py'): + if fname==__file__: continue + basename, ext = os.path.splitext(fname) + outfiles = ['%s.%s' % (basename, format) for format, dpi in formats] + all_exists = True + for format, dpi in formats: + if not os.path.exists('%s.%s' % (basename, format)): + all_exists = False + break + + if all_exists: + print ' already have %s'%fname + else: + print ' building %s'%fname + plt.close('all') # we need to clear between runs + mplshell.magic_run(basename) + for format, dpi in formats: + plt.savefig('%s.%s' % (basename, format), dpi=dpi) + print 'all figures made' + + +def clean(): + patterns = (['#*', '*~', '*pyc'] + + ['*.%s' % format for format, dpi in formats]) + for pattern in patterns: + for fname in glob.glob(pattern): + os.remove(fname) + print 'all clean' + + + +def all(): + figs() + +funcd = {'figs':figs, + 'clean':clean, + 'all':all, + } + +if len(sys.argv)>1: + for arg in sys.argv[1:]: + func = funcd.get(arg) + if func is None: + raise SystemExit('Do not know how to handle %s; valid args are'%( + arg, funcd.keys())) + func() +else: + all() + + + + Deleted: trunk/matplotlib/doc/pyplots/matplotlibrc =================================================================== Copied: trunk/matplotlib/doc/pyplots/matplotlibrc (from rev 5512, trunk/matplotlib/doc/users/figures/matplotlibrc) =================================================================== Deleted: trunk/matplotlib/doc/pyplots/pyplot_annotate.py =================================================================== --- trunk/matplotlib/doc/users/figures/pyplot_annotate.py 2008-06-13 14:57:50 UTC (rev 5507) +++ trunk/matplotlib/doc/pyplots/pyplot_annotate.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -1,15 +0,0 @@ -import numpy as np -import matplotlib.pyplot as plt - -ax = plt.subplot(111) - -t = np.arange(0.0, 5.0, 0.01) -s = np.cos(2*np.pi*t) -line, = plt.plot(t, s, lw=2) - -plt.annotate('local max', xy=(2, 1), xytext=(3, 1.5), - arrowprops=dict(facecolor='black', shrink=0.05), - ) - -plt.ylim(-2,2) -plt.show() Copied: trunk/matplotlib/doc/pyplots/pyplot_annotate.py (from rev 5512, trunk/matplotlib/doc/users/figures/pyplot_annotate.py) =================================================================== --- trunk/matplotlib/doc/pyplots/pyplot_annotate.py (rev 0) +++ trunk/matplotlib/doc/pyplots/pyplot_annotate.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -0,0 +1,15 @@ +import numpy as np +import matplotlib.pyplot as plt + +ax = plt.subplot(111) + +t = np.arange(0.0, 5.0, 0.01) +s = np.cos(2*np.pi*t) +line, = plt.plot(t, s, lw=2) + +plt.annotate('local max', xy=(2, 1), xytext=(3, 1.5), + arrowprops=dict(facecolor='black', shrink=0.05), + ) + +plt.ylim(-2,2) +plt.show() Deleted: trunk/matplotlib/doc/pyplots/pyplot_formatstr.py =================================================================== --- trunk/matplotlib/doc/users/figures/pyplot_formatstr.py 2008-06-13 14:57:50 UTC (rev 5507) +++ trunk/matplotlib/doc/pyplots/pyplot_formatstr.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -1,5 +0,0 @@ -import matplotlib.pyplot as plt -plt.plot([1,2,3,4], [1,4,9,16], 'ro') -plt.axis([0, 6, 0, 20]) - - Copied: trunk/matplotlib/doc/pyplots/pyplot_formatstr.py (from rev 5512, trunk/matplotlib/doc/users/figures/pyplot_formatstr.py) =================================================================== --- trunk/matplotlib/doc/pyplots/pyplot_formatstr.py (rev 0) +++ trunk/matplotlib/doc/pyplots/pyplot_formatstr.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -0,0 +1,5 @@ +import matplotlib.pyplot as plt +plt.plot([1,2,3,4], [1,4,9,16], 'ro') +plt.axis([0, 6, 0, 20]) + + Deleted: trunk/matplotlib/doc/pyplots/pyplot_mathtext.py =================================================================== --- trunk/matplotlib/doc/users/figures/pyplot_mathtext.py 2008-06-13 14:57:50 UTC (rev 5507) +++ trunk/matplotlib/doc/pyplots/pyplot_mathtext.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -1,12 +0,0 @@ -import numpy as np -import matplotlib.pyplot as plt -t = np.arange(0.0, 2.0, 0.01) -s = np.sin(2*np.pi*t) - -plt.plot(t,s) -plt.title(r'$\alpha_i > \beta_i$', fontsize=20) -plt.text(1, -0.6, r'$\sum_{i=0}^\infty x_i$', fontsize=20) -plt.text(0.6, 0.6, r'$\mathcal{A}\mathrm{sin}(2 \omega t)$', - fontsize=20) -plt.xlabel('time (s)') -plt.ylabel('volts (mV)') Copied: trunk/matplotlib/doc/pyplots/pyplot_mathtext.py (from rev 5512, trunk/matplotlib/doc/users/figures/pyplot_mathtext.py) =================================================================== --- trunk/matplotlib/doc/pyplots/pyplot_mathtext.py (rev 0) +++ trunk/matplotlib/doc/pyplots/pyplot_mathtext.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -0,0 +1,12 @@ +import numpy as np +import matplotlib.pyplot as plt +t = np.arange(0.0, 2.0, 0.01) +s = np.sin(2*np.pi*t) + +plt.plot(t,s) +plt.title(r'$\alpha_i > \beta_i$', fontsize=20) +plt.text(1, -0.6, r'$\sum_{i=0}^\infty x_i$', fontsize=20) +plt.text(0.6, 0.6, r'$\mathcal{A}\mathrm{sin}(2 \omega t)$', + fontsize=20) +plt.xlabel('time (s)') +plt.ylabel('volts (mV)') Deleted: trunk/matplotlib/doc/pyplots/pyplot_simple.py =================================================================== --- trunk/matplotlib/doc/users/figures/pyplot_simple.py 2008-06-13 14:57:50 UTC (rev 5507) +++ trunk/matplotlib/doc/pyplots/pyplot_simple.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -1,4 +0,0 @@ -import matplotlib.pyplot as plt -plt.plot([1,2,3]) -plt.ylabel('some numbers') -plt.show() Copied: trunk/matplotlib/doc/pyplots/pyplot_simple.py (from rev 5512, trunk/matplotlib/doc/users/figures/pyplot_simple.py) =================================================================== --- trunk/matplotlib/doc/pyplots/pyplot_simple.py (rev 0) +++ trunk/matplotlib/doc/pyplots/pyplot_simple.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -0,0 +1,4 @@ +import matplotlib.pyplot as plt +plt.plot([1,2,3]) +plt.ylabel('some numbers') +plt.show() Deleted: trunk/matplotlib/doc/pyplots/pyplot_text.py =================================================================== --- trunk/matplotlib/doc/users/figures/pyplot_text.py 2008-06-13 14:57:50 UTC (rev 5507) +++ trunk/matplotlib/doc/pyplots/pyplot_text.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -1,17 +0,0 @@ -import numpy as np -import matplotlib.pyplot as plt - -mu, sigma = 100, 15 -x = mu + sigma * np.random.randn(10000) - -# the histogram of the data -n, bins, patches = plt.hist(x, 50, normed=1, facecolor='g', alpha=0.75) - - -plt.xlabel('Smarts') -plt.ylabel('Probability') -plt.title('Histogram of IQ') -plt.text(60, .025, r'$\mu=100,\ \sigma=15$') -plt.axis([40, 160, 0, 0.03]) -plt.grid(True) - Copied: trunk/matplotlib/doc/pyplots/pyplot_text.py (from rev 5512, trunk/matplotlib/doc/users/figures/pyplot_text.py) =================================================================== --- trunk/matplotlib/doc/pyplots/pyplot_text.py (rev 0) +++ trunk/matplotlib/doc/pyplots/pyplot_text.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -0,0 +1,17 @@ +import numpy as np +import matplotlib.pyplot as plt + +mu, sigma = 100, 15 +x = mu + sigma * np.random.randn(10000) + +# the histogram of the data +n, bins, patches = plt.hist(x, 50, normed=1, facecolor='g', alpha=0.75) + + +plt.xlabel('Smarts') +plt.ylabel('Probability') +plt.title('Histogram of IQ') +plt.text(60, .025, r'$\mu=100,\ \sigma=15$') +plt.axis([40, 160, 0, 0.03]) +plt.grid(True) + Deleted: trunk/matplotlib/doc/pyplots/pyplot_three.py =================================================================== --- trunk/matplotlib/doc/users/figures/pyplot_three.py 2008-06-13 14:57:50 UTC (rev 5507) +++ trunk/matplotlib/doc/pyplots/pyplot_three.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -1,9 +0,0 @@ -import numpy as np -import matplotlib.pyplot as plt - -# evenly sampled time at 200ms intervals -t = np.arange(0., 5., 0.2) - -# red dashes, blue squares and green triangles -plt.plot(t, t, 'r--', t, t**2, 'bs', t, t**3, 'g^') - Copied: trunk/matplotlib/doc/pyplots/pyplot_three.py (from rev 5512, trunk/matplotlib/doc/users/figures/pyplot_three.py) =================================================================== --- trunk/matplotlib/doc/pyplots/pyplot_three.py (rev 0) +++ trunk/matplotlib/doc/pyplots/pyplot_three.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -0,0 +1,9 @@ +import numpy as np +import matplotlib.pyplot as plt + +# evenly sampled time at 200ms intervals +t = np.arange(0., 5., 0.2) + +# red dashes, blue squares and green triangles +plt.plot(t, t, 'r--', t, t**2, 'bs', t, t**3, 'g^') + Deleted: trunk/matplotlib/doc/pyplots/pyplot_two_subplots.py =================================================================== --- trunk/matplotlib/doc/users/figures/pyplot_two_subplots.py 2008-06-13 14:57:50 UTC (rev 5507) +++ trunk/matplotlib/doc/pyplots/pyplot_two_subplots.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -1,16 +0,0 @@ -import numpy as np -import matplotlib.pyplot as plt - -def f(t): - return np.exp(-t) * np.cos(2*np.pi*t) - -t1 = np.arange(0.0, 5.0, 0.1) -t2 = np.arange(0.0, 5.0, 0.02) - -plt.figure(1) -plt.subplot(211) -plt.plot(t1, f(t1), 'bo', t2, f(t2), 'k') - -plt.subplot(212) -plt.plot(t2, np.cos(2*np.pi*t2), 'r--') - Copied: trunk/matplotlib/doc/pyplots/pyplot_two_subplots.py (from rev 5512, trunk/matplotlib/doc/users/figures/pyplot_two_subplots.py) =================================================================== --- trunk/matplotlib/doc/pyplots/pyplot_two_subplots.py (rev 0) +++ trunk/matplotlib/doc/pyplots/pyplot_two_subplots.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -0,0 +1,16 @@ +import numpy as np +import matplotlib.pyplot as plt + +def f(t): + return np.exp(-t) * np.cos(2*np.pi*t) + +t1 = np.arange(0.0, 5.0, 0.1) +t2 = np.arange(0.0, 5.0, 0.02) + +plt.figure(1) +plt.subplot(211) +plt.plot(t1, f(t1), 'bo', t2, f(t2), 'k') + +plt.subplot(212) +plt.plot(t2, np.cos(2*np.pi*t2), 'r--') + Deleted: trunk/matplotlib/doc/pyplots/text_commands.py =================================================================== --- trunk/matplotlib/doc/users/figures/text_commands.py 2008-06-13 14:57:50 UTC (rev 5507) +++ trunk/matplotlib/doc/pyplots/text_commands.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -import matplotlib.pyplot as plt - -fig = plt.figure() -fig.suptitle('bold figure suptitle', fontsize=14, fontweight='bold') - -ax = fig.add_subplot(111) - -ax.set_title('axes title') - -ax.set_xlabel('xlabel') -ax.set_ylabel('ylabel') - -ax.text(5, 8, 'boxed italics text in data coords', style='italic', - bbox={'facecolor':'red', 'alpha':0.5, 'pad':10}) - -ax.text(2, 6, r'an equation: $E=mc^2$', fontsize=20) - -ax.text(4, 3, unicode('unicode: Institut f\374r Festk\366rperphysik', 'latin-1')) - -ax.text(0.95, 0.01, 'colored text in axes coords', - verticalalignment='bottom', horizontalalignment='right', - transform=ax.transAxes, - color='green', fontsize=20) - - -ax.plot([2], [1], 'o') -ax.annotate('annotate', xy=(2, 1), xytext=(3, 4), - arrowprops=dict(facecolor='black', shrink=0.05)) - -ax.axis([0, 10, 0, 10]) - -plt.show() Copied: trunk/matplotlib/doc/pyplots/text_commands.py (from rev 5512, trunk/matplotlib/doc/users/figures/text_commands.py) =================================================================== --- trunk/matplotlib/doc/pyplots/text_commands.py (rev 0) +++ trunk/matplotlib/doc/pyplots/text_commands.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +import matplotlib.pyplot as plt + +fig = plt.figure() +fig.suptitle('bold figure suptitle', fontsize=14, fontweight='bold') + +ax = fig.add_subplot(111) + +ax.set_title('axes title') + +ax.set_xlabel('xlabel') +ax.set_ylabel('ylabel') + +ax.text(5, 8, 'boxed italics text in data coords', style='italic', + bbox={'facecolor':'red', 'alpha':0.5, 'pad':10}) + +ax.text(2, 6, r'an equation: $E=mc^2$', fontsize=20) + +ax.text(4, 3, unicode('unicode: Institut f\374r Festk\366rperphysik', 'latin-1')) + +ax.text(0.95, 0.01, 'colored text in axes coords', + verticalalignment='bottom', horizontalalignment='right', + transform=ax.transAxes, + color='green', fontsize=20) + + +ax.plot([2], [1], 'o') +ax.annotate('annotate', xy=(2, 1), xytext=(3, 4), + arrowprops=dict(facecolor='black', shrink=0.05)) + +ax.axis([0, 10, 0, 10]) + +plt.show() Deleted: trunk/matplotlib/doc/pyplots/text_layout.py =================================================================== --- trunk/matplotlib/doc/users/figures/text_layout.py 2008-06-13 14:57:50 UTC (rev 5507) +++ trunk/matplotlib/doc/pyplots/text_layout.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -1,77 +0,0 @@ -import matplotlib.pyplot as plt -import matplotlib.patches as patches - -# build a rectangle in axes coords -left, width = .25, .5 -bottom, height = .25, .5 -right = left + width -top = bottom + height - -fig = plt.figure() -ax = fig.add_subplot(111) - -# axes coordinates are 0,0 is bottom left and 1,1 is upper right -p = patches.Rectangle( - (left, bottom), width, height, - fill=False, transform=ax.transAxes, clip_on=False - ) - -ax.add_patch(p) - -ax.text(left, bottom, 'left top', - horizontalalignment='left', - verticalalignment='top', - transform=ax.transAxes) - -ax.text(left, bottom, 'left bottom', - horizontalalignment='left', - verticalalignment='bottom', - transform=ax.transAxes) - -ax.text(right, top, 'right bottom', - horizontalalignment='right', - verticalalignment='bottom', - transform=ax.transAxes) - -ax.text(right, top, 'right top', - horizontalalignment='right', - verticalalignment='top', - transform=ax.transAxes) - -ax.text(right, bottom, 'center top', - horizontalalignment='center', - verticalalignment='top', - transform=ax.transAxes) - -ax.text(left, 0.5*(bottom+top), 'right center', - horizontalalignment='right', - verticalalignment='center', - rotation='vertical', - transform=ax.transAxes) - -ax.text(left, 0.5*(bottom+top), 'left center', - horizontalalignment='left', - verticalalignment='center', - rotation='vertical', - transform=ax.transAxes) - -ax.text(0.5*(left+right), 0.5*(bottom+top), 'middle', - horizontalalignment='center', - verticalalignment='center', - fontsize=20, color='red', - transform=ax.transAxes) - -ax.text(right, 0.5*(bottom+top), 'centered', - horizontalalignment='center', - verticalalignment='center', - rotation='vertical', - transform=ax.transAxes) - -ax.text(left, top, 'rotated\nwith newlines', - horizontalalignment='center', - verticalalignment='center', - rotation=45, - transform=ax.transAxes) - -ax.set_axis_off() -plt.show() Copied: trunk/matplotlib/doc/pyplots/text_layout.py (from rev 5512, trunk/matplotlib/doc/users/figures/text_layout.py) =================================================================== --- trunk/matplotlib/doc/pyplots/text_layout.py (rev 0) +++ trunk/matplotlib/doc/pyplots/text_layout.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -0,0 +1,77 @@ +import matplotlib.pyplot as plt +import matplotlib.patches as patches + +# build a rectangle in axes coords +left, width = .25, .5 +bottom, height = .25, .5 +right = left + width +top = bottom + height + +fig = plt.figure() +ax = fig.add_subplot(111) + +# axes coordinates are 0,0 is bottom left and 1,1 is upper right +p = patches.Rectangle( + (left, bottom), width, height, + fill=False, transform=ax.transAxes, clip_on=False + ) + +ax.add_patch(p) + +ax.text(left, bottom, 'left top', + horizontalalignment='left', + verticalalignment='top', + transform=ax.transAxes) + +ax.text(left, bottom, 'left bottom', + horizontalalignment='left', + verticalalignment='bottom', + transform=ax.transAxes) + +ax.text(right, top, 'right bottom', + horizontalalignment='right', + verticalalignment='bottom', + transform=ax.transAxes) + +ax.text(right, top, 'right top', + horizontalalignment='right', + verticalalignment='top', + transform=ax.transAxes) + +ax.text(right, bottom, 'center top', + horizontalalignment='center', + verticalalignment='top', + transform=ax.transAxes) + +ax.text(left, 0.5*(bottom+top), 'right center', + horizontalalignment='right', + verticalalignment='center', + rotation='vertical', + transform=ax.transAxes) + +ax.text(left, 0.5*(bottom+top), 'left center', + horizontalalignment='left', + verticalalignment='center', + rotation='vertical', + transform=ax.transAxes) + +ax.text(0.5*(left+right), 0.5*(bottom+top), 'middle', + horizontalalignment='center', + verticalalignment='center', + fontsize=20, color='red', + transform=ax.transAxes) + +ax.text(right, 0.5*(bottom+top), 'centered', + horizontalalignment='center', + verticalalignment='center', + rotation='vertical', + transform=ax.transAxes) + +ax.text(left, top, 'rotated\nwith newlines', + horizontalalignment='center', + verticalalignment='center', + rotation=45, + transform=ax.transAxes) + +ax.set_axis_off() +plt.show() Modified: trunk/matplotlib/doc/sphinxext/plot_directive.py =================================================================== --- trunk/matplotlib/doc/sphinxext/plot_directive.py 2008-06-13 15:54:21 UTC (rev 5512) +++ trunk/matplotlib/doc/sphinxext/plot_directive.py 2008-06-13 17:18:41 UTC (rev 5513) @@ -13,8 +13,8 @@ source will be included inline, as well as a link to the source. """ +import sys, os, glob from docutils.parsers.rst import directives -import os.path try: # docutils 0.4 @@ -24,6 +24,14 @@ from docutils.parsers.rst.directives.images import Image align = Image.align + +import matplotlib +import IPython.Shell +matplotlib.use('Agg') +import matplotlib.pyplot as plt + +mplshell = IPython.Shell.MatplotlibShell('mpl') + options = {'alt': directives.unchanged, 'height': directives.length_or_unitless, 'width': directives.length_or_percentage_or_unitless, @@ -35,40 +43,85 @@ template_no_source = """ .. htmlonly:: - .. image:: %(reference)s.png - :target: %(reference)s.hires.png + .. image:: ../%(srcdir)s/%(basename)s.png %(options)s + `[%(basename)s source py] `[%(basename)s highres png] <../%(srcdir)s/%(basename)s.hires.png>`_ `[%(basename)s pdf] <../%(srcdir)s/%(basename)s.pdf>`_ + .. latexonly:: - .. image:: %(reference)s.pdf + .. image:: ../%(srcdir)s/%(basename)s.pdf %(options)s """ template_source = """ -.. literalinclude:: %(reference)s.py +.. literalinclude:: ../pyplots/%(reference)s .. htmlonly:: - .. image:: %(reference)s.png - :target: %(reference)s.hires.png + .. image:: ../%(srcdir)s/%(basename)s.png %(options)s - `[%(basename)s.py] <%(reference)s.py>`_ + `[%(basename)s source py] <../%(srcdir)s/%(reference)s>`_ `[%(basename)s highres png] <../%(srcdir)s/%(basename)s.hires.png>`_ `[%(basename)s pdf] <../%(srcdir)s/%(basename)s.pdf>`_ .. latexonly:: - .. image:: %(reference)s.pdf + .. image:: ../%(srcdir)s/%(basename)s.pdf %(options)s """ +def makefig(fullpath, outdir): + """ + run a pyplot script and save the low and high res PNGs and a PDF in _static + """ + + fullpath = str(fullpath) # todo, why is unicode breaking this + formats = [('png', 100), + ('hires.png', 200), + ('pdf', 72)] + + basedir, fname = os.path.split(fullpath) + basename, ext = os.path.splitext(fname) + all_exists = True + + for format, dpi in formats: + outname = os.path.join(outdir, '%s.%s' % (basename, format)) + if not os.path.exists(outname): + all_exists = False + break + + if all_exists: + print ' already have %s'%fullpath + return + + print ' building %s'%fullpath, type(fullpath) + plt.close('all') # we need to clear between runs + + mplshell.magic_run(fullpath) + for format, dpi in formats: + #print 'saving', outdir, basename, format + outname = os.path.join(outdir, '%s.%s' % (basename, format)) + plt.savefig(outname, dpi=dpi) + print ' all figures made' + def run(arguments, options, state_machine, lineno): + #print 'arguments', arguments + #print 'options', options + reference = directives.uri(arguments[0]) - print reference - for ext in ('.py', '.png', '.pdf'): - if reference.endswith(ext): - reference = reference[:-len(ext)] - break + basename, ext = os.path.splitext(reference) + + # todo - should we be using the _static dir for the outdir, I am + # not sure we want to corrupt that dir with autogenerated files + # since it also has permanent files in it which makes it difficult + # to clean (save an rm -rf followed by and svn up) + srcdir = 'pyplots' + + makefig(os.path.join(srcdir, reference), srcdir) + + # todo: it is not great design to assume the makefile is putting + # the figs into the right place, so we may want to do that here instead. + if options.has_key('include-source'): template = template_source del options['include-source'] @@ -77,7 +130,7 @@ options = [' :%s: %s' % (key, val) for key, val in options.items()] options = "\n".join(options) - basename = os.path.basename(reference) + lines = template % locals() lines = lines.split('\n') @@ -85,6 +138,7 @@ lines, state_machine.input_lines.source(0)) return [] + try: from docutils.parsers.rst import Directive except ImportError: Modified: trunk/matplotlib/doc/users/annotations.rst =================================================================== --- trunk/matplotlib/doc/users/annotations.rst 2008-06-13 15:54:21 UTC (rev 5512) +++ trunk/matplotlib/doc/users/annotations.rst 2008-06-13 17:18:41 UTC (rev 5513) @@ -12,7 +12,7 @@ ``xy`` and the location of the text ``xytext``. Both of these arguments are ``(x,y)`` tuples. -.. plot:: figures/annotation_basic.py +.. plot:: annotation_basic.py :include-source: :scale: 75 @@ -72,7 +72,7 @@ ``fontsize are passed from the `~matplotlib.Axes.annotate` to the ``Text`` instance -.. plot:: figures/annotation_polar.py +.. plot:: annotation_polar.py :scale: 75 :include-source: Modified: trunk/matplotlib/doc/users/artists.rst =================================================================== --- trunk/matplotlib/doc/users/artists.rst 2008-06-13 15:54:21 UTC (rev 5512) +++ trunk/matplotlib/doc/users/artists.rst 2008-06-13 17:18:41 UTC (rev 5513) @@ -135,7 +135,7 @@ Try creating the figure below. -.. plot:: figures/fig_axes_labels_simple +.. plot:: fig_axes_labels_simple.py :scale: 75 .. _customizing-artists: @@ -326,7 +326,7 @@ In [195]: fig.canvas.draw() -.. plot:: figures/fig_x +.. plot:: fig_x.py :scale: 75 @@ -604,7 +604,7 @@ Here is an example, not recommended for its beauty, which customizes the axes and tick properties -.. plot:: figures/fig_axes_customize_simple.py +.. plot:: fig_axes_customize_simple.py :scale: 75 :include-source: @@ -642,6 +642,6 @@ Here is an example which sets the formatter for the upper ticks with dollar signs and colors them green on the right side of the yaxis -.. plot:: figures/dollar_ticks.py +.. plot:: dollar_ticks.py :scale: 75 :include-source: Modified: trunk/matplotlib/doc/users/mathtext.rst =================================================================== --- trunk/matplotlib/doc/users/mathtext.rst 2008-06-13 15:54:21 UTC (rev 5512) +++ trunk/matplotlib/doc/users/mathtext.rst 2008-06-13 17:18:41 UTC (rev 5513) @@ -271,7 +271,7 @@ Here is an example illustrating many of these features in context. -.. plot:: figures/pyplot_mathtext.py +.. plot:: pyplot_mathtext.py :scale: 75 :include-source: Modified: trunk/matplotlib/doc/users/pyplot_tutorial.rst =================================================================== --- trunk/matplotlib/doc/users/pyplot_tutorial.rst 2008-06-13 15:54:21 UTC (rev 5512) +++ trunk/matplotlib/doc/users/pyplot_tutorial.rst 2008-06-13 17:18:41 UTC (rev 5513) @@ -12,7 +12,7 @@ keeps track of the current figure and plotting area, and the plotting functions are directed to the current axes -.. plot:: figures/pyplot_simple +.. plot:: pyplot_simple.py :scale: 75 :include-source: @@ -37,7 +37,7 @@ The default format string is 'b-', which is a solid blue line. For example, to plot the above with red circles, you would issue -.. plot:: figures/pyplot_formatstr.py +.. plot:: pyplot_formatstr.py :scale: 75 :include-source: @@ -54,7 +54,7 @@ plotting several lines with different format styles in one command using arrays. -.. plot:: figures/pyplot_three.py +.. plot:: pyplot_three.py :scale: 75 :include-source: @@ -160,7 +160,7 @@ to worry about this, because it is all taken care of behind the scenes. Below is an script to create two subplots. -.. plot:: figures/pyplot_two_subplots.py +.. plot:: pyplot_two_subplots.py :scale: 75 :include-source: @@ -220,7 +220,7 @@ are used tox add text in the indicated locations (see :ref:`text-intro` for a more detailed example) -.. plot:: figures/pyplot_text.py +.. plot:: pyplot_text.py :scale: 75 :include-source: @@ -265,8 +265,8 @@ two points to consider: the location being annotated represented by the argument ``xy`` and the location of the text ``xytext``. Both of these arguments are ``(x,y)`` tuples. - -.. plot:: figures/pyplot_annotate.py + +.. plot:: pyplot_annotate.py ... [truncated message content] |
From: <ds...@us...> - 2008-06-13 19:12:14
|
Revision: 5515 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5515&view=rev Author: dsdale Date: 2008-06-13 12:12:08 -0700 (Fri, 13 Jun 2008) Log Message: ----------- don't link to example scripts to generate documentation figures Modified Paths: -------------- trunk/matplotlib/doc/devel/documenting_mpl.rst trunk/matplotlib/doc/pyplots/make.py trunk/matplotlib/doc/static_figs/make.py Added Paths: ----------- trunk/matplotlib/doc/static_figs/tex_demo.py trunk/matplotlib/doc/static_figs/tex_unicode_demo.py Removed Paths: ------------- trunk/matplotlib/doc/static_figs/tex_demo.png trunk/matplotlib/doc/static_figs/tex_demo.py trunk/matplotlib/doc/static_figs/tex_unicode_demo.py Modified: trunk/matplotlib/doc/devel/documenting_mpl.rst =================================================================== --- trunk/matplotlib/doc/devel/documenting_mpl.rst 2008-06-13 17:45:22 UTC (rev 5514) +++ trunk/matplotlib/doc/devel/documenting_mpl.rst 2008-06-13 19:12:08 UTC (rev 5515) @@ -110,7 +110,7 @@ runs and produces the advertised figure. Several figures will be saved with the same basnename as the filename when the documentation is generated (low and high res PNGs, a PDF). Matplotlib includes a -Sphinx extension (file:`sphinxext/plot_directive.py`) for generating +Sphinx extension (:file:`sphinxext/plot_directive.py`) for generating the images from the python script and including either a png copy for html or a pdf for latex:: Modified: trunk/matplotlib/doc/pyplots/make.py =================================================================== --- trunk/matplotlib/doc/pyplots/make.py 2008-06-13 17:45:22 UTC (rev 5514) +++ trunk/matplotlib/doc/pyplots/make.py 2008-06-13 19:12:08 UTC (rev 5515) @@ -17,10 +17,11 @@ for fname in glob.glob('*.py'): if fname==__file__: continue basename, ext = os.path.splitext(fname) - outfiles = ['%s.%s' % (basename, format) for format, dpi in formats] + imagefiles = dict([('../_static/%s.%s'%(basename, format), dpi) + for format, dpi in formats]) all_exists = True - for format, dpi in formats: - if not os.path.exists('%s.%s' % (basename, format)): + for imagefile in imagefiles: + if not os.path.exists(imagefile): all_exists = False break @@ -30,8 +31,8 @@ print ' building %s'%fname plt.close('all') # we need to clear between runs mplshell.magic_run(basename) - for format, dpi in formats: - plt.savefig('%s.%s' % (basename, format), dpi=dpi) + for imagefile, dpi in imagefiles.iteritems(): + plt.savefig(imagefile, dpi=dpi) print 'all figures made' Modified: trunk/matplotlib/doc/static_figs/make.py =================================================================== --- trunk/matplotlib/doc/static_figs/make.py 2008-06-13 17:45:22 UTC (rev 5514) +++ trunk/matplotlib/doc/static_figs/make.py 2008-06-13 19:12:08 UTC (rev 5515) @@ -2,32 +2,43 @@ import sys, os, glob import matplotlib import IPython.Shell -matplotlib.rcdefaults() +#matplotlib.rcdefaults() matplotlib.use('Agg') mplshell = IPython.Shell.MatplotlibShell('mpl') +formats = [('png', 100), + ('hires.png', 200), + ('pdf', 72)] + def figs(): print 'making figs' import matplotlib.pyplot as plt for fname in glob.glob('*.py'): if fname.split('/')[-1] == __file__.split('/')[-1]: continue basename, ext = os.path.splitext(fname) - outfile = '../_static/%s.png'%basename + imagefiles = dict([('../_static/%s.%s'%(basename, format), dpi) + for format, dpi in formats]) + all_exists = True + for imagefile in imagefiles: + if not os.path.exists(imagefile): + all_exists = False + break - if os.path.exists(outfile): - print ' already have %s'%outfile - continue + if all_exists: + print ' already have %s'%fname else: print ' building %s'%fname - plt.close('all') # we need to clear between runs - mplshell.magic_run(basename) - plt.savefig(outfile) + plt.close('all') # we need to clear between runs + mplshell.magic_run(basename) + for imagefile, dpi in imagefiles.iteritems(): + plt.savefig(imagefile, dpi=dpi) print 'all figures made' def clean(): - patterns = ['#*', '*~', '*.png', '*pyc'] + patterns = (['#*', '*~', '*pyc'] + + ['*.%s' % format for format, dpi in formats]) for pattern in patterns: for fname in glob.glob(pattern): os.remove(fname) Deleted: trunk/matplotlib/doc/static_figs/tex_demo.png =================================================================== (Binary files differ) Deleted: trunk/matplotlib/doc/static_figs/tex_demo.py =================================================================== --- trunk/matplotlib/doc/static_figs/tex_demo.py 2008-06-13 17:45:22 UTC (rev 5514) +++ trunk/matplotlib/doc/static_figs/tex_demo.py 2008-06-13 19:12:08 UTC (rev 5515) @@ -1 +0,0 @@ -link ../mpl_examples/pylab_examples/tex_demo.py \ No newline at end of file Added: trunk/matplotlib/doc/static_figs/tex_demo.py =================================================================== --- trunk/matplotlib/doc/static_figs/tex_demo.py (rev 0) +++ trunk/matplotlib/doc/static_figs/tex_demo.py 2008-06-13 19:12:08 UTC (rev 5515) @@ -0,0 +1,19 @@ +from matplotlib import rc +from numpy import arange, cos, pi +from matplotlib.pyplot import figure, axes, plot, xlabel, ylabel, title, \ + grid, savefig, show + + +rc('text', usetex=True) +rc('font', family='serif') +figure(1, figsize=(6,4)) +ax = axes([0.1, 0.1, 0.8, 0.7]) +t = arange(0.0, 1.0+0.01, 0.01) +s = cos(2*2*pi*t)+2 +plot(t, s) + +xlabel(r'\textbf{time (s)}') +ylabel(r'\textit{voltage (mV)}',fontsize=16) +title(r"\TeX\ is Number $\displaystyle\sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}$!", + fontsize=16, color='r') +grid(True) Property changes on: trunk/matplotlib/doc/static_figs/tex_demo.py ___________________________________________________________________ Name: svn:eol-style + native Deleted: trunk/matplotlib/doc/static_figs/tex_unicode_demo.py =================================================================== --- trunk/matplotlib/doc/static_figs/tex_unicode_demo.py 2008-06-13 17:45:22 UTC (rev 5514) +++ trunk/matplotlib/doc/static_figs/tex_unicode_demo.py 2008-06-13 19:12:08 UTC (rev 5515) @@ -1 +0,0 @@ -link ../mpl_examples/pylab_examples/tex_unicode_demo.py \ No newline at end of file Added: trunk/matplotlib/doc/static_figs/tex_unicode_demo.py =================================================================== --- trunk/matplotlib/doc/static_figs/tex_unicode_demo.py (rev 0) +++ trunk/matplotlib/doc/static_figs/tex_unicode_demo.py 2008-06-13 19:12:08 UTC (rev 5515) @@ -0,0 +1,19 @@ +# -*- coding: latin-1 -*- +from matplotlib import rcParams +rcParams['text.usetex']=True +rcParams['text.latex.unicode']=True +from numpy import arange, cos, pi +from matplotlib.pyplot import figure, axes, plot, xlabel, ylabel, title, \ + grid, savefig, show + +figure(1, figsize=(6,4)) +ax = axes([0.1, 0.1, 0.8, 0.7]) +t = arange(0.0, 1.0+0.01, 0.01) +s = cos(2*2*pi*t)+2 +plot(t, s) + +xlabel(r'\textbf{time (s)}') +ylabel(unicode(r'\textit{Velocity (\xB0/sec)}','latin-1'),fontsize=16) +title(r"\TeX\ is Number $\displaystyle\sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}$!", + fontsize=16, color='r') +grid(True) Property changes on: trunk/matplotlib/doc/static_figs/tex_unicode_demo.py ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ds...@us...> - 2008-06-13 19:12:44
|
Revision: 5516 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5516&view=rev Author: dsdale Date: 2008-06-13 12:12:40 -0700 (Fri, 13 Jun 2008) Log Message: ----------- remove a stray print statement from plot_directive Modified Paths: -------------- trunk/matplotlib/doc/_static/tex_unicode_demo.png trunk/matplotlib/doc/sphinxext/plot_directive.py Modified: trunk/matplotlib/doc/_static/tex_unicode_demo.png =================================================================== (Binary files differ) Modified: trunk/matplotlib/doc/sphinxext/plot_directive.py =================================================================== --- trunk/matplotlib/doc/sphinxext/plot_directive.py 2008-06-13 19:12:08 UTC (rev 5515) +++ trunk/matplotlib/doc/sphinxext/plot_directive.py 2008-06-13 19:12:40 UTC (rev 5516) @@ -98,7 +98,7 @@ print ' already have %s'%fullpath return - print ' building %s'%fullpath, type(fullpath) + print ' building %s'%fullpath plt.close('all') # we need to clear between runs mplshell.magic_run(fullpath) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2008-06-13 19:23:24
|
Revision: 5518 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5518&view=rev Author: jdh2358 Date: 2008-06-13 12:23:21 -0700 (Fri, 13 Jun 2008) Log Message: ----------- updates to rc and scaling for docs to get nice sizes for html and pdf Modified Paths: -------------- trunk/matplotlib/doc/devel/documenting_mpl.rst trunk/matplotlib/doc/matplotlibrc trunk/matplotlib/doc/sphinxext/plot_directive.py trunk/matplotlib/doc/users/annotations.rst trunk/matplotlib/doc/users/artists.rst trunk/matplotlib/doc/users/mathtext.rst trunk/matplotlib/doc/users/navigation_toolbar.rst trunk/matplotlib/doc/users/pyplot_tutorial.rst trunk/matplotlib/doc/users/text_intro.rst trunk/matplotlib/doc/users/text_props.rst Modified: trunk/matplotlib/doc/devel/documenting_mpl.rst =================================================================== --- trunk/matplotlib/doc/devel/documenting_mpl.rst 2008-06-13 19:13:50 UTC (rev 5517) +++ trunk/matplotlib/doc/devel/documenting_mpl.rst 2008-06-13 19:23:21 UTC (rev 5518) @@ -115,12 +115,13 @@ html or a pdf for latex:: .. plot:: pyplot_simple.py - :scale: 75 :include-source: -The ``:scale:`` directive rescales the image to some percentage of the original -size. ``:include-source:`` will present the contents of the file, marked up as -source code. +The ``:scale:`` directive rescales the image to some percentage of the +original size, though we don't recommend using this in most cases +since it is probably better to choose the correct figure size and dpi +in mpl and let it handle the scaling. ``:include-source:`` will +present the contents of the file, marked up as source code. Static figures -------------- Modified: trunk/matplotlib/doc/matplotlibrc =================================================================== --- trunk/matplotlib/doc/matplotlibrc 2008-06-13 19:13:50 UTC (rev 5517) +++ trunk/matplotlib/doc/matplotlibrc 2008-06-13 19:23:21 UTC (rev 5518) @@ -233,7 +233,7 @@ ### FIGURE # See http://matplotlib.sourceforge.net/matplotlib.figure.html#Figure -#figure.figsize : 8, 6 # figure size in inches +figure.figsize : 6, 4 # figure size in inches #figure.dpi : 80 # figure dots per inch #figure.facecolor : 0.75 # figure facecolor; 0.75 is scalar gray #figure.edgecolor : white # figure edgecolor Modified: trunk/matplotlib/doc/sphinxext/plot_directive.py =================================================================== --- trunk/matplotlib/doc/sphinxext/plot_directive.py 2008-06-13 19:13:50 UTC (rev 5517) +++ trunk/matplotlib/doc/sphinxext/plot_directive.py 2008-06-13 19:23:21 UTC (rev 5518) @@ -43,12 +43,13 @@ template_no_source = """ .. htmlonly:: + [ `<../%(srcdir)s/%(reference)s>`__, + `png <../%(srcdir)s/%(basename)s.hires.png>`__, + `pdf <../%(srcdir)s/%(basename)s.pdf>`__ ] + .. image:: ../%(srcdir)s/%(basename)s.png %(options)s - `[%(basename)s source py] <../%(srcdir)s/%(reference)s>`_ - `[%(basename)s highres png] <../%(srcdir)s/%(basename)s.hires.png>`_ - `[%(basename)s pdf] <../%(srcdir)s/%(basename)s.pdf>`_ .. latexonly:: .. image:: ../%(srcdir)s/%(basename)s.pdf @@ -61,13 +62,13 @@ .. htmlonly:: + [ `py <../%(srcdir)s/%(reference)s>`__, + `png <../%(srcdir)s/%(basename)s.hires.png>`__, + `pdf <../%(srcdir)s/%(basename)s.pdf>`__ ] + .. image:: ../%(srcdir)s/%(basename)s.png %(options)s - `[%(basename)s source py] <../%(srcdir)s/%(reference)s>`_ - `[%(basename)s highres png] <../%(srcdir)s/%(basename)s.hires.png>`_ - `[%(basename)s pdf] <../%(srcdir)s/%(basename)s.pdf>`_ - .. latexonly:: .. image:: ../%(srcdir)s/%(basename)s.pdf %(options)s @@ -103,15 +104,11 @@ mplshell.magic_run(fullpath) for format, dpi in formats: - #print 'saving', outdir, basename, format outname = os.path.join(outdir, '%s.%s' % (basename, format)) plt.savefig(outname, dpi=dpi) print ' all figures made' def run(arguments, options, state_machine, lineno): - #print 'arguments', arguments - #print 'options', options - reference = directives.uri(arguments[0]) basename, ext = os.path.splitext(reference) Modified: trunk/matplotlib/doc/users/annotations.rst =================================================================== --- trunk/matplotlib/doc/users/annotations.rst 2008-06-13 19:13:50 UTC (rev 5517) +++ trunk/matplotlib/doc/users/annotations.rst 2008-06-13 19:23:21 UTC (rev 5518) @@ -14,8 +14,8 @@ .. plot:: annotation_basic.py :include-source: - :scale: 75 + In this example, both the ``xy`` (arrow tip) and ``xytext`` locations (text location) are in data coordinates. There are a variety of other coordinate systems one can choose -- you can specify the coordinate @@ -73,7 +73,6 @@ ``Text`` instance .. plot:: annotation_polar.py - :scale: 75 :include-source: See the `annotations demo Modified: trunk/matplotlib/doc/users/artists.rst =================================================================== --- trunk/matplotlib/doc/users/artists.rst 2008-06-13 19:13:50 UTC (rev 5517) +++ trunk/matplotlib/doc/users/artists.rst 2008-06-13 19:23:21 UTC (rev 5518) @@ -136,7 +136,6 @@ Try creating the figure below. .. plot:: fig_axes_labels_simple.py - :scale: 75 .. _customizing-artists: @@ -327,7 +326,6 @@ In [195]: fig.canvas.draw() .. plot:: fig_x.py - :scale: 75 Here is a summary of the Artists the figure contains @@ -605,7 +603,6 @@ the axes and tick properties .. plot:: fig_axes_customize_simple.py - :scale: 75 :include-source: @@ -643,5 +640,4 @@ dollar signs and colors them green on the right side of the yaxis .. plot:: dollar_ticks.py - :scale: 75 :include-source: Modified: trunk/matplotlib/doc/users/mathtext.rst =================================================================== --- trunk/matplotlib/doc/users/mathtext.rst 2008-06-13 19:13:50 UTC (rev 5517) +++ trunk/matplotlib/doc/users/mathtext.rst 2008-06-13 19:23:21 UTC (rev 5518) @@ -272,7 +272,6 @@ Here is an example illustrating many of these features in context. .. plot:: pyplot_mathtext.py - :scale: 75 :include-source: Modified: trunk/matplotlib/doc/users/navigation_toolbar.rst =================================================================== --- trunk/matplotlib/doc/users/navigation_toolbar.rst 2008-06-13 19:13:50 UTC (rev 5517) +++ trunk/matplotlib/doc/users/navigation_toolbar.rst 2008-06-13 19:23:21 UTC (rev 5518) @@ -4,20 +4,16 @@ ====================== .. image:: ../_static/toolbar.png - :scale: 100 All figure windows come with a navigation toolbar, which can be used to navigate through the data set. Here is a description of each of the buttons at the bottom of the toolbar .. image:: ../mpl_data/images/home.png - :scale: 100 .. image:: ../mpl_data/images/back.png - :scale: 100 .. image:: ../mpl_data/images/forward.png - :scale: 100 The ``Forward`` and ``Back`` buttons These are akin to the web browser forward and back buttons. They @@ -31,7 +27,6 @@ the pan and zoom to rectangle to define new views. .. image:: ../mpl_data/images/move.png - :scale: 100 The ``Pan/Zoom`` button This button has two modes: pan and zoom. Click the toolbar button @@ -56,7 +51,6 @@ right mouse button. .. image:: ../mpl_data/images/zoom_to_rect.png - :scale: 100 The ``Zoom-to-rectangle`` button Click this toolbar button to activate this mode. Put your mouse @@ -68,7 +62,6 @@ region defined by the zoom out rectangle. .. image:: ../mpl_data/images/subplots.png - :scale: 100 The ``Subplot-configuration`` button Use this tool to configure the parameters of the subplot: the @@ -76,7 +69,6 @@ the columns. .. image:: ../mpl_data/images/filesave.png - :scale: 100 The ``Save`` button Click this button to launch a file save dialog. You can save Modified: trunk/matplotlib/doc/users/pyplot_tutorial.rst =================================================================== --- trunk/matplotlib/doc/users/pyplot_tutorial.rst 2008-06-13 19:13:50 UTC (rev 5517) +++ trunk/matplotlib/doc/users/pyplot_tutorial.rst 2008-06-13 19:23:21 UTC (rev 5518) @@ -13,7 +13,6 @@ functions are directed to the current axes .. plot:: pyplot_simple.py - :scale: 75 :include-source: You may be wondering why the x-axis ranges from 0-3 and the y-axis @@ -38,7 +37,6 @@ example, to plot the above with red circles, you would issue .. plot:: pyplot_formatstr.py - :scale: 75 :include-source: See the :func:`~matplotlib.pyplot.plot` documentation for a complete @@ -55,7 +53,6 @@ using arrays. .. plot:: pyplot_three.py - :scale: 75 :include-source: .. _controlling-line-properties: @@ -161,7 +158,6 @@ scenes. Below is an script to create two subplots. .. plot:: pyplot_two_subplots.py - :scale: 75 :include-source: The :func:`~matplotlib.pyplot.figure` command here is optional because @@ -221,9 +217,9 @@ for a more detailed example) .. plot:: pyplot_text.py - :scale: 75 :include-source: + All of the :func:`~matplotlib.pyplot.text` commands return an :class:`matplotlib.text.Text` instance. Just as with with lines above, you can customize the properties by passing keyword arguments @@ -265,9 +261,8 @@ two points to consider: the location being annotated represented by the argument ``xy`` and the location of the text ``xytext``. Both of these arguments are ``(x,y)`` tuples. - + .. plot:: pyplot_annotate.py - :scale: 75 :include-source: In this basic example, both the ``xy`` (arrow tip) and ``xytext`` Modified: trunk/matplotlib/doc/users/text_intro.rst =================================================================== --- trunk/matplotlib/doc/users/text_intro.rst 2008-06-13 19:13:50 UTC (rev 5517) +++ trunk/matplotlib/doc/users/text_intro.rst 2008-06-13 19:23:21 UTC (rev 5518) @@ -56,5 +56,4 @@ these commands in action. .. plot:: text_commands.py - :scale: 75 :include-source: Modified: trunk/matplotlib/doc/users/text_props.rst =================================================================== --- trunk/matplotlib/doc/users/text_props.rst 2008-06-13 19:13:50 UTC (rev 5517) +++ trunk/matplotlib/doc/users/text_props.rst 2008-06-13 19:23:21 UTC (rev 5518) @@ -58,5 +58,4 @@ upper right. .. plot:: text_layout.py - :scale: 75 :include-source: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ds...@us...> - 2008-06-13 21:28:03
|
Revision: 5525 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5525&view=rev Author: dsdale Date: 2008-06-13 14:27:56 -0700 (Fri, 13 Jun 2008) Log Message: ----------- minor formatting changes in documentation Modified Paths: -------------- trunk/matplotlib/doc/api/matplotlib_configuration_api.rst trunk/matplotlib/doc/api/pyplot_api.rst trunk/matplotlib/doc/users/pyplot_tutorial.rst Modified: trunk/matplotlib/doc/api/matplotlib_configuration_api.rst =================================================================== --- trunk/matplotlib/doc/api/matplotlib_configuration_api.rst 2008-06-13 20:54:18 UTC (rev 5524) +++ trunk/matplotlib/doc/api/matplotlib_configuration_api.rst 2008-06-13 21:27:56 UTC (rev 5525) @@ -17,7 +17,7 @@ :mod:`matplotlib.rcsetup` -============================= +========================= .. automodule:: matplotlib.rcsetup :members: Modified: trunk/matplotlib/doc/api/pyplot_api.rst =================================================================== --- trunk/matplotlib/doc/api/pyplot_api.rst 2008-06-13 20:54:18 UTC (rev 5524) +++ trunk/matplotlib/doc/api/pyplot_api.rst 2008-06-13 21:27:56 UTC (rev 5525) @@ -4,7 +4,7 @@ :mod:`matplotlib.pyplot` -============================= +======================== .. automodule:: matplotlib.pyplot :members: Modified: trunk/matplotlib/doc/users/pyplot_tutorial.rst =================================================================== --- trunk/matplotlib/doc/users/pyplot_tutorial.rst 2008-06-13 20:54:18 UTC (rev 5524) +++ trunk/matplotlib/doc/users/pyplot_tutorial.rst 2008-06-13 21:27:56 UTC (rev 5525) @@ -213,7 +213,7 @@ The :func:`~matplotlib.pyplot.text` command can be used to add text in an arbitrary location, and the :func:`~matplotlib.pyplot.xlabel`, :func:`~matplotlib.pyplot.ylabel` and :func:`~matplotlib.pyplot.title` -are used tox add text in the indicated locations (see :ref:`text-intro` +are used to add text in the indicated locations (see :ref:`text-intro` for a more detailed example) .. plot:: pyplot_text.py This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ds...@us...> - 2008-06-13 22:05:51
|
Revision: 5527 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5527&view=rev Author: dsdale Date: 2008-06-13 15:05:27 -0700 (Fri, 13 Jun 2008) Log Message: ----------- use htmlonly directive to cleanup a few items in the pdf document: link to pdf download release, date and comment at beginning of each part which was poorly formatted and somewhat redundant in the pdf document Modified Paths: -------------- trunk/matplotlib/doc/api/index.rst trunk/matplotlib/doc/conf.py trunk/matplotlib/doc/devel/index.rst trunk/matplotlib/doc/faq/index.rst trunk/matplotlib/doc/index.rst trunk/matplotlib/doc/users/index.rst Modified: trunk/matplotlib/doc/api/index.rst =================================================================== --- trunk/matplotlib/doc/api/index.rst 2008-06-13 21:34:10 UTC (rev 5526) +++ trunk/matplotlib/doc/api/index.rst 2008-06-13 22:05:27 UTC (rev 5527) @@ -4,9 +4,11 @@ The Matplotlib API #################### -:Release: |version| -:Date: |today| +.. htmlonly:: + :Release: |version| + :Date: |today| + .. toctree:: matplotlib_configuration_api.rst Modified: trunk/matplotlib/doc/conf.py =================================================================== --- trunk/matplotlib/doc/conf.py 2008-06-13 21:34:10 UTC (rev 5526) +++ trunk/matplotlib/doc/conf.py 2008-06-13 22:05:27 UTC (rev 5527) @@ -49,7 +49,7 @@ # The short X.Y version. version = '0.98' # The full version, including alpha/beta/rc tags. -release = '0.98pre' +release = '0.98' # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: Modified: trunk/matplotlib/doc/devel/index.rst =================================================================== --- trunk/matplotlib/doc/devel/index.rst 2008-06-13 21:34:10 UTC (rev 5526) +++ trunk/matplotlib/doc/devel/index.rst 2008-06-13 22:05:27 UTC (rev 5527) @@ -4,9 +4,11 @@ The Matplotlib Developers's Guide ################################### -:Release: |version| -:Date: |today| +.. htmlonly:: + :Release: |version| + :Date: |today| + .. toctree:: :maxdepth: 2 Modified: trunk/matplotlib/doc/faq/index.rst =================================================================== --- trunk/matplotlib/doc/faq/index.rst 2008-06-13 21:34:10 UTC (rev 5526) +++ trunk/matplotlib/doc/faq/index.rst 2008-06-13 22:05:27 UTC (rev 5527) @@ -4,11 +4,13 @@ The Matplotlib FAQ #################### -:Release: |version| -:Date: |today| +.. htmlonly:: -Frequently asked questions about matplotlib + :Release: |version| + :Date: |today| + Frequently asked questions about matplotlib + .. toctree:: :maxdepth: 2 Modified: trunk/matplotlib/doc/index.rst =================================================================== --- trunk/matplotlib/doc/index.rst 2008-06-13 21:34:10 UTC (rev 5526) +++ trunk/matplotlib/doc/index.rst 2008-06-13 22:05:27 UTC (rev 5527) @@ -5,10 +5,13 @@ Welcome to matplotlib's documentation! ====================================== -Download `PDF <http://matplotlib.sf.net/doc/Matplotlib.pdf>`_ +.. htmlonly:: -Contents: + :Release: |version| + :Date: |today| + Download `PDF <http://matplotlib.sf.net/doc/Matplotlib.pdf>`_ + .. toctree:: :maxdepth: 2 Modified: trunk/matplotlib/doc/users/index.rst =================================================================== --- trunk/matplotlib/doc/users/index.rst 2008-06-13 21:34:10 UTC (rev 5526) +++ trunk/matplotlib/doc/users/index.rst 2008-06-13 22:05:27 UTC (rev 5527) @@ -4,9 +4,11 @@ The Matplotlib User's Guide ############################# -:Release: |version| -:Date: |today| +.. htmlonly:: + :Release: |version| + :Date: |today| + .. toctree:: :maxdepth: 2 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ds...@us...> - 2008-06-14 13:21:22
|
Revision: 5536 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5536&view=rev Author: dsdale Date: 2008-06-14 06:21:19 -0700 (Sat, 14 Jun 2008) Log Message: ----------- added a glossary to the docs Modified Paths: -------------- trunk/matplotlib/doc/index.rst Added Paths: ----------- trunk/matplotlib/doc/glossary/ trunk/matplotlib/doc/glossary/index.rst Added: trunk/matplotlib/doc/glossary/index.rst =================================================================== --- trunk/matplotlib/doc/glossary/index.rst (rev 0) +++ trunk/matplotlib/doc/glossary/index.rst 2008-06-14 13:21:19 UTC (rev 5536) @@ -0,0 +1,20 @@ +######## +Glossary +######## + +.. glossary:: + + raster graphics + Raster graphics, or bitmaps, represent an image as an array of pixels + which is resolution dependent. Raster graphics are generally most + practical for photo-realistic images, but do not easily without loss of + quality. + + vector graphics + The use of geometrical primitives based upon mathematical equations to + represent images in computer graphics. Primitives can include points, + lines, curves, and shapes or polygons. Vector graphics are scalable, + which means that they can be resized without suffering from issues + related to inherent resolution like are seen in raster graphics. Vector + graphics are generally most practical for typesetting and graphic design + applications. \ No newline at end of file Modified: trunk/matplotlib/doc/index.rst =================================================================== --- trunk/matplotlib/doc/index.rst 2008-06-14 12:32:49 UTC (rev 5535) +++ trunk/matplotlib/doc/index.rst 2008-06-14 13:21:19 UTC (rev 5536) @@ -1,7 +1,5 @@ -.. matplotlib documentation master file, created by sphinx-quickstart on Sat May 24 15:37:00 2008. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. + Welcome to matplotlib's documentation! ====================================== @@ -19,16 +17,10 @@ faq/index.rst devel/index.rst api/index.rst + glossary/index.rst -Indices and tables -================== +.. htmlonly:: -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` - - -.. _ipython: http://ipython.scipy.org -.. _numpy: http://numpy.scipy.org -.. _scipy: http://scipy.org -.. _vtk: http://www.vtk.org + * :ref:`genindex` + * :ref:`modindex` + * :ref:`search` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ds...@us...> - 2008-06-14 13:40:07
|
Revision: 5537 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5537&view=rev Author: dsdale Date: 2008-06-14 06:40:01 -0700 (Sat, 14 Jun 2008) Log Message: ----------- updates to installation faq and glossary Modified Paths: -------------- trunk/matplotlib/doc/faq/installing_faq.rst trunk/matplotlib/doc/glossary/index.rst Modified: trunk/matplotlib/doc/faq/installing_faq.rst =================================================================== --- trunk/matplotlib/doc/faq/installing_faq.rst 2008-06-14 13:21:19 UTC (rev 5536) +++ trunk/matplotlib/doc/faq/installing_faq.rst 2008-06-14 13:40:01 UTC (rev 5537) @@ -113,34 +113,47 @@ Here is a summary of the matplotlib renderers (there is an eponymous backed for each): -=============================== ===================================================================================== -Renderer (Filetypes) Description -=============================== ===================================================================================== -Agg (png) raster - high quality images using the `antigrain <http://antigrain.html>`_ engine -PS (ps, eps) vector - postscript output -PDF (pdf) vector - portable document format -SVG (svg) vector - scalar vector graphics -Cairo (png, ps, pdf, svn, ...) vector - `cairo graphics <http://cairographics.org>`_ -GDK (png, jpg, tiff..) raster - the GDK drawing API for GTK -=============================== ===================================================================================== +======== ====================== ====================================================================================== +Renderer Filetypes Description +======== ====================== ====================================================================================== +AGG png :term:`raster graphics` -- high quality images using the `Anti-Grain Geometry`_ engine +PS ps, eps :term:`vector graphics` -- Postscript_ output +PDF pdf :term:`vector graphics` -- `Portable Document Format`_ +SVG svg :term:`vector graphics` -- `Scalable Vector Graphics`_ +Cairo png, ps, pdf, svn, ... :term:`vector graphics` -- `Cairo graphics`_ +GDK png, jpg, tiff, ... :term:`raster graphics` -- the `Gimp Drawing Kit`_ for GTK +======== ====================== ====================================================================================== And here are the user interfaces and renderer combinations supported: -============ =================================================================================================== +============ ===================================================================================== Backend Description -============ =================================================================================================== -GTKAgg Agg rendering to a GTK canvas (`pygtk <http://www.pygtk.org>`_) -GTK GDK rendering to a GTK canvas (not recommended) (`pygtk <http://www.pygtk.org>`_) -GTKCairo Cairo rendering to a GTK Canvas (`pygtk <http://www.pygtk.org>`_) -WXAgg Agg rendering to to a WX canvas (`wxpython <http://www.wxpython.org>`_) -WX Native WX drawing to a WX Canvas (not recommended) (`wxpython <http://www.wxpython.org>`_) -TkAgg Agg rendering to a Tkinter canvas (`tkinter <http://wiki.python.org/moin/TkInter>`_) -QtAgg Agg rendering to a Qt canvas (`pyqt <http://www.riverbankcomputing.co.uk/software/pyqt/intro>`_) -Qt4Agg Agg rendering to a Qt4 canvas (`pyqt <http://www.riverbankcomputing.co.uk/software/pyqt/intro>`_) -FLTKAgg Agg rendering to a FLTK canvas (`pyfltk <http://pyfltk.sourceforge.net>`_) -============ =================================================================================================== +============ ===================================================================================== +GTKAgg Agg rendering to a GTK canvas (requires PyGTK_) +GTK GDK rendering to a GTK canvas (not recommended) (requires PyGTK_) +GTKCairo Cairo rendering to a GTK Canvas (requires PyGTK_) +WXAgg Agg rendering to to a wxWidgets canvas (requires wxPython_) +WX Native wxWidgets drawing to a wxWidgets Canvas (not recommended) (requires wxPython_) +TkAgg Agg rendering to a Tk canvas (requires TkInter_) +QtAgg Agg rendering to a Qt canvas (requires PyQt_) +Qt4Agg Agg rendering to a Qt4 canvas (requires PyQt4_) +FLTKAgg Agg rendering to a FLTK canvas (requires pyFLTK_) +============ ===================================================================================== +.. _`Anti-Grain Geometry`: http://www.antigrain.com/ +.. _Postscript: http://en.wikipedia.org/wiki/PostScript +.. _`Portable Document Format`: http://en.wikipedia.org/wiki/Portable_Document_Format +.. _`Scalable Vector Graphics`: http://en.wikipedia.org/wiki/Scalable_Vector_Graphics +.. _`Cairo graphics`: http://en.wikipedia.org/wiki/Cairo_(graphics) +.. _`Gimp Drawing Kit`: http://en.wikipedia.org/wiki/GDK +.. _PyGTK: http://www.pygtk.org +.. _wxPython: http://www.wxpython.org/ +.. _TkInter: http://wiki.python.org/moin/TkInter +.. _PyQt: http://www.riverbankcomputing.co.uk/software/pyqt/intro +.. _PyQt4: http://www.riverbankcomputing.co.uk/software/pyqt/intro +.. _pyFLTK: http://pyfltk.sourceforge.net + OS-X questions ============== Modified: trunk/matplotlib/doc/glossary/index.rst =================================================================== --- trunk/matplotlib/doc/glossary/index.rst 2008-06-14 13:21:19 UTC (rev 5536) +++ trunk/matplotlib/doc/glossary/index.rst 2008-06-14 13:40:01 UTC (rev 5537) @@ -7,8 +7,8 @@ raster graphics Raster graphics, or bitmaps, represent an image as an array of pixels which is resolution dependent. Raster graphics are generally most - practical for photo-realistic images, but do not easily without loss of - quality. + practical for photo-realistic images, but do not scale easily without + loss of quality. vector graphics The use of geometrical primitives based upon mathematical equations to This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ds...@us...> - 2008-06-14 14:59:11
|
Revision: 5540 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5540&view=rev Author: dsdale Date: 2008-06-14 07:59:09 -0700 (Sat, 14 Jun 2008) Log Message: ----------- remove gtk backends from API reference for now fixed a broken link in installation faq Modified Paths: -------------- trunk/matplotlib/doc/api/backend_gtkagg_api.rst trunk/matplotlib/doc/faq/installing_faq.rst Modified: trunk/matplotlib/doc/api/backend_gtkagg_api.rst =================================================================== --- trunk/matplotlib/doc/api/backend_gtkagg_api.rst 2008-06-14 14:32:13 UTC (rev 5539) +++ trunk/matplotlib/doc/api/backend_gtkagg_api.rst 2008-06-14 14:59:09 UTC (rev 5540) @@ -2,6 +2,9 @@ :mod:`matplotlib.backends.backend_gtkagg` ========================================= -.. automodule:: matplotlib.backends.backend_gtkagg - :members: - :undoc-members: \ No newline at end of file +**TODO** We'll add this later, importing the gtk backends requires an active +X-session, which is not compatible with cron jobs. + +.. .. automodule:: matplotlib.backends.backend_gtkagg +.. :members: +.. :undoc-members: \ No newline at end of file Modified: trunk/matplotlib/doc/faq/installing_faq.rst =================================================================== --- trunk/matplotlib/doc/faq/installing_faq.rst 2008-06-14 14:32:13 UTC (rev 5539) +++ trunk/matplotlib/doc/faq/installing_faq.rst 2008-06-14 14:59:09 UTC (rev 5540) @@ -196,14 +196,14 @@ How do I compile matplotlib with PyGTK-2.4? ------------------------------------------- -There is a `bug <pygtk-2.4-bug>`_ in PyGTK-2.4. You need to edit +There is a `bug in PyGTK-2.4`_. You need to edit :file:`pygobject.h` to add the :cmacro:`G_BEGIN_DECLS` and :cmacro:`G_END_DECLS` macros, and rename :cdata:`typename` parameter to :cdata:`typename_`:: - const char *typename, + const char *typename_, -.. _`bug <pygtk-2.4-bug>`: http://bugzilla.gnome.org/show_bug.cgi?id=155304 +.. _`bug in PyGTK-2.4`: http://bugzilla.gnome.org/show_bug.cgi?id=155304 OS-X questions This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ds...@us...> - 2008-06-14 16:07:31
|
Revision: 5541 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5541&view=rev Author: dsdale Date: 2008-06-14 09:07:24 -0700 (Sat, 14 Jun 2008) Log Message: ----------- updated installation faq, added to glossary Modified Paths: -------------- trunk/matplotlib/doc/faq/installing_faq.rst trunk/matplotlib/doc/glossary/index.rst Modified: trunk/matplotlib/doc/faq/installing_faq.rst =================================================================== --- trunk/matplotlib/doc/faq/installing_faq.rst 2008-06-14 14:59:09 UTC (rev 5540) +++ trunk/matplotlib/doc/faq/installing_faq.rst 2008-06-14 16:07:24 UTC (rev 5541) @@ -150,32 +150,46 @@ Here is a summary of the matplotlib renderers (there is an eponymous backed for each): -======== ====================== ====================================================================================== -Renderer Filetypes Description -======== ====================== ====================================================================================== -AGG png :term:`raster graphics` -- high quality images using the `Anti-Grain Geometry`_ engine -PS ps, eps :term:`vector graphics` -- Postscript_ output -PDF pdf :term:`vector graphics` -- `Portable Document Format`_ -SVG svg :term:`vector graphics` -- `Scalable Vector Graphics`_ -Cairo png, ps, pdf, svn, ... :term:`vector graphics` -- `Cairo graphics`_ -GDK png, jpg, tiff, ... :term:`raster graphics` -- the `Gimp Drawing Kit`_ for GTK -======== ====================== ====================================================================================== +============= ============ ================================================ +Renderer Filetypes Description +============= ============ ================================================ +:term:`AGG` :term:`png` :term:`raster graphics` -- high quality images + using the `Anti-Grain Geometry`_ engine +PS :term:`ps` :term:`vector graphics` -- Postscript_ output + :term:`eps` +PDF :term:`pdf` :term:`vector graphics` -- + `Portable Document Format`_ +SVG :term:`svg` :term:`vector graphics` -- + `Scalable Vector Graphics`_ +:term:`Cairo` :term:`png` :term:`vector graphics` -- + :term:`ps` `Cairo graphics`_ + :term:`pdf` + :term:`svg` + ... +:term:`GDK` :term:`png` :term:`raster graphics` -- + :term:`jpg` the `Gimp Drawing Kit`_ + :term:`tiff` + ... +============= ============ ================================================ And here are the user interfaces and renderer combinations supported: -============ ===================================================================================== +============ ================================================================ Backend Description -============ ===================================================================================== -GTKAgg Agg rendering to a GTK canvas (requires PyGTK_) -GTK GDK rendering to a GTK canvas (not recommended) (requires PyGTK_) -GTKCairo Cairo rendering to a GTK Canvas (requires PyGTK_) -WXAgg Agg rendering to to a wxWidgets canvas (requires wxPython_) -WX Native wxWidgets drawing to a wxWidgets Canvas (not recommended) (requires wxPython_) -TkAgg Agg rendering to a Tk canvas (requires TkInter_) -QtAgg Agg rendering to a Qt canvas (requires PyQt_) -Qt4Agg Agg rendering to a Qt4 canvas (requires PyQt4_) -FLTKAgg Agg rendering to a FLTK canvas (requires pyFLTK_) -============ ===================================================================================== +============ ================================================================ +GTKAgg Agg rendering to a :term:`GTK` canvas (requires PyGTK_) +GTK GDK rendering to a :term:`GTK` canvas (not recommended) + (requires PyGTK_) +GTKCairo Cairo rendering to a :term:`GTK` Canvas (requires PyGTK_) +WXAgg Agg rendering to to a :term:`wxWidgets` canvas + (requires wxPython_) +WX Native :term:`wxWidgets` drawing to a :term:`wxWidgets` Canvas + (not recommended) (requires wxPython_) +TkAgg Agg rendering to a :term:`Tk` canvas (requires TkInter_) +QtAgg Agg rendering to a :term:`Qt` canvas (requires PyQt_) +Qt4Agg Agg rendering to a :term:`Qt4` canvas (requires PyQt4_) +FLTKAgg Agg rendering to a :term:`FLTK` canvas (requires pyFLTK_) +============ ================================================================ .. _`Anti-Grain Geometry`: http://www.antigrain.com/ .. _Postscript: http://en.wikipedia.org/wiki/PostScript Modified: trunk/matplotlib/doc/glossary/index.rst =================================================================== --- trunk/matplotlib/doc/glossary/index.rst 2008-06-14 14:59:09 UTC (rev 5540) +++ trunk/matplotlib/doc/glossary/index.rst 2008-06-14 16:07:24 UTC (rev 5541) @@ -4,12 +4,69 @@ .. glossary:: + AGG + The Anti-Grain Geometry rendering engine, capable of rendering + high-quality images. + + Cairo + The Cairo graphics engine + + EPS + Encapsulated Postscript + + FLTK + FLTK (pronounced "fulltick") is a cross-platform C++ GUI toolkit for + UNIX/Linux (X11), Microsoft Windows, and MacOS X + + GDK + The Gimp Drawing Kit for GTK+ + + GTK + The GTK graphical user interface library + + JPG + A compression method and file format for photographic images + + PDF + Adobe's Portable Document Format + + PNG + PNG stands for Portable Network Graphics, a raster graphics format that + employs lossless data compression which is more suitable for line art + than the lossy jpg format. Unlike the gif format, png is not encumbered + by requirements for a patent license. + + PS + Postscript + + Qt + Qt is a cross-platform application framework for desktop and embedded + development. + + Qt4 + Qt4 is the most recent version of Qt cross-platform application framework + for desktop and embedded development. + raster graphics Raster graphics, or bitmaps, represent an image as an array of pixels which is resolution dependent. Raster graphics are generally most practical for photo-realistic images, but do not scale easily without loss of quality. + SVG + The Scalable Vector Graphics format. + + TIFF + Tagged Image File Format + + Tk + Tk is a graphical user interface for Tcl and many other dynamic + languages. It can produce rich, native applications that run unchanged + across Windows, Mac OS X, Linux and more. + + wxWidgets + A cross-platform GUI and tools library for GTK, MS Windows, and MacOS. + vector graphics The use of geometrical primitives based upon mathematical equations to represent images in computer graphics. Primitives can include points, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ds...@us...> - 2008-06-15 15:30:38
|
Revision: 5548 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5548&view=rev Author: dsdale Date: 2008-06-15 08:29:57 -0700 (Sun, 15 Jun 2008) Log Message: ----------- Expanded on documentation guidelines Modified Paths: -------------- trunk/matplotlib/doc/devel/documenting_mpl.rst trunk/matplotlib/doc/glossary/index.rst Modified: trunk/matplotlib/doc/devel/documenting_mpl.rst =================================================================== --- trunk/matplotlib/doc/devel/documenting_mpl.rst 2008-06-15 12:08:13 UTC (rev 5547) +++ trunk/matplotlib/doc/devel/documenting_mpl.rst 2008-06-15 15:29:57 UTC (rev 5548) @@ -33,6 +33,7 @@ The output produced by Sphinx can be configured by editing the `conf.py` file located in the `doc/`. + Organization of matplotlib's documentation ========================================== @@ -50,6 +51,7 @@ .. include:: ../../TODO + Formatting ========== @@ -61,6 +63,20 @@ other semantic markup. For example, when referring to external files, use the ``:file:`` directive. +* Function arguments and keywords should be referred to using the *emphasis* + role. This will keep matplotlib's documentation consistant with Python's + documentation:: + + Here is a description of *argument* + + Please do not use the `default role`:: + + Please do not describe `argument` like this. + + nor the ``literal`` role:: + + Please do not describe ``argument`` like this. + * Sphinx does not support tables with column- or row-spanning cells for latex output. Such tables can not be used when documenting matplotlib. @@ -92,10 +108,96 @@ In [69]: lines = plot([1,2,3]) +* Footnotes [#]_ can be added using ``[#]_``, followed later by:: + + .. rubric:: Footnotes + + .. [#] + + .. rubric:: Footnotes + + .. [#] For example. + +* Use the *note* and *warning* directives, sparingly, to draw attention to + important comments:: + + .. note:: + Here is a note + + yields: + + .. note:: + here is a note + + also: + + .. warning:: + here is a warning + +* Use the *deprecated* directive when appropriate:: + + .. deprecated:: 0.98 + This feature is obsolete, use something else. + + yields: + + .. deprecated:: 0.98 + This feature is obsolete, use something else. + +* Use the *versionadded* and *versionchanged* directives, which have similar + syntax to the *deprecated* role:: + + .. versionadded:: 0.98 + The transforms have been completely revamped. + + .. versionadded:: 0.98 + The transforms have been completely revamped. + +* Use the *seealso* directive, for example:: + + .. seealso:: + + Using ReST :ref:`emacs-helpers`: + One example + + A bit about :ref:`referring-to-mpl-docs`: + One more + + yields: + + .. seealso:: + + Using ResT :ref:`emacs-helpers`: + One example + + A bit about :ref:`referring-to-mpl-docs`: + One more + +* Please keep the :ref:`glossary` in mind when writing documentation. You can + create a references to a term in the glossary with the ``:term:`` role. + +* The autodoc extension will handle index entries for the API, but additional + entries in the index_ need to be explicitly added. + .. _documentation: http://sphinx.pocoo.org/contents.html .. _`inline markup`: http://sphinx.pocoo.org/markup/inline.html +.. _index: http://sphinx.pocoo.org/markup/para.html#index-generating-markup +Docstrings +---------- +In addition to the aforementioned formatting suggestions: + +* Please limit the text width of docstrings to 70 characters. + +* Keyword arguments should be described using a definition list. + + .. note:: + matplotlib makes extensive use of keyword arguments as pass-through + arguments, there are a many cases where a table is used in place of a + definition list for autogenerated sections of docstrings. + + Figures ======= @@ -139,7 +241,6 @@ :include-source - .. _referring-to-mpl-docs: Referring to mpl documents @@ -166,8 +267,6 @@ .. literalinclude:: ../mpl_data/matplotlibrc - - .. _internal-section-refs: Internal section references @@ -196,8 +295,8 @@ In addition, since underscores are widely used by Sphinx itself, let's prefer hyphens to separate words. -.. _emacs-helpers: + Section names, etc ================== @@ -205,6 +304,9 @@ section titles, eg ``Possible hangups`` rather than ``Possible Hangups`` + +.. _emacs-helpers: + Emacs helpers ============= Modified: trunk/matplotlib/doc/glossary/index.rst =================================================================== --- trunk/matplotlib/doc/glossary/index.rst 2008-06-15 12:08:13 UTC (rev 5547) +++ trunk/matplotlib/doc/glossary/index.rst 2008-06-15 15:29:57 UTC (rev 5548) @@ -1,6 +1,9 @@ -######## + +.. _glossary: + +******** Glossary -######## +******** .. glossary:: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2008-06-16 17:39:14
|
Revision: 5564 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5564&view=rev Author: mdboom Date: 2008-06-16 10:38:08 -0700 (Mon, 16 Jun 2008) Log Message: ----------- Support using STIX fonts in math expressions. Use this functionality to generate a png that used to be static. Modified Paths: -------------- trunk/matplotlib/doc/sphinxext/mathpng.py trunk/matplotlib/doc/users/mathtext.rst Removed Paths: ------------- trunk/matplotlib/doc/_static/stix_fonts.png Deleted: trunk/matplotlib/doc/_static/stix_fonts.png =================================================================== (Binary files differ) Modified: trunk/matplotlib/doc/sphinxext/mathpng.py =================================================================== --- trunk/matplotlib/doc/sphinxext/mathpng.py 2008-06-16 17:21:39 UTC (rev 5563) +++ trunk/matplotlib/doc/sphinxext/mathpng.py 2008-06-16 17:38:08 UTC (rev 5564) @@ -5,6 +5,7 @@ from md5 import md5 from docutils import nodes +from docutils.parsers.rst import directives from docutils.writers.html4css1 import HTMLTranslator from sphinx.latexwriter import LaTeXTranslator @@ -12,14 +13,27 @@ class latex_math(nodes.General, nodes.Element): pass +def fontset_choice(arg): + return directives.choice(arg, ['cm', 'stix', 'stixsans']) + +options_spec = {'fontset': fontset_choice} + def math_role(role, rawtext, text, lineno, inliner, options={}, content=[]): i = rawtext.find('`') latex = rawtext[i+1:-1] node = latex_math(rawtext) node['latex'] = latex + node['fontset'] = options.get('fontset', 'cm') return [node], [] +math_role.options = options_spec +def math_directive_run(content, block_text, options): + latex = ''.join(content) + node = latex_math(block_text) + node['latex'] = latex + node['fontset'] = options.get('fontset', 'cm') + return [node] try: from docutils.parsers.rst import Directive @@ -28,22 +42,19 @@ from docutils.parsers.rst.directives import _directives def math_directive(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine): - latex = ''.join(content) - node = latex_math(block_text) - node['latex'] = latex - return [node] + return math_directive_run(content, block_text, options) math_directive.arguments = None - math_directive.options = {} + math_directive.options = options_spec math_directive.content = 1 _directives['math'] = math_directive else: class math_directive(Directive): has_content = True + option_spec = options_spec + def run(self): - latex = ' '.join(self.content) - node = latex_math(self.block_text) - node['latex'] = latex - return [node] + return math_directive_run(self.content, self.block_text, + self.options) from docutils.parsers.rst import directives directives.register_directive('math', math_directive) @@ -100,12 +111,14 @@ # This uses mathtext to render the expression -def latex2png(latex, filename): +def latex2png(latex, filename, fontset='cm'): if os.path.exists(filename): return + orig_fontset = rcParams['mathtext.fontset'] + rcParams['mathtext.fontset'] = fontset mathtext_parser.to_png(filename, "$%s$" % latex, dpi=120) + rcParams['mathtext.fontset'] = orig_fontset - # LaTeX to HTML translation stuff: def latex2html(node, source): inline = isinstance(node.parent, nodes.TextElement) @@ -114,7 +127,7 @@ name = 'math-%s' % md5(latex).hexdigest()[-10:] dest = '_static/%s.png' % name if not isfile(dest): - latex2png(latex, dest) + latex2png(latex, dest, node['fontset']) path = '_static' count = source.split('/doc/')[-1].count('/') Modified: trunk/matplotlib/doc/users/mathtext.rst =================================================================== --- trunk/matplotlib/doc/users/mathtext.rst 2008-06-16 17:21:39 UTC (rev 5563) +++ trunk/matplotlib/doc/users/mathtext.rst 2008-06-16 17:38:08 UTC (rev 5564) @@ -147,22 +147,39 @@ The choices available with all fonts are: - =============== ================================= - Command Result - =============== ================================= - ``\mathrm`` :math:`\mathrm{Roman}` - ``\mathit`` :math:`\mathit{Italic}` - ``\mathtt`` :math:`\mathtt{Typewriter}` - ``\mathcal`` :math:`\mathcal{CALLIGRAPHY}` - =============== ================================= + ============================ ================================== + Command Result + ============================ ================================== + ``\mathrm{Roman}`` :math:`\mathrm{Roman}` + ``\mathit{Italic}`` :math:`\mathit{Italic}` + ``\mathtt{Typewriter}`` :math:`\mathtt{Typewriter}` + ``\mathcal{CALLIGRAPHY}`` :math:`\mathcal{CALLIGRAPHY}` + ============================ ================================== +.. role:: math-stix(math) + :fontset: stix + When using the STIX fonts, you also have the choice of: -.. image:: ../_static/stix_fonts.png + ====================================== ========================================= + Command Result + ====================================== ========================================= + ``\mathbb{blackboard}`` :math-stix:`\mathbb{blackboard}` + ``\mathrm{\mathbb{blackboard}}`` :math-stix:`\mathrm{\mathbb{blackboard}}` + ``\mathfrak{Fraktur}`` :math-stix:`\mathfrak{Fraktur}` + ``\mathsf{sansserif}`` :math-stix:`\mathsf{sansserif}` + ``\mathrm{\mathsf{sansserif}}`` :math-stix:`\mathrm{\mathsf{sansserif}}` + ====================================== ========================================= +.. htmlonly:: + + ====================================== ========================================= + ``\mathcircled{circled}`` :math-stix:`\mathcircled{circled}` + ====================================== ========================================= + There are also three global "font sets" to choose from, which are selected using the ``mathtext.fontset`` parameter in -::ref:`matplotlibrc <matplotlibrc-sample>`. +:ref:`matplotlibrc <matplotlibrc-sample>`. ``cm``: **Computer Modern (TeX)** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2008-06-17 17:25:29
|
Revision: 5582 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5582&view=rev Author: mdboom Date: 2008-06-17 10:23:30 -0700 (Tue, 17 Jun 2008) Log Message: ----------- Use new "show-inheritance" feature to show base classes in Sphinx autodoc. Modified Paths: -------------- trunk/matplotlib/doc/api/artist_api.rst trunk/matplotlib/doc/api/axes_api.rst trunk/matplotlib/doc/api/axis_api.rst trunk/matplotlib/doc/api/backend_bases_api.rst trunk/matplotlib/doc/api/backend_gtkagg_api.rst trunk/matplotlib/doc/api/backend_qt4agg_api.rst trunk/matplotlib/doc/api/backend_wxagg_api.rst trunk/matplotlib/doc/api/cbook_api.rst trunk/matplotlib/doc/api/cm_api.rst trunk/matplotlib/doc/api/collections_api.rst trunk/matplotlib/doc/api/colorbar_api.rst trunk/matplotlib/doc/api/matplotlib_configuration_api.rst trunk/matplotlib/doc/api/pyplot_api.rst trunk/matplotlib/doc/devel/transformations.rst Modified: trunk/matplotlib/doc/api/artist_api.rst =================================================================== --- trunk/matplotlib/doc/api/artist_api.rst 2008-06-17 17:21:08 UTC (rev 5581) +++ trunk/matplotlib/doc/api/artist_api.rst 2008-06-17 17:23:30 UTC (rev 5582) @@ -8,6 +8,7 @@ .. automodule:: matplotlib.artist :members: :undoc-members: + :show-inheritance: :mod:`matplotlib.lines` ============================= @@ -15,6 +16,7 @@ .. automodule:: matplotlib.lines :members: :undoc-members: + :show-inheritance: :mod:`matplotlib.patches` ============================= @@ -22,6 +24,7 @@ .. automodule:: matplotlib.patches :members: :undoc-members: + :show-inheritance: :mod:`matplotlib.text` ============================= @@ -29,3 +32,4 @@ .. automodule:: matplotlib.text :members: :undoc-members: + :show-inheritance: Modified: trunk/matplotlib/doc/api/axes_api.rst =================================================================== --- trunk/matplotlib/doc/api/axes_api.rst 2008-06-17 17:21:08 UTC (rev 5581) +++ trunk/matplotlib/doc/api/axes_api.rst 2008-06-17 17:23:30 UTC (rev 5582) @@ -9,3 +9,4 @@ .. automodule:: matplotlib.axes :members: :undoc-members: + :show-inheritance: Modified: trunk/matplotlib/doc/api/axis_api.rst =================================================================== --- trunk/matplotlib/doc/api/axis_api.rst 2008-06-17 17:21:08 UTC (rev 5581) +++ trunk/matplotlib/doc/api/axis_api.rst 2008-06-17 17:23:30 UTC (rev 5582) @@ -9,3 +9,4 @@ .. automodule:: matplotlib.axis :members: :undoc-members: + :show-inheritance: Modified: trunk/matplotlib/doc/api/backend_bases_api.rst =================================================================== --- trunk/matplotlib/doc/api/backend_bases_api.rst 2008-06-17 17:21:08 UTC (rev 5581) +++ trunk/matplotlib/doc/api/backend_bases_api.rst 2008-06-17 17:23:30 UTC (rev 5582) @@ -5,3 +5,4 @@ .. automodule:: matplotlib.backend_bases :members: :undoc-members: + :show-inheritance: Modified: trunk/matplotlib/doc/api/backend_gtkagg_api.rst =================================================================== --- trunk/matplotlib/doc/api/backend_gtkagg_api.rst 2008-06-17 17:21:08 UTC (rev 5581) +++ trunk/matplotlib/doc/api/backend_gtkagg_api.rst 2008-06-17 17:23:30 UTC (rev 5582) @@ -7,4 +7,5 @@ .. .. automodule:: matplotlib.backends.backend_gtkagg .. :members: -.. :undoc-members: \ No newline at end of file +.. :undoc-members: +.. :show-inheritance: Modified: trunk/matplotlib/doc/api/backend_qt4agg_api.rst =================================================================== --- trunk/matplotlib/doc/api/backend_qt4agg_api.rst 2008-06-17 17:21:08 UTC (rev 5581) +++ trunk/matplotlib/doc/api/backend_qt4agg_api.rst 2008-06-17 17:23:30 UTC (rev 5582) @@ -4,4 +4,6 @@ .. automodule:: matplotlib.backends.backend_qt4agg :members: - :undoc-members: \ No newline at end of file + :undoc-members: + :show-inheritance: + Modified: trunk/matplotlib/doc/api/backend_wxagg_api.rst =================================================================== --- trunk/matplotlib/doc/api/backend_wxagg_api.rst 2008-06-17 17:21:08 UTC (rev 5581) +++ trunk/matplotlib/doc/api/backend_wxagg_api.rst 2008-06-17 17:23:30 UTC (rev 5582) @@ -4,4 +4,5 @@ .. automodule:: matplotlib.backends.backend_wxagg :members: - :undoc-members: \ No newline at end of file + :undoc-members: + :show-inheritance: Modified: trunk/matplotlib/doc/api/cbook_api.rst =================================================================== --- trunk/matplotlib/doc/api/cbook_api.rst 2008-06-17 17:21:08 UTC (rev 5581) +++ trunk/matplotlib/doc/api/cbook_api.rst 2008-06-17 17:23:30 UTC (rev 5582) @@ -9,3 +9,4 @@ .. automodule:: matplotlib.cbook :members: :undoc-members: + :show-inheritance: Modified: trunk/matplotlib/doc/api/cm_api.rst =================================================================== --- trunk/matplotlib/doc/api/cm_api.rst 2008-06-17 17:21:08 UTC (rev 5581) +++ trunk/matplotlib/doc/api/cm_api.rst 2008-06-17 17:23:30 UTC (rev 5582) @@ -9,3 +9,4 @@ .. automodule:: matplotlib.cm :members: :undoc-members: + :show-inheritance: Modified: trunk/matplotlib/doc/api/collections_api.rst =================================================================== --- trunk/matplotlib/doc/api/collections_api.rst 2008-06-17 17:21:08 UTC (rev 5581) +++ trunk/matplotlib/doc/api/collections_api.rst 2008-06-17 17:23:30 UTC (rev 5582) @@ -9,3 +9,4 @@ .. automodule:: matplotlib.collections :members: :undoc-members: + :show-inheritance: Modified: trunk/matplotlib/doc/api/colorbar_api.rst =================================================================== --- trunk/matplotlib/doc/api/colorbar_api.rst 2008-06-17 17:21:08 UTC (rev 5581) +++ trunk/matplotlib/doc/api/colorbar_api.rst 2008-06-17 17:23:30 UTC (rev 5582) @@ -9,3 +9,4 @@ .. automodule:: matplotlib.colorbar :members: :undoc-members: + :show-inheritance: Modified: trunk/matplotlib/doc/api/matplotlib_configuration_api.rst =================================================================== --- trunk/matplotlib/doc/api/matplotlib_configuration_api.rst 2008-06-17 17:21:08 UTC (rev 5581) +++ trunk/matplotlib/doc/api/matplotlib_configuration_api.rst 2008-06-17 17:23:30 UTC (rev 5582) @@ -9,4 +9,5 @@ .. automodule:: matplotlib :members: rc, rcdefaults, use :undoc-members: + :show-inheritance: Modified: trunk/matplotlib/doc/api/pyplot_api.rst =================================================================== --- trunk/matplotlib/doc/api/pyplot_api.rst 2008-06-17 17:21:08 UTC (rev 5581) +++ trunk/matplotlib/doc/api/pyplot_api.rst 2008-06-17 17:23:30 UTC (rev 5582) @@ -8,4 +8,5 @@ .. automodule:: matplotlib.pyplot :members: - :undoc-members: \ No newline at end of file + :undoc-members: + :show-inheritance: Modified: trunk/matplotlib/doc/devel/transformations.rst =================================================================== --- trunk/matplotlib/doc/devel/transformations.rst 2008-06-17 17:21:08 UTC (rev 5581) +++ trunk/matplotlib/doc/devel/transformations.rst 2008-06-17 17:23:30 UTC (rev 5582) @@ -13,9 +13,11 @@ composite_transform_factory, BboxTransform, BboxTransformTo, BboxTransformFrom, ScaledTranslation, TransformedPath, nonsingular, interval_contains, interval_contains_open + :show-inheritance: :mod:`matplotlib.path` ============================= .. automodule:: matplotlib.path :members: Path, get_path_collection_extents + :show-inheritance: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2008-06-18 19:39:06
|
Revision: 5588 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5588&view=rev Author: jdh2358 Date: 2008-06-18 12:38:57 -0700 (Wed, 18 Jun 2008) Log Message: ----------- added subplots adjust faq to docs Modified Paths: -------------- trunk/matplotlib/doc/faq/howto_faq.rst trunk/matplotlib/doc/faq/installing_faq.rst trunk/matplotlib/doc/faq/troubleshooting_faq.rst trunk/matplotlib/doc/glossary/index.rst Modified: trunk/matplotlib/doc/faq/howto_faq.rst =================================================================== --- trunk/matplotlib/doc/faq/howto_faq.rst 2008-06-18 17:20:40 UTC (rev 5587) +++ trunk/matplotlib/doc/faq/howto_faq.rst 2008-06-18 19:38:57 UTC (rev 5588) @@ -1,9 +1,59 @@ .. _howto-faq: -********* -HOWTO FAQ -********* +***** +Howto +***** +.. _howto-subplots-adjust: + +How do I move the edge of my axes area over to make room for my tick labels? +============================================================================ + +For subplots, you can control the default spacing on the left, right, +bottom, and top as well as the horizontal and vertical spacing between +multiple rows and columns using the +:meth:`matplotlib.figure.Figure.subplots_adjust` method (in pyplot it +is :func:`~matplotlib.pyplot.subplots_adjust`). For example, to move +the bottom of the subplots up to make room for some rotated x tick +labels:: + + fig = plt.figure() + fig.subplots_adjust(bottom=0.2) + ax = fig.add_subplot(111) + +You can control the defaults for these parameters in your +:file:`matplotlibrc` file; see :ref:`customizing-matplotlib`. For +example, to make the above setting permanent, you would set:: + + figure.subplot.bottom : 0.2 # the bottom of the subplots of the figure + +The other parameters you can configure are, with their defaults + +*left* = 0.125 + the left side of the subplots of the figure +*right* = 0.9 + the right side of the subplots of the figure +*bottom* = 0.1 + the bottom of the subplots of the figure +*top* = 0.9 + the top of the subplots of the figure +*wspace* = 0.2 + the amount of width reserved for blank space between subplots +*hspace* = 0.2 + the amount of height reserved for white space between subplots + +If you want additional control, you can create an +:class:`~matplotlib.axes.Axes` using the +:func:`~matplotlib.pyplot.axes` command (or equivalently the figure +:meth:`matplotlib.figure.Figure.add_axes` method), which allows you to +specify the location explicitly:: + + ax = fig.add_axes([left, bottom, width, height]) + +where all values are in fractional (0 to 1) coordinates. See +`axes_demo.py <http://matplotlib.sf.net/examples/axes_demo.py>`_ for +an example of placing axes manually. + .. _howto-ticks: How do I configure the tick linewidths? Modified: trunk/matplotlib/doc/faq/installing_faq.rst =================================================================== --- trunk/matplotlib/doc/faq/installing_faq.rst 2008-06-18 17:20:40 UTC (rev 5587) +++ trunk/matplotlib/doc/faq/installing_faq.rst 2008-06-18 19:38:57 UTC (rev 5588) @@ -1,10 +1,11 @@ .. _installing-faq: -****************** - Installation FAQ -****************** +************* + Installation +************* + How do I report a compilation problem? ====================================== @@ -147,11 +148,13 @@ For example, with GTK, you can also select GDK rendering (backend ``GTK``) or Cairo rendering (backend ``GTKCairo``). -For the rendering engines, one can also distinguish between vector or -raster renderers. Vector issue drawing commands like "draw a line -from this point to this point" and hence are scale free, and raster -backends generate a pixel represenation of the line whose accuracy -depends on a DPI setting. +For the rendering engines, one can also distinguish between `vector +<http://en.wikipedia.org/wiki/Vector_graphics>`_ or `raster +<http://en.wikipedia.org/wiki/Raster_graphics>`_ renderers. Vector +graphics languages issue drawing commands like "draw a line from this +point to this point" and hence are scale free, and raster backends +generate a pixel represenation of the line whose accuracy depends on a +DPI setting. Here is a summary of the matplotlib renderers (there is an eponymous backed for each): @@ -172,7 +175,7 @@ :term:`pdf` :term:`svg` ... -:term:`GDK` :term:`png` :term:`raster graphics` -- +:term:`GDK` :term:`png` :term:`raster graphics` -- :term:`jpg` the `Gimp Drawing Kit`_ :term:`tiff` ... Modified: trunk/matplotlib/doc/faq/troubleshooting_faq.rst =================================================================== --- trunk/matplotlib/doc/faq/troubleshooting_faq.rst 2008-06-18 17:20:40 UTC (rev 5587) +++ trunk/matplotlib/doc/faq/troubleshooting_faq.rst 2008-06-18 19:38:57 UTC (rev 5588) @@ -1,8 +1,8 @@ .. _troubleshooting-faq: -******************* -Troubleshooting FAQ -******************* +*************** +Troubleshooting +*************** .. _matplotlib-version: Modified: trunk/matplotlib/doc/glossary/index.rst =================================================================== --- trunk/matplotlib/doc/glossary/index.rst 2008-06-18 17:20:40 UTC (rev 5587) +++ trunk/matplotlib/doc/glossary/index.rst 2008-06-18 19:38:57 UTC (rev 5588) @@ -13,14 +13,14 @@ Cairo The Cairo graphics engine - + EPS Encapsulated Postscript FLTK FLTK (pronounced "fulltick") is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X - + GDK The Gimp Drawing Kit for GTK+ @@ -32,7 +32,7 @@ PDF Adobe's Portable Document Format - + PNG PNG stands for Portable Network Graphics, a raster graphics format that employs lossless data compression which is more suitable for line art @@ -45,16 +45,16 @@ Qt Qt is a cross-platform application framework for desktop and embedded development. - + Qt4 Qt4 is the most recent version of Qt cross-platform application framework for desktop and embedded development. - + raster graphics Raster graphics, or bitmaps, represent an image as an array of pixels which is resolution dependent. Raster graphics are generally most practical for photo-realistic images, but do not scale easily without - loss of quality. + loss of quality. See `raster graphics <http://en.wikipedia.org/wiki/Raster_graphics>`_ SVG The Scalable Vector Graphics format. @@ -69,7 +69,7 @@ wxWidgets A cross-platform GUI and tools library for GTK, MS Windows, and MacOS. - + vector graphics The use of geometrical primitives based upon mathematical equations to represent images in computer graphics. Primitives can include points, @@ -77,4 +77,4 @@ which means that they can be resized without suffering from issues related to inherent resolution like are seen in raster graphics. Vector graphics are generally most practical for typesetting and graphic design - applications. \ No newline at end of file + applications. See `vector graphics <http://en.wikipedia.org/wiki/Vector_graphics>`_ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2008-06-19 13:59:12
|
Revision: 5595 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5595&view=rev Author: jdh2358 Date: 2008-06-19 06:59:08 -0700 (Thu, 19 Jun 2008) Log Message: ----------- added the installing doc Modified Paths: -------------- trunk/matplotlib/doc/faq/installing_faq.rst Added Paths: ----------- trunk/matplotlib/doc/users/installing.rst Modified: trunk/matplotlib/doc/faq/installing_faq.rst =================================================================== --- trunk/matplotlib/doc/faq/installing_faq.rst 2008-06-19 13:23:04 UTC (rev 5594) +++ trunk/matplotlib/doc/faq/installing_faq.rst 2008-06-19 13:59:08 UTC (rev 5595) @@ -55,10 +55,12 @@ easy_install -m PackageName + 3. Delete any .egg files or directories from your :ref:`installation directory <locating-matplotlib-install>`. + Windows installer ----------------- Added: trunk/matplotlib/doc/users/installing.rst =================================================================== --- trunk/matplotlib/doc/users/installing.rst (rev 0) +++ trunk/matplotlib/doc/users/installing.rst 2008-06-19 13:59:08 UTC (rev 5595) @@ -0,0 +1,91 @@ +.. _installing: + +********** +Installing +********** + +Dependencies +============ + +**Requirements** + +These are external packages which you will need to install before +installing matplotlib. Windows users only need the first two (python +and numpy) since the others are built into the matplotlib windows +installers available for download at the sourceforge site. + +python 2.4 (or later but not python3) + matplotlib requires python 2.4 or later + +numpy 1.1 (or later) + array support for python + +libpng 1.1 (or later) + library for loading and saving PNG files. libpng requires zlib. If + you are a windows user, you can ignore this since we build support + into the matplotlib single click installer. + +freetype 1.4 (or later) + library for reading true type font files. If you are a windows + user, you can ignore this since we build support into the + matplotlib single click installer. + +**Optional** + +These are optional packages which you may want to install to use +matplotlib with a user interface toolkit. See +:ref:`what-is-a-backend` for more details on the optional matplotlib +backends and the capabilities they provide + +tk 8.3 or later + The TCL/Tk widgets library used by the TkAgg backend + +pyqt 3.1 or later + The Qt3 widgets library python wrappers for the QtAgg backend + +pyqt 4.0 or later + The Qt4 widgets library python wrappersfor the Qt4Agg backend + +pygtk 2.2 or later + The python wrappers for the GTK widgets library for use with the GTK or GTKAgg backend + +wxpython 2.6 or later + The python wrappers for the wx widgets library for use with the WXAgg backend + +wxpython 2.8 or later + The python wrappers for the wx widgets library for use with the WX backend + +pyfltk 1.0 or later + The python wrappers of the FLTK widgets library for use with FLTKAgg + +**Required libraries that ship with matplotlib** + +If you are downloading matplotlib or installing from source or +subversion, you can ignore this section. This is useful for matplotlib +developers and packagers who may want to disable the matplotlib +version and ship a packaged version. + +agg2.4 + The antigrain C++ rendering engine + +pytz 2007g or later + timezone handling for python datetime objects + +dateutil 1.1 or later + extensions to python datetime handling + +**Optional libraries that ship with matplotlib** + +As above, if you are downloading matplotlib or installing from source +or subversion, you can ignore this section. This is useful for +matplotlib developers and packagers who may want to disable the +matplotlib version and ship a packaged version. + +enthought traits 2.6 + The traits component of the Enthought Tool Suite used in the + experimental matplotlib traits rc system. matplotlib has decided + to stop installing this library so packagers should not distribute + the version included with matplotlib. packagers do not need to + list this as a requirement because the traits support is + experimental and disabled by default. + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2008-06-19 19:25:13
|
Revision: 5599 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5599&view=rev Author: jdh2358 Date: 2008-06-19 12:24:45 -0700 (Thu, 19 Jun 2008) Log Message: ----------- added a releae guide to devel docs Modified Paths: -------------- trunk/matplotlib/doc/devel/index.rst trunk/matplotlib/doc/faq/environment_variables_faq.rst trunk/matplotlib/doc/faq/howto_faq.rst trunk/matplotlib/doc/faq/installing_faq.rst trunk/matplotlib/doc/faq/troubleshooting_faq.rst Added Paths: ----------- trunk/matplotlib/doc/devel/release_guide.rst Modified: trunk/matplotlib/doc/devel/index.rst =================================================================== --- trunk/matplotlib/doc/devel/index.rst 2008-06-19 19:13:15 UTC (rev 5598) +++ trunk/matplotlib/doc/devel/index.rst 2008-06-19 19:24:45 UTC (rev 5599) @@ -14,6 +14,7 @@ coding_guide.rst documenting_mpl.rst + release_guide.rst transformations.rst add_new_projection.rst outline.rst Added: trunk/matplotlib/doc/devel/release_guide.rst =================================================================== --- trunk/matplotlib/doc/devel/release_guide.rst (rev 0) +++ trunk/matplotlib/doc/devel/release_guide.rst 2008-06-19 19:24:45 UTC (rev 5599) @@ -0,0 +1,86 @@ +.. _release-guide: + +************************* +Doing a matplolib release +************************* + +A guide for developers who are doing a matplotlib release + +* Edit :file:`__init__.py` and bump the version number + + +.. _release-testing: + +Testing +======= + +* Make sure :file:`examples/tests/backend_driver.py` runs without errors + and check the output of the PNG, PDF, PS and SVG backends + +* Run :file:`unit/memleak_hawaii3.py` and make sure there are no + memory leaks + +* try some GUI examples, eg :file:`simple_plot.py` with GTKAgg, TkAgg, etc... + +* remove font cache and tex cache from :file:`.matplotlib` and test + with and without cache on some example script + +.. _release-packaging: + +Packaging +========= + +* Make sure the :file:`MANIFEST.in` us up to date and remove + :file:`MANIFEST` so it will be rebuilt by MANIFEST.in + +* run `svn-clean + <http://svn.collab.net/repos/svn/trunk/contrib/client-side/svn-clean>`_ + from in the mpl svn directory before building the sdist + +* unpack the sdist and make sure you can build from that directory + +* Use :file:`setup.cfg` to set the default backends. For windows and + OSX, the default backend should be TkAgg. + +* on windows, unix2dos the rc file + +.. _release-uploading: + +Uploading +========= + +* Post the win32 and OS-X binaries for testing and make a request on + matplotlib-devel for testing. Pester us if we don't respond + + +* ftp the source and binaries to the anonymous FTP site:: + + local> cd dist + local> ncftp upload.sourceforge.net + ncftp> cd incoming + ncftp> put tar.gz, zip exe + +* go https://sourceforge.net/project/admin/?group_id=80706 and do a + file release. Click on the "Admin" tab to log in as an admin, and + then the "File Releases" tab. Go to the bottom and click "add + release" and enter the package name but not the version number in + the "Package Name" box. You will then be prompted for the "New + release name" at which point you can add the version number, eg + somepackage-0.1 and click "Create this release". + + You will then be taken to a fairly self explanatory page where you + can enter the Change notes, the release notes, and select which + packages from the incoming ftp archive you want to include in this + release. For each binary, you will need to select the platform and + file type, and when you are done you click on the "notify users who + are monitoring this package link" + + +.. _release-announcing: + +Announcing +========== + +Announce the release on matplotlib-announce, matplotlib-users and +matplotlib-devel. Include a summary of highlights from the CHANGELOG +and/or post the whole CHANGELOG since the last release. \ No newline at end of file Modified: trunk/matplotlib/doc/faq/environment_variables_faq.rst =================================================================== --- trunk/matplotlib/doc/faq/environment_variables_faq.rst 2008-06-19 19:13:15 UTC (rev 5598) +++ trunk/matplotlib/doc/faq/environment_variables_faq.rst 2008-06-19 19:24:45 UTC (rev 5599) @@ -4,6 +4,8 @@ Environment Variables ********************* +.. contents:: + .. envvar:: HOME The user's home directory. On linux, :envvar:`~ <HOME>` is shorthand for :envvar:`HOME`. Modified: trunk/matplotlib/doc/faq/howto_faq.rst =================================================================== --- trunk/matplotlib/doc/faq/howto_faq.rst 2008-06-19 19:13:15 UTC (rev 5598) +++ trunk/matplotlib/doc/faq/howto_faq.rst 2008-06-19 19:24:45 UTC (rev 5599) @@ -4,6 +4,9 @@ Howto ***** +.. contents:: + + .. _howto-subplots-adjust: How do I move the edge of my axes area over to make room for my tick labels? Modified: trunk/matplotlib/doc/faq/installing_faq.rst =================================================================== --- trunk/matplotlib/doc/faq/installing_faq.rst 2008-06-19 19:13:15 UTC (rev 5598) +++ trunk/matplotlib/doc/faq/installing_faq.rst 2008-06-19 19:24:45 UTC (rev 5599) @@ -4,6 +4,7 @@ Installation ************* +.. contents:: How do I report a compilation problem? Modified: trunk/matplotlib/doc/faq/troubleshooting_faq.rst =================================================================== --- trunk/matplotlib/doc/faq/troubleshooting_faq.rst 2008-06-19 19:13:15 UTC (rev 5598) +++ trunk/matplotlib/doc/faq/troubleshooting_faq.rst 2008-06-19 19:24:45 UTC (rev 5599) @@ -4,6 +4,8 @@ Troubleshooting *************** +.. contents:: + .. _matplotlib-version: What is my matplotlib version? This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2008-06-19 19:56:26
|
Revision: 5601 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5601&view=rev Author: mdboom Date: 2008-06-19 12:55:41 -0700 (Thu, 19 Jun 2008) Log Message: ----------- Add initial support for inheritance diagrams. Modified Paths: -------------- trunk/matplotlib/doc/api/artist_api.rst trunk/matplotlib/doc/api/collections_api.rst trunk/matplotlib/doc/conf.py trunk/matplotlib/doc/devel/transformations.rst Added Paths: ----------- trunk/matplotlib/doc/sphinxext/inheritance_diagram.py Modified: trunk/matplotlib/doc/api/artist_api.rst =================================================================== --- trunk/matplotlib/doc/api/artist_api.rst 2008-06-19 19:53:12 UTC (rev 5600) +++ trunk/matplotlib/doc/api/artist_api.rst 2008-06-19 19:55:41 UTC (rev 5601) @@ -2,6 +2,8 @@ matplotlib artists ******************* +.. inheritance-diagram:: matplotlib.patches matplotlib.lines matplotlib.text + :mod:`matplotlib.artist` ============================= Modified: trunk/matplotlib/doc/api/collections_api.rst =================================================================== --- trunk/matplotlib/doc/api/collections_api.rst 2008-06-19 19:53:12 UTC (rev 5600) +++ trunk/matplotlib/doc/api/collections_api.rst 2008-06-19 19:55:41 UTC (rev 5601) @@ -2,6 +2,7 @@ matplotlib collections ********************** +.. inheritance-diagram:: matplotlib.collections :mod:`matplotlib.collections` ============================= Modified: trunk/matplotlib/doc/conf.py =================================================================== --- trunk/matplotlib/doc/conf.py 2008-06-19 19:53:12 UTC (rev 5600) +++ trunk/matplotlib/doc/conf.py 2008-06-19 19:55:41 UTC (rev 5601) @@ -28,7 +28,7 @@ # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['mathpng', 'math_symbol_table', 'sphinx.ext.autodoc', - 'only_directives', 'plot_directive'] + 'only_directives', 'plot_directive', 'inheritance_diagram'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] Modified: trunk/matplotlib/doc/devel/transformations.rst =================================================================== --- trunk/matplotlib/doc/devel/transformations.rst 2008-06-19 19:53:12 UTC (rev 5600) +++ trunk/matplotlib/doc/devel/transformations.rst 2008-06-19 19:55:41 UTC (rev 5601) @@ -2,6 +2,8 @@ Working with transformations ============================== +.. inheritance-diagram:: matplotlib.transforms matplotlib.path + :mod:`matplotlib.transforms` ============================= Added: trunk/matplotlib/doc/sphinxext/inheritance_diagram.py =================================================================== --- trunk/matplotlib/doc/sphinxext/inheritance_diagram.py (rev 0) +++ trunk/matplotlib/doc/sphinxext/inheritance_diagram.py 2008-06-19 19:55:41 UTC (rev 5601) @@ -0,0 +1,414 @@ +""" +Defines a docutils directive for inserting inheritance diagrams. + +Provide the directive with one or more classes or modules (separated +by whitespace). For modules, all of the classes in that module will +be used. + +Example:: + + Given the following classes: + + class A: pass + class B(A): pass + class C(A): pass + class D(B, C): pass + class E(B): pass + + .. inheritance-diagram: D E + + Produces a graph like the following: + + A + / \ + B C + / \ / + E D + +The graph is inserted as a PNG+image map into HTML and a PDF in +LaTeX. +""" + +import inspect +import os +import subprocess +try: + from hashlib import md5 +except ImportError: + from md5 import md5 + +from docutils.nodes import Body, Element +from docutils.writers.html4css1 import HTMLTranslator +from sphinx.latexwriter import LaTeXTranslator +from docutils.parsers.rst import directives +from sphinx.roles import xfileref_role +from sphinx.directives.desc import py_sig_re + +class DotException(Exception): + pass + +class InheritanceGraph(object): + """ + Given a list of classes, determines the set of classes that + they inherit from all the way to the root "object", and then + is able to generate a graphviz dot graph from them. + """ + def __init__(self, class_names, show_builtins=False): + """ + *class_names* is a list of child classes to show bases from. + + If *show_builtins* is True, then Python builtins will be shown + in the graph. + """ + self.class_names = class_names + self.classes = self._import_classes(class_names) + self.all_classes = self._all_classes(self.classes) + if len(self.all_classes) == 0: + raise ValueError("No classes found for inheritance diagram") + self.show_builtins = show_builtins + + def _import_class_or_module(self, name): + """ + Import a class using its fully-qualified *name*. + """ + try: + path, base, signature = py_sig_re.match(name).groups() + except: + raise ValueError( + "Invalid class '%s' specified for inheritance diagram" % name) + fullname = (path or '') + base + path = path and path.rstrip('.') + if not path: + raise ValueError( + "Invalid class '%s' specified for inheritance diagram" % name) + try: + module = __import__(path, None, None, []) + except ImportError: + raise ValueError( + "Could not import class '%s' specified for inheritance diagram" % name) + + try: + todoc = module + for comp in fullname.split('.')[1:]: + todoc = getattr(todoc, comp) + except AttributeError: + raise ValueError( + "Could not find class '%s' specified for inheritance diagram" % name) + + # If a class, just return it + if inspect.isclass(todoc): + return [todoc] + elif inspect.ismodule(todoc): + classes = [] + for cls in todoc.__dict__.values(): + if inspect.isclass(cls) and cls.__module__ == todoc.__name__: + classes.append(cls) + return classes + raise ValueError( + "'%s' does not resolve to a class or module" % name) + + def _import_classes(self, class_names): + """ + Import a list of classes. + """ + classes = [] + for name in class_names: + classes.extend(self._import_class_or_module(name)) + return classes + + def _all_classes(self, classes): + """ + Return a list of all classes that are ancestors of *classes*. + """ + all_classes = {} + + def recurse(cls): + all_classes[cls] = None + for c in cls.__bases__: + if c not in all_classes: + recurse(c) + + for cls in classes: + recurse(cls) + + return all_classes.keys() + + def class_name(self, cls): + """ + Given a class object, return a fully-qualified name. This + works for things I've tested in matplotlib so far, but may + not be completely general. + """ + module = cls.__module__ + if module == '__builtin__': + return cls.__name__ + return '.'.join([module, cls.__name__]) + + def get_all_class_names(self): + """ + Get all of the class names involved in the graph. + """ + return [self.class_name(x) for x in self.all_classes] + + # These are the default options for + default_graph_options = { + "rankdir": "LR", + "size": '"11.0, 11.0"' + } + default_node_options = { + "shape": "box", + "fontsize": 10, + "height": 0.25, + "fontname": "sans", + "style": '"setlinewidth(0.5)"' + } + default_edge_options = { + "arrowsize": 0.5, + "style": '"setlinewidth(0.5)"' + } + + def _format_node_options(self, options): + return ','.join(["%s=%s" % x for x in options.items()]) + def _format_graph_options(self, options): + return ''.join(["%s=%s;\n" % x for x in options.items()]) + + def generate_dot(self, fd, name, urls={}, + graph_options={}, node_options={}, + edge_options={}): + """ + Generate a graphviz dot graph from the classes that + were passed in to __init__. + + *fd* is a Python file-like object to write to. + + *name* is the name of the graph + + *urls* is a dictionary mapping class names to http urls + + *graph_options*, *node_options*, *edge_options* are + dictionaries containing key/value pairs to pass on as graphviz + properties. + """ + g_options = self.default_graph_options.copy() + g_options.update(graph_options) + n_options = self.default_node_options.copy() + n_options.update(node_options) + e_options = self.default_edge_options.copy() + e_options.update(edge_options) + + fd.write('digraph %s {\n' % name) + fd.write(self._format_graph_options(g_options)) + + for cls in self.all_classes: + if not self.show_builtins and cls in __builtins__.values(): + continue + + name = self.class_name(cls) + + # Write the node + this_node_options = n_options.copy() + url = urls.get(name) + if url is not None: + this_node_options['URL'] = '"%s"' % url + fd.write(' "%s" [%s];\n' % + (name, self._format_node_options(this_node_options))) + + # Write the edges + for base in cls.__bases__: + if not self.show_builtins and base in __builtins__.values(): + continue + + base_name = self.class_name(base) + fd.write(' "%s" -> "%s" [%s];\n' % + (self.class_name(base), name, + self._format_node_options(e_options))) + fd.write('}\n') + + def run_dot(self, args, name, urls={}, + graph_options={}, node_options={}, edge_options={}): + """ + Run graphviz 'dot' over this graph, returning whatever 'dot' + writes to stdout. + + *args* will be passed along as commandline arguments. + + *name* is the name of the graph + + *urls* is a dictionary mapping class names to http urls + + Raises DotException for any of the many os and + installation-related errors that may occur. + """ + try: + dot = subprocess.Popen(['dot'] + list(args), + stdin=subprocess.PIPE, stdout=subprocess.PIPE, + close_fds=True) + except OSError: + raise DotException("Could not execute 'dot'. Are you sure you have 'graphviz' installed?") + except ValueError: + raise DotException("'dot' called with invalid arguments") + except: + raise DotException("Unexpected error calling 'dot'") + + self.generate_dot(dot.stdin, name, urls, graph_options, node_options, + edge_options) + dot.stdin.close() + result = dot.stdout.read() + returncode = dot.wait() + if returncode != 0: + raise DotException("'dot' returned the errorcode %d" % returncode) + return result + +class inheritance_diagram(Body, Element): + """ + A docutils node to use as a placeholder for the inheritance + diagram. + """ + pass + +def inheritance_diagram_directive_run(clstexts, state): + """ + Run when the inheritance_diagram directive is first encountered. + """ + node = inheritance_diagram() + + # Create a graph starting with the list of classes + graph = InheritanceGraph(clstexts) + + # Create xref nodes for each target of the graph's image map and + # add them to the doc tree so that Sphinx can resolve the + # references to real URLs later. These nodes will eventually be + # removed from the doctree after we're done with them. + for name in graph.get_all_class_names(): + refnodes, x = xfileref_role( + 'class', ':class:`%s`' % name, name, 0, state) + node.extend(refnodes) + # Store the graph object so we can use it to generate the + # dot file later + node['graph'] = graph + # Store the original content for use as a hash + node['content'] = " ".join(clstexts) + return [node] + +def html_output_graph(self, node): + """ + Output the graph for HTML. This will insert a PNG with clickable + image map. + """ + graph = node['graph'] + + # Determine where to write the PNG to. This follows + # the same procedure as mathpng.py + name = 'inheritance%s' % md5(node['content']).hexdigest()[-10:] + png_path = '_static/%s.png' % name + + path = '_static' + source = self.document.attributes['source'] + count = source.split('/doc/')[-1].count('/') + for i in range(count): + if os.path.exists(path): break + path = '../'+path + path = '../'+path #specifically added for matplotlib + + # Create a mapping from fully-qualified class names to URLs. + urls = {} + for child in node: + try: + urls[child['reftitle']] = child['refuri'] + except KeyError: + try: + urls[child['reftitle']] = '#' + child['refid'] + except KeyError: + pass + + # These arguments to dot will save a PNG file to disk and write + # an HTML image map to stdout. + image_map = graph.run_dot(['-Tpng', '-o%s' % png_path, '-Tcmapx'], + name, urls) + return ('<img src="%s/%s.png" usemap="#%s"/>%s' % + (path, name, name, image_map)) + +def latex_output_graph(self, node): + """ + Output the graph for LaTeX. This will insert a PDF. + """ + graph = node['graph'] + + # Determine where to write the PNG to. This follows + # the same procedure as mathpng.py + name = 'inheritance%s' % md5(node['content']).hexdigest()[-10:] + pdf_path = '_static/%s.pdf' % name + + path = '_static' + source = self.document.attributes['source'] + count = source.split('/doc/')[-1].count('/') + for i in range(count): + if os.path.exists(path): break + path = '../'+path + path = '../'+path #specifically added for matplotlib + + graph.run_dot(['-Tpdf', '-o%s' % pdf_path], name, + graph_options={'size': '"6.0,6.0"'}) + return '\\includegraphics{../../_static/%s.pdf}' % name + +def visit_inheritance_diagram(inner_func): + """ + This is just a wrapper around html/latex_output_graph to make it + easier to handle errors and insert warnings. + """ + def visitor(self, node): + try: + content = inner_func(self, node) + except DotException, e: + # Insert the exception as a warning in the document + warning = self.document.reporter.warning(str(e), line=node.line) + warning.parent = node + node.children = [warning] + else: + source = self.document.attributes['source'] + self.body.append(content) + node.children = [] + return visitor + +def do_nothing(self, node): + pass + +# Deal with the old and new way of registering directives +try: + from docutils.parsers.rst import Directive +except ImportError: + from docutils.parsers.rst.directives import _directives + def inheritance_diagram_directive(name, arguments, options, content, lineno, + content_offset, block_text, state, + state_machine): + return inheritance_diagram_directive_run(arguments, state) + inheritance_diagram_directive.__doc__ = __doc__ + inheritance_diagram_directive.arguments = (1, 100, 0) + inheritance_diagram_directive.options = {} + inheritance_diagram_directive.content = 0 + _directives['inheritance-diagram'] = inheritance_diagram_directive +else: + class inheritance_diagram_directive(Directive): + has_content = False + required_arguments = 1 + optional_arguments = 100 + final_argument_whitespace = False + option_spec = {} + + def run(self): + return inheritance_diagram_directive_run(self.arguments, self.state) + inheritance_diagram_directive.__doc__ = __doc__ + + directives.register_directive('inheritance-diagram', + inheritance_diagram_directive) + +def setup(app): + app.add_node(inheritance_diagram) + + HTMLTranslator.visit_inheritance_diagram = \ + visit_inheritance_diagram(html_output_graph) + HTMLTranslator.depart_inheritance_diagram = do_nothing + + LaTeXTranslator.visit_inheritance_diagram = \ + visit_inheritance_diagram(latex_output_graph) + LaTeXTranslator.depart_inheritance_diagram = do_nothing This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2008-06-20 13:30:42
|
Revision: 5610 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5610&view=rev Author: mdboom Date: 2008-06-20 06:30:18 -0700 (Fri, 20 Jun 2008) Log Message: ----------- Add "parts" option to inheritance diagram. Improve exception messages. Describe inheritance-diagram in documenting.rst. Modified Paths: -------------- trunk/matplotlib/doc/_static/matplotlib.css trunk/matplotlib/doc/api/artist_api.rst trunk/matplotlib/doc/api/collections_api.rst trunk/matplotlib/doc/devel/documenting_mpl.rst trunk/matplotlib/doc/devel/transformations.rst trunk/matplotlib/doc/sphinxext/inheritance_diagram.py Modified: trunk/matplotlib/doc/_static/matplotlib.css =================================================================== --- trunk/matplotlib/doc/_static/matplotlib.css 2008-06-20 11:58:01 UTC (rev 5609) +++ trunk/matplotlib/doc/_static/matplotlib.css 2008-06-20 13:30:18 UTC (rev 5610) @@ -7,3 +7,7 @@ dl.method, dl.attribute { border-top: 1px solid #aaa; } + +img.inheritance { + border: 0px +} \ No newline at end of file Modified: trunk/matplotlib/doc/api/artist_api.rst =================================================================== --- trunk/matplotlib/doc/api/artist_api.rst 2008-06-20 11:58:01 UTC (rev 5609) +++ trunk/matplotlib/doc/api/artist_api.rst 2008-06-20 13:30:18 UTC (rev 5610) @@ -3,6 +3,7 @@ ******************* .. inheritance-diagram:: matplotlib.patches matplotlib.lines matplotlib.text + :parts: 2 :mod:`matplotlib.artist` ============================= Modified: trunk/matplotlib/doc/api/collections_api.rst =================================================================== --- trunk/matplotlib/doc/api/collections_api.rst 2008-06-20 11:58:01 UTC (rev 5609) +++ trunk/matplotlib/doc/api/collections_api.rst 2008-06-20 13:30:18 UTC (rev 5610) @@ -3,6 +3,7 @@ ********************** .. inheritance-diagram:: matplotlib.collections + :parts: 2 :mod:`matplotlib.collections` ============================= Modified: trunk/matplotlib/doc/devel/documenting_mpl.rst =================================================================== --- trunk/matplotlib/doc/devel/documenting_mpl.rst 2008-06-20 11:58:01 UTC (rev 5609) +++ trunk/matplotlib/doc/devel/documenting_mpl.rst 2008-06-20 13:30:18 UTC (rev 5610) @@ -304,7 +304,31 @@ section titles, eg ``Possible hangups`` rather than ``Possible Hangups`` +Inheritance diagrams +==================== +Class inheritance diagrams can be generated with the +``inheritance-diagram`` directive. To use it, you provide the +directive with a number of class or module names (separated by +whitespace). If a module name is provided, all classes in that module +will be used. All of the ancestors of these classes will be included +in the inheritance diagram. + +A single option is available: *parts* controls how many of parts in +the path to the class are shown. For example, if *parts* == 1, the +class ``matplotlib.patches.Patch`` is shown as ``Patch``. If *parts* +== 2, it is shown as ``patches.Patch``. If *parts* == 0, the full +path is shown. + +Example:: + + .. inheritance-diagram:: matplotlib.patches matplotlib.lines matplotlib.text + :parts: 2 + +.. inheritance-diagram:: matplotlib.patches matplotlib.lines matplotlib.text + :parts: 2 + + .. _emacs-helpers: Emacs helpers Modified: trunk/matplotlib/doc/devel/transformations.rst =================================================================== --- trunk/matplotlib/doc/devel/transformations.rst 2008-06-20 11:58:01 UTC (rev 5609) +++ trunk/matplotlib/doc/devel/transformations.rst 2008-06-20 13:30:18 UTC (rev 5610) @@ -3,6 +3,7 @@ ============================== .. inheritance-diagram:: matplotlib.transforms matplotlib.path + :parts: 1 :mod:`matplotlib.transforms` ============================= Modified: trunk/matplotlib/doc/sphinxext/inheritance_diagram.py =================================================================== --- trunk/matplotlib/doc/sphinxext/inheritance_diagram.py 2008-06-20 11:58:01 UTC (rev 5609) +++ trunk/matplotlib/doc/sphinxext/inheritance_diagram.py 2008-06-20 13:30:18 UTC (rev 5610) @@ -75,17 +75,17 @@ path, base, signature = py_sig_re.match(name).groups() except: raise ValueError( - "Invalid class '%s' specified for inheritance diagram" % name) + "Invalid class or module '%s' specified for inheritance diagram" % name) fullname = (path or '') + base path = path and path.rstrip('.') if not path: raise ValueError( - "Invalid class '%s' specified for inheritance diagram" % name) + "Invalid class or module '%s' specified for inheritance diagram" % name) try: module = __import__(path, None, None, []) except ImportError: raise ValueError( - "Could not import class '%s' specified for inheritance diagram" % name) + "Could not import class or module '%s' specified for inheritance diagram" % name) try: todoc = module @@ -93,7 +93,7 @@ todoc = getattr(todoc, comp) except AttributeError: raise ValueError( - "Could not find class '%s' specified for inheritance diagram" % name) + "Could not find class or module '%s' specified for inheritance diagram" % name) # If a class, just return it if inspect.isclass(todoc): @@ -133,7 +133,7 @@ return all_classes.keys() - def class_name(self, cls): + def class_name(self, cls, parts=0): """ Given a class object, return a fully-qualified name. This works for things I've tested in matplotlib so far, but may @@ -142,7 +142,11 @@ module = cls.__module__ if module == '__builtin__': return cls.__name__ - return '.'.join([module, cls.__name__]) + fullname = '.'.join([module, cls.__name__]) + if parts == 0: + return fullname + name_parts = fullname.split('.') + return '.'.join(name_parts[-parts:]) def get_all_class_names(self): """ @@ -159,7 +163,7 @@ "shape": "box", "fontsize": 10, "height": 0.25, - "fontname": "sans", + "fontname": "Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans", "style": '"setlinewidth(0.5)"' } default_edge_options = { @@ -172,7 +176,7 @@ def _format_graph_options(self, options): return ''.join(["%s=%s;\n" % x for x in options.items()]) - def generate_dot(self, fd, name, urls={}, + def generate_dot(self, fd, name, parts=0, urls={}, graph_options={}, node_options={}, edge_options={}): """ @@ -203,11 +207,11 @@ if not self.show_builtins and cls in __builtins__.values(): continue - name = self.class_name(cls) + name = self.class_name(cls, parts) # Write the node this_node_options = n_options.copy() - url = urls.get(name) + url = urls.get(self.class_name(cls)) if url is not None: this_node_options['URL'] = '"%s"' % url fd.write(' "%s" [%s];\n' % @@ -218,13 +222,13 @@ if not self.show_builtins and base in __builtins__.values(): continue - base_name = self.class_name(base) + base_name = self.class_name(base, parts) fd.write(' "%s" -> "%s" [%s];\n' % - (self.class_name(base), name, + (base_name, name, self._format_node_options(e_options))) fd.write('}\n') - def run_dot(self, args, name, urls={}, + def run_dot(self, args, name, parts=0, urls={}, graph_options={}, node_options={}, edge_options={}): """ Run graphviz 'dot' over this graph, returning whatever 'dot' @@ -250,8 +254,8 @@ except: raise DotException("Unexpected error calling 'dot'") - self.generate_dot(dot.stdin, name, urls, graph_options, node_options, - edge_options) + self.generate_dot(dot.stdin, name, parts, urls, graph_options, + node_options, edge_options) dot.stdin.close() result = dot.stdout.read() returncode = dot.wait() @@ -266,14 +270,14 @@ """ pass -def inheritance_diagram_directive_run(clstexts, state): +def inheritance_diagram_directive_run(class_names, options, state): """ Run when the inheritance_diagram directive is first encountered. """ node = inheritance_diagram() # Create a graph starting with the list of classes - graph = InheritanceGraph(clstexts) + graph = InheritanceGraph(class_names) # Create xref nodes for each target of the graph's image map and # add them to the doc tree so that Sphinx can resolve the @@ -287,7 +291,8 @@ # dot file later node['graph'] = graph # Store the original content for use as a hash - node['content'] = " ".join(clstexts) + node['parts'] = options.get('parts', 0) + node['content'] = " ".join(class_names) return [node] def html_output_graph(self, node): @@ -296,10 +301,12 @@ image map. """ graph = node['graph'] + parts = node['parts'] # Determine where to write the PNG to. This follows # the same procedure as mathpng.py - name = 'inheritance%s' % md5(node['content']).hexdigest()[-10:] + name = 'inheritance%s' % md5( + node['content'] + str(node['parts'])).hexdigest()[-10:] png_path = '_static/%s.png' % name path = '_static' @@ -324,8 +331,8 @@ # These arguments to dot will save a PNG file to disk and write # an HTML image map to stdout. image_map = graph.run_dot(['-Tpng', '-o%s' % png_path, '-Tcmapx'], - name, urls) - return ('<img src="%s/%s.png" usemap="#%s"/>%s' % + name, parts, urls) + return ('<img src="%s/%s.png" usemap="#%s" class="inheritance"/>%s' % (path, name, name, image_map)) def latex_output_graph(self, node): @@ -333,10 +340,12 @@ Output the graph for LaTeX. This will insert a PDF. """ graph = node['graph'] + parts = node['parts'] # Determine where to write the PNG to. This follows # the same procedure as mathpng.py - name = 'inheritance%s' % md5(node['content']).hexdigest()[-10:] + name = 'inheritance%s' % md5( + node['content'] + str(node['parts'])).hexdigest()[-10:] pdf_path = '_static/%s.pdf' % name path = '_static' @@ -347,7 +356,7 @@ path = '../'+path path = '../'+path #specifically added for matplotlib - graph.run_dot(['-Tpdf', '-o%s' % pdf_path], name, + graph.run_dot(['-Tpdf', '-o%s' % pdf_path], name, parts, graph_options={'size': '"6.0,6.0"'}) return '\\includegraphics{../../_static/%s.pdf}' % name @@ -373,6 +382,10 @@ def do_nothing(self, node): pass +options_spec = { + 'parts': directives.nonnegative_int + } + # Deal with the old and new way of registering directives try: from docutils.parsers.rst import Directive @@ -381,10 +394,10 @@ def inheritance_diagram_directive(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine): - return inheritance_diagram_directive_run(arguments, state) + return inheritance_diagram_directive_run(arguments, options, state) inheritance_diagram_directive.__doc__ = __doc__ inheritance_diagram_directive.arguments = (1, 100, 0) - inheritance_diagram_directive.options = {} + inheritance_diagram_directive.options = options_spec inheritance_diagram_directive.content = 0 _directives['inheritance-diagram'] = inheritance_diagram_directive else: @@ -393,10 +406,11 @@ required_arguments = 1 optional_arguments = 100 final_argument_whitespace = False - option_spec = {} + option_spec = options_spec def run(self): - return inheritance_diagram_directive_run(self.arguments, self.state) + return inheritance_diagram_directive_run( + self.arguments, self.options, self.state) inheritance_diagram_directive.__doc__ = __doc__ directives.register_directive('inheritance-diagram', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2008-06-25 21:43:10
|
Revision: 5673 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5673&view=rev Author: jdh2358 Date: 2008-06-25 14:43:09 -0700 (Wed, 25 Jun 2008) Log Message: ----------- updated the autotick label faq to use bboxes and transforms rather than iteration Modified Paths: -------------- trunk/matplotlib/doc/faq/howto_faq.rst trunk/matplotlib/doc/pyplots/auto_subplots_adjust.py Modified: trunk/matplotlib/doc/faq/howto_faq.rst =================================================================== --- trunk/matplotlib/doc/faq/howto_faq.rst 2008-06-25 14:37:23 UTC (rev 5672) +++ trunk/matplotlib/doc/faq/howto_faq.rst 2008-06-25 21:43:09 UTC (rev 5673) @@ -112,9 +112,9 @@ get the window extent there, and then do something with it, eg move the left of the canvas over; see :ref:`event-handling-tutorial`. -Here is a recursive, iterative solution that will gradually move the -left of the subplot over until the label fits w/o going outside the -figure border (requires matplotlib 0.98) +Here is that gets a bounding box in relative figure coordinates (0..1) +of each of the labels and uses it to move the left of the subplots +over so that the tick labels fit in the figure .. plot:: auto_subplots_adjust.py :include-source: Modified: trunk/matplotlib/doc/pyplots/auto_subplots_adjust.py =================================================================== --- trunk/matplotlib/doc/pyplots/auto_subplots_adjust.py 2008-06-25 14:37:23 UTC (rev 5672) +++ trunk/matplotlib/doc/pyplots/auto_subplots_adjust.py 2008-06-25 21:43:09 UTC (rev 5673) @@ -1,5 +1,5 @@ import matplotlib.pyplot as plt - +import matplotlib.transforms as mtransforms fig = plt.figure() ax = fig.add_subplot(111) ax.plot(range(10)) @@ -7,13 +7,24 @@ labels = ax.set_yticklabels(('really, really, really', 'long', 'labels')) def on_draw(event): + bboxes = [] for label in labels: bbox = label.get_window_extent() - if bbox.xmin<0: - fig.subplots_adjust(left=1.1*fig.subplotpars.left) - fig.canvas.draw() - break + # the figure transform goes from relative coords->pixels and we + # want the inverse of that + bboxi = bbox.inverse_transformed(fig.transFigure) + bboxes.append(bboxi) + # this is the bbox that bounds all the bboxes, again in relative + # figure coords + bbox = mtransforms.Bbox.union(bboxes) + if fig.subplotpars.left < bbox.width: + # we need to move it over + fig.subplots_adjust(left=1.1*bbox.width) # pad a little + fig.canvas.draw() + return False + fig.canvas.mpl_connect('draw_event', on_draw) plt.show() + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |