8000 added new docs dir · matplotlib/matplotlib@f0f28a3 · GitHub
[go: up one dir, main page]

Skip to content

Commit f0f28a3

Browse files
committed
added new docs dir
svn path=/trunk/matplotlib/; revision=5253
1 parent c9b6b46 commit f0f28a3

31 files changed

+3367
-0
lines changed

docs/api/artist_api.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
******************
2+
matplotlib artists
3+
******************
4+
5+
:mod:`matplotlib.artist`
6+
=============================
7+
8+
.. automodule:: matplotlib.artist
9+
:members:
10+
:undoc-members:
11+
12+
:mod:`matplotlib.lines`
13+
=============================
14+
15+
.. automodule:: matplotlib.lines
16+
:members:
17+
:undoc-members:
18+
19+
:mod:`matplotlib.patches`
20+
=============================
21+
22+
.. automodule:: matplotlib.patches
23+
:members:
24+
:undoc-members:
25+
26+
:mod:`matplotlib.text`
27+
=============================
28+
29+
.. automodule:: matplotlib.text
30+
:members:
31+
:undoc-members:

docs/api/index.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.. _api-index:
2+
3+
####################
4+
The Matplotlib API
5+
####################
6+
7+
:Release: |version|
8+
:Date: |today|
9+
10+
Introduction to developer's guide here **TODO**.
11+
12+
.. toctree::
13+
14+
artist_api.rst
15+

docs/conf.py

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# Matplotlib documentation build configuration file, created by
4+
# sphinx-quickstart on Fri May 2 12:33:25 2008.
5+
#
6+
# This file is execfile()d with the current directory set to its containing dir.
7+
#
8+
# The contents of this file are pickled, so don't put values in the namespace
9+
# that aren't pickleable (module imports are okay, they're removed automatically).
10+
#
11+
# All configuration values have a default value; values that are commented out
12+
# serve to show the default value.
13+
14+
import sys, os
15+
16+
# If your extensions are in another directory, add it here. If the directory
17+
# is relative to the documentation root, use os.path.abspath to make it
18+
# absolute, like shown here.
19+
sys.path.append(os.path.abspath('sphinxext'))
20+
21+
# Import support for ipython console session syntax highlighting (lives
22+
# in the sphinxext directory defined above)
23+
import ipython_console_highlighting
24+
25+
# General configuration
26+
# ---------------------
27+
28+
# Add any Sphinx extension module names here, as strings. They can be extensions
29+
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
30+
extensions = ['mathpng', 'sphinx.ext.autodoc']
31+
32+
# Add any paths that contain templates here, relative to this directory.
33+
templates_path = ['_templates']
34+
35+
# The suffix of source filenames.
36+
source_suffix = '.rst'
37+
38+
# The master toctree document.
39+
master_doc = 'index'
40+
41+
# General substitutions.
42+
project = 'Matplotlib'
43+
copyright = '2008, John Hunter, Darren Dale, Michael Droettboom'
44+
45+
# The default replacements for |version| and |release|, also used in various
46+
# other places throughout the built documents.
47+
#
48+
# The short X.Y version.
49+
version = '0.98'
50+
# The full version, including alpha/beta/rc tags.
51+
release = '0.98pre'
52+
53+
# There are two options for replacing |today|: either, you set today to some
54+
# non-false value, then it is used:
55+
#today = ''
56+
# Else, today_fmt is used as the format for a strftime call.
57+
today_fmt = '%B %d, %Y'
58+
59+
# List of documents that shouldn't be included in the build.
60+
unused_docs = []
61+
62+
# If true, '()' will be appended to :func: etc. cross-reference text.
63+
#add_function_parentheses = True
64+
65+
# If true, the current module name will be prepended to all description
66+
# unit titles (such as .. function::).
67+
#add_module_names = True
68+
69+
# If true, sectionauthor and moduleauthor directives will be shown in the
70+
# output. They are ignored by default.
71+
#show_authors = False
72+
73+
# The name of the Pygments (syntax highlighting) style to use.
74+
pygments_style = 'sphinx'
75+
76+
77+
# Options for HTML output
78+
# -----------------------
79+
80+
# The style sheet to use for HTML and HTML Help pages. A file of that name
81+
# must exist either in Sphinx' static/ path, or in one of the custom paths
82+
# given in html_static_path.
83+
html_style = 'default.css'
84+
85+
# The name for this set of Sphinx documents. If None, it defaults to
86+
# "<project> v<release> documentation".
87+
#html_title = None
88+
89+
# The name of an image file (within the static path) to place at the top of
90+
# the sidebar.
91+
#html_logo = 'logo.png'
92+
93+
# Add any paths that contain custom static files (such as style sheets) here,
94+
# relative to this directory. They are copied after the builtin static files,
95+
# so a file named "default.css" will overwrite the builtin "default.css".
96+
html_static_path = ['_static']
97+
98+
# If nonempty, this is the file name suffix for generated HTML files. The
99+
# default is ``".html"``.
100+
#html_file_suffix = '.xhtml'
101+
102+
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
103+
# using the given strftime format.
104+
html_last_updated_fmt = '%b %d, %Y'
105+
106+
# If true, SmartyPants will be used to convert quotes and dashes to
107+
# typographically correct entities.
108+
#html_use_smartypants = True
109+
110+
# Custom sidebar templates, maps document names to template names.
111+
#html_sidebars = {}
112+
113+
# Additional templates that should be rendered to pages, maps page names to
114+
# template names.
115+
#html_additional_pages = {}
116+
117+
# If false, no module index is generated.
118+
#html_use_modindex = True
119+
120+
# If true, the reST sources are included in the HTML build as _sources/<name>.
121+
#html_copy_source = True
122+
123+
# If true, an OpenSearch description file will be output, and all pages will
124+
# contain a <link> tag referring to it.
125+
html_use_opensearch = 'False'
126+
127+
# Output file base name for HTML help builder.
128+
htmlhelp_basename = 'Matplotlibdoc'
129+
130+
131+
# Options for LaTeX output
132+
# ------------------------
133+
134+
# The paper size ('letter' or 'a4').
135+
latex_paper_size = 'letter'
136+
137+
# The font size ('10pt', '11pt' or '12pt').
138+
latex_font_size = '11pt'
139+
140+
# Grouping the document tree into LaTeX files. List of tuples
141+
# (source start file, target name, title, author, document class [howto/manual]).
142+
latex_documents = [
143+
('index', 'Matplotlib.tex', 'Matplotlib', 'John Hunter, Darren Dale', 'Michael Droettboom', 'manual'),
144+
]
145+
146+
# The name of an image file (relative to this directory) to place at the top of
147+
# the title page.
148+
latex_logo = None
149+
150+
# Additional stuff for the LaTeX preamble.
151+
latex_preamble = ''
152+
153+
# Documents to append as an appendix to all manuals.
154+
latex_appendices = []
155+
156+
# If false, no module index is generated.
157+
latex_use_modindex = True
158+
159+
latex_use_parts = True

docs/devel/add_new_projection.rst

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
***********************************************
2+
Adding new scales and projections to matplotlib
3+
***********************************************
4+
5+
.. ::author Michael Droettboom
6+
7+
Matplotlib supports the addition of custom procedures that transform
8+
the data before it is displayed.
9+
10+
There is an important distinction between two kinds of
11+
transformations. Separable transformations, working on a single
12+
dimension, are called "scales", and non-separable transformations,
13+
that handle data in two or more dimensions at a time, are called
14+
"projections".
15+
16+
From the user's perspective, the scale of a plot can be set with
17+
:meth:`~matplotlib.axes.Axes.set_xscale` and
18+
:meth:`~matplotlib.axes.Axes.set_xscale`. Projections can be chosen
19+
using the ``projection`` keyword argument to the
20+
:func:`~matplotlib.pylab.plot` or :func:`~matplotlib.pylab.subplot`
21+
functions, e.g.::
22+
23+
plot(x, y, projection="custom")
24+
25+
This document is intended for developers and advanced users who need
26+
to create new scales and projections for matplotlib. The necessary
27+
code for scales and projections can be included anywhere: directly
28+
within a plot script, in third-party code, or in the matplotlib source
29+
tree itself.
30+
31+
32+
Creating a new scale
33+
====================
34+
35+
Adding a new scale consists of defining a subclass of
36+
:class:`matplotlib.scale.ScaleBase`, that includes the following
37+
elements:
38+
39+
- A transformation from data coordinates into display coordinates.
40+
41+
- An inverse of that transformation. This is used, for example, to
42+
convert mouse positions from screen space back into data space.
43+
44+
- A function to limit the range of the axis to acceptable values
45+
(``limit_range_for_scale()``). A log scale, for instance, would
46+
prevent the range from including values less than or equal to
47+
zero.
48+
49+
- Locators (major and minor) that determine where to place ticks in
50+
the plot, and optionally, how to adjust the limits of the plot to
51+
some "good" values. Unlike ``limit_range_for_scale()``, which is
52+
always enforced, the range setting here is only used when
53+
automatically setting the range of the plot.
54+
55+
- Formatters (major and minor) that specify how the tick labels
56+
should be drawn.
57+
58+
Once the class is defined, it must be registered with matplotlib so
59+
that the user can select it.
60+
61+
A full-fledged and heavily annotated example is in
62+
:file:`examples/api/custom_scale_example.py`. There are also some classes
63+
in :mod:`matplotlib.scale` that may be used as starting points.
64+
65+
66+
Creating a new projection
67+
=========================
68+
69+
Adding a new projection consists of defining a subclass of
70+
:class:`matplotlib.axes.Axes`, that includes the following elements:
71+
72+
- A transformation from data coordinates into display coordinates.
73+
74+
- An inverse of that transformation. This is used, for example, to
75+
convert mouse positions from screen space back into data space.
76+
77+
- Transformations for the gridlines, ticks and ticklabels. Custom
78+
projections will often need to place these elements in special
79+
locations, and matplotlib has a facility to help with doing so.
80+
81+
- Setting up default values (overriding
82+
:meth:`~matplotlib.axes.Axes.cla`), since the defaults for a
83+
rectilinear axes may not be appropriate.
84+
85+
- Defining the shape of the axes, for example, an elliptical axes,
86+
that will be used to draw the background of the plot and for
87+
clipping any data elements.
88+
89+
- Defining custom locators and formatters for the projection. For
90+
example, in a geographic projection, it may be more convenient to
91+
display the grid in degrees, even if the data is in radians.
92+
93+
- Set up interactive panning and zooming. This is left as an
94+
"advanced" feature left to the reader, but there is an example of
95+
this for polar plots in :mod:`matplotlib.projections.polar`.
96+
97+
- Any additional methods for additional convenience or features.
98+
99+
Once the class is defined, it must be registered with matplotlib
100+
so that the user can select it.
101+
102+
A full-fledged and heavily annotated example is in
103+
:file:`examples/api/custom_projection_example.py`. The polar plot
104+
functionality in :mod:`matplotlib.projections.polar` may also be of
105+
interest.

0 commit comments

Comments
 (0)
0