You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(115) |
Aug
(120) |
Sep
(137) |
Oct
(170) |
Nov
(461) |
Dec
(263) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(120) |
Feb
(74) |
Mar
(35) |
Apr
(74) |
May
(245) |
Jun
(356) |
Jul
(240) |
Aug
(115) |
Sep
(78) |
Oct
(225) |
Nov
(98) |
Dec
(271) |
| 2009 |
Jan
(132) |
Feb
(84) |
Mar
(74) |
Apr
(56) |
May
(90) |
Jun
(79) |
Jul
(83) |
Aug
(296) |
Sep
(214) |
Oct
(76) |
Nov
(82) |
Dec
(66) |
| 2010 |
Jan
(46) |
Feb
(58) |
Mar
(51) |
Apr
(77) |
May
(58) |
Jun
(126) |
Jul
(128) |
Aug
(64) |
Sep
(50) |
Oct
(44) |
Nov
(48) |
Dec
(54) |
| 2011 |
Jan
(68) |
Feb
(52) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <jd...@us...> - 2008-06-20 14:06:33
|
Revision: 5611
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5611&view=rev
Author: jdh2358
Date: 2008-06-20 07:05:42 -0700 (Fri, 20 Jun 2008)
Log Message:
-----------
fixed pixel border bug for composite images (eg layer_image.py)
Modified Paths:
--------------
trunk/matplotlib/MANIFEST.in
trunk/matplotlib/examples/api/mathtext_asarray.py
trunk/matplotlib/lib/matplotlib/axes.py
trunk/matplotlib/lib/matplotlib/figure.py
Added Paths:
-----------
trunk/matplotlib/examples/widgets/README.txt
Removed Paths:
-------------
trunk/matplotlib/examples/widgets/README
Modified: trunk/matplotlib/MANIFEST.in
===================================================================
--- trunk/matplotlib/MANIFEST.in 2008-06-20 13:30:18 UTC (rev 5610)
+++ trunk/matplotlib/MANIFEST.in 2008-06-20 14:05:42 UTC (rev 5611)
@@ -14,8 +14,8 @@
include lib/matplotlib/mpl-data/fonts/pdfcorefonts/*
include lib/matplotlib/mpl-data/fonts/afm/*
recursive-include license LICENSE*
-recursive-include examples README *.py
-prune examples/_tmp_*
+recursive-include examples *
+recursive-include doc *
recursive-include src *.cpp *.c *.h
recursive-include CXX *.cxx *.hxx *.c *.h
recursive-include agg24 *
Modified: trunk/matplotlib/examples/api/mathtext_asarray.py
===================================================================
--- trunk/matplotlib/examples/api/mathtext_asarray.py 2008-06-20 13:30:18 UTC (rev 5610)
+++ trunk/matplotlib/examples/api/mathtext_asarray.py 2008-06-20 14:05:42 UTC (rev 5611)
@@ -5,15 +5,20 @@
import numpy as np
import matplotlib.mathtext as mathtext
import matplotlib.pyplot as plt
+import matplotlib
+matplotlib.rc('image', origin='upper')
parser = mathtext.MathTextParser("Bitmap")
parser.to_png('test2.png', r'$\left[\left\lfloor\frac{5}{\frac{\left(3\right)}{4}} y\right)\right]$', color='green', fontsize=14, dpi=100)
-rgba = parser.to_rgba(r'IQ: $\sigma_i=15$', color='blue', fontsize=20, dpi=200)
+rgba1, depth1 = parser.to_rgba(r'IQ: $\sigma_i=15$', color='blue', fontsize=20, dpi=200)
+rgba2, depth2 = parser.to_rgba(r'some other string', color='red', fontsize=20, dpi=200)
fig = plt.figure()
-fig.figimage(rgba.astype(float)/255., 100, 100)
+fig.figimage(rgba1.astype(float)/255., 100, 100)
+fig.figimage(rgba2.astype(float)/255., 100, 300)
+
plt.show()
Deleted: trunk/matplotlib/examples/widgets/README
===================================================================
--- trunk/matplotlib/examples/widgets/README 2008-06-20 13:30:18 UTC (rev 5610)
+++ trunk/matplotlib/examples/widgets/README 2008-06-20 14:05:42 UTC (rev 5611)
@@ -1,2 +0,0 @@
-Examples of how to write primitive, but GUI agnoistic, widgets in
-matplotlib
Copied: trunk/matplotlib/examples/widgets/README.txt (from rev 5596, trunk/matplotlib/examples/widgets/README)
===================================================================
--- trunk/matplotlib/examples/widgets/README.txt (rev 0)
+++ trunk/matplotlib/examples/widgets/README.txt 2008-06-20 14:05:42 UTC (rev 5611)
@@ -0,0 +1,2 @@
+Examples of how to write primitive, but GUI agnoistic, widgets in
+matplotlib
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-06-20 13:30:18 UTC (rev 5610)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-06-20 14:05:42 UTC (rev 5611)
@@ -1436,15 +1436,18 @@
for im in self.images if im.get_visible()]
- im = mimage.from_images(self.bbox.height*mag,
- self.bbox.width*mag,
+ l, b, r, t = self.bbox.extents
+ width = mag*((round(r) + 0.5) - (round(l) - 0.5))
+ height = mag*((round(t) + 0.5) - (round(b) - 0.5))
+ im = mimage.from_images(height,
+ width,
ims)
im.is_grayscale = False
l, b, w, h = self.bbox.bounds
# composite images need special args so they will not
# respect z-order for now
renderer.draw_image(
- l, b, im, self.bbox,
+ round(l), round(b), im, self.bbox,
self.axesPatch.get_path(),
self.axesPatch.get_transform())
Modified: trunk/matplotlib/lib/matplotlib/figure.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/figure.py 2008-06-20 13:30:18 UTC (rev 5610)
+++ trunk/matplotlib/lib/matplotlib/figure.py 2008-06-20 14:05:42 UTC (rev 5611)
@@ -796,6 +796,7 @@
if len(self.images)<=1 or renderer.option_image_nocomposite() or not allequal([im.origin for im in self.images]):
for im in self.images:
+ print 'drawing', im
im.draw(renderer)
else:
# make a composite image blending alpha
@@ -809,8 +810,12 @@
ims)
im.is_grayscale = False
l, b, w, h = self.bbox.bounds
+ clippath, affine = self.get_transformed_clip_path_and_affine()
+ print 'compodite'
+ print 'clippath', affine
+ print 'affine', affine
renderer.draw_image(l, b, im, self.bbox,
- *self.get_transformed_clip_path_and_affine())
+ clippath, affine)
# render the axes
for a in self.axes: a.draw(renderer)
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: <mme...@us...> - 2008-06-20 11:58:04
|
Revision: 5609
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5609&view=rev
Author: mmetz_bn
Date: 2008-06-20 04:58:01 -0700 (Fri, 20 Jun 2008)
Log Message:
-----------
Oops: bug fixed Polygon set_closed
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/patches.py
Modified: trunk/matplotlib/lib/matplotlib/patches.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/patches.py 2008-06-20 11:54:55 UTC (rev 5608)
+++ trunk/matplotlib/lib/matplotlib/patches.py 2008-06-20 11:58:01 UTC (rev 5609)
@@ -577,7 +577,7 @@
xy = np.concatenate([xy, [xy[0]]])
else:
if len(xy)>2 and (xy[0]==xy[-1]).all():
- xy = xy[0:-2]
+ xy = xy[0:-1]
self._set_xy(xy)
def _get_xy(self):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mme...@us...> - 2008-06-20 11:55:01
|
Revision: 5608
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5608&view=rev
Author: mmetz_bn
Date: 2008-06-20 04:54:55 -0700 (Fri, 20 Jun 2008)
Log Message:
-----------
Added get/set_closed to Polygon
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/patches.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-06-20 10:46:12 UTC (rev 5607)
+++ trunk/matplotlib/CHANGELOG 2008-06-20 11:54:55 UTC (rev 5608)
@@ -1,3 +1,6 @@
+2008-06-20 Added set/get_closed method to Polygon; fixes error
+ in hist - MM
+
2008-06-19 Use relative font sizes (e.g. 'medium' and 'large') in
rcsetup.py and matplotlibrc.template so that text will
be scaled by default when changing rcParams['font.size'] -
Modified: trunk/matplotlib/lib/matplotlib/patches.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/patches.py 2008-06-20 10:46:12 UTC (rev 5607)
+++ trunk/matplotlib/lib/matplotlib/patches.py 2008-06-20 11:54:55 UTC (rev 5608)
@@ -558,14 +558,28 @@
"""
Patch.__init__(self, **kwargs)
xy = np.asarray(xy, np.float_)
- if closed and len(xy) and (xy[0] != xy[-1]).any():
- xy = np.concatenate([xy, [xy[0]]])
self._path = Path(xy)
+ self.set_closed(closed)
+
__init__.__doc__ = cbook.dedent(__init__.__doc__) % artist.kwdocd
def get_path(self):
return self._path
+ def get_closed(self):
+ return self._closed
+
+ def set_closed(self, closed):
+ self._closed = closed
+ xy = self._get_xy()
+ if closed:
+ if len(xy) and (xy[0] != xy[-1]).any():
+ xy = np.concatenate([xy, [xy[0]]])
+ else:
+ if len(xy)>2 and (xy[0]==xy[-1]).all():
+ xy = xy[0:-2]
+ self._set_xy(xy)
+
def _get_xy(self):
return self._path.vertices
def _set_xy(self, vertices):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-06-20 10:46:32
|
Revision: 5607
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5607&view=rev
Author: jdh2358
Date: 2008-06-20 03:46:12 -0700 (Fri, 20 Jun 2008)
Log Message:
-----------
added get edgecolor accessor method to collections
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/collections.py
Modified: trunk/matplotlib/lib/matplotlib/collections.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/collections.py 2008-06-20 07:03:22 UTC (rev 5606)
+++ trunk/matplotlib/lib/matplotlib/collections.py 2008-06-20 10:46:12 UTC (rev 5607)
@@ -309,6 +309,10 @@
return self._facecolors
get_facecolors = get_facecolor
+ def get_edgecolor(self):
+ return self._edgecolors
+ get_edgecolors = get_edgecolor
+
def set_edgecolor(self, c):
"""
Set the edgecolor(s) of the collection. *c* can be a
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-06-20 07:03:26
|
Revision: 5606
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5606&view=rev
Author: efiring
Date: 2008-06-20 00:03:22 -0700 (Fri, 20 Jun 2008)
Log Message:
-----------
Use relative font sizes by default so they will scale with font.size
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/rcsetup.py
trunk/matplotlib/matplotlibrc.template
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-06-20 05:23:08 UTC (rev 5605)
+++ trunk/matplotlib/CHANGELOG 2008-06-20 07:03:22 UTC (rev 5606)
@@ -1,3 +1,8 @@
+2008-06-19 Use relative font sizes (e.g. 'medium' and 'large') in
+ rcsetup.py and matplotlibrc.template so that text will
+ be scaled by default when changing rcParams['font.size'] -
+ EF
+
2008-06-17 Add a generic PatchCollection class that can contain any
kind of patch. - MGD
@@ -24,7 +29,7 @@
sets '_nolegend_' for the other patch labels. This lets
autolegend work as expected for hist and bar - see
https://sourceforge.net/tracker/index.php?func=detail&aid=1986597&group_id=80706&atid=560720
- JDH
+ JDH
2008-06-10 Fix text baseline alignment bug. [ 1985420 ] Repair of
baseline alignment in Text._get_layout. Thanks Stan West -
Modified: trunk/matplotlib/lib/matplotlib/rcsetup.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/rcsetup.py 2008-06-20 05:23:08 UTC (rev 5605)
+++ trunk/matplotlib/lib/matplotlib/rcsetup.py 2008-06-20 07:03:22 UTC (rev 5606)
@@ -394,9 +394,9 @@
'axes.facecolor' : ['w', validate_color], # background color; white
'axes.edgecolor' : ['k', validate_color], # edge color; black
'axes.linewidth' : [1.0, validate_float], # edge linewidth
- 'axes.titlesize' : [14, validate_fontsize], # fontsize of the axes title
+ 'axes.titlesize' : ['large', validate_fontsize], # fontsize of the axes title
'axes.grid' : [False, validate_bool], # display grid or not
- 'axes.labelsize' : [12, validate_fontsize], # fontsize of the x any y labels
+ 'axes.labelsize' : ['medium', validate_fontsize], # fontsize of the x any y labels
'axes.labelcolor' : ['k', validate_color], # color of axis label
'axes.formatter.limits' : [[-7, 7], validate_nseq_int(2)],
# use scientific notation if log10
@@ -409,7 +409,7 @@
'legend.loc' : ['upper right',validate_legend_loc], # at some point, this should be changed to 'best'
'legend.isaxes' : [True,validate_bool], # this option is internally ignored - it never served any useful purpose
'legend.numpoints' : [2, validate_int], # the number of points in the legend line
- 'legend.fontsize' : [14, validate_fontsize],
+ 'legend.fontsize' : ['large', validate_fontsize],
'legend.pad' : [0.2, validate_float], # the fractional whitespace inside the legend border
'legend.markerscale' : [1.0, validate_float], # the relative size of legend markers vs. original
@@ -427,7 +427,7 @@
'xtick.major.pad' : [4, validate_float], # distance to label in points
'xtick.minor.pad' : [4, validate_float], # distance to label in points
'xtick.color' : ['k', validate_color], # color of the xtick labels
- 'xtick.labelsize' : [12, validate_fontsize], # fontsize of the xtick labels
+ 'xtick.labelsize' : ['medium', validate_fontsize], # fontsize of the xtick labels
'xtick.direction' : ['in', str], # direction of xticks
'ytick.major.size' : [4, validate_float], # major ytick size in points
@@ -435,7 +435,7 @@
'ytick.major.pad' : [4, validate_float], # distance to label in points
'ytick.minor.pad' : [4, validate_float], # distance to label in points
'ytick.color' : ['k', validate_color], # color of the ytick labels
- 'ytick.labelsize' : [12, validate_fontsize], # fontsize of the ytick labels
+ 'ytick.labelsize' : ['medium', validate_fontsize], # fontsize of the ytick labels
'ytick.direction' : ['in', str], # direction of yticks
'grid.color' : ['k', validate_color], # grid color
Modified: trunk/matplotlib/matplotlibrc.template
===================================================================
--- trunk/matplotlib/matplotlibrc.template 2008-06-20 05:23:08 UTC (rev 5605)
+++ trunk/matplotlib/matplotlibrc.template 2008-06-20 07:03:22 UTC (rev 5606)
@@ -185,8 +185,8 @@
#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.titlesize : large # fontsize of the axes title
+#axes.labelsize : medium # 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)
@@ -203,7 +203,7 @@
#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.labelsize : medium # fontsize of the tick labels
#xtick.direction : in # direction: in or out
#ytick.major.size : 4 # major tick size in points
@@ -211,7 +211,7 @@
#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.labelsize : medium # fontsize of the tick labels
#ytick.direction : in # direction: in or out
@@ -223,7 +223,7 @@
### Legend
#legend.isaxes : True
#legend.numpoints : 2 # the number of points in the legend line
-#legend.fontsize : 14
+#legend.fontsize : large
#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
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-06-20 05:23:26
|
Revision: 5605
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5605&view=rev
Author: efiring
Date: 2008-06-19 22:23:08 -0700 (Thu, 19 Jun 2008)
Log Message:
-----------
Merged revisions 5603 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint
........
r5603 | efiring | 2008-06-19 18:51:47 -1000 (Thu, 19 Jun 2008) | 2 lines
Make set_default_size set the variable actually being used elsewhere
........
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/font_manager.py
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-5573
+ /branches/v0_91_maint:1-5573,5603
Modified: trunk/matplotlib/lib/matplotlib/font_manager.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/font_manager.py 2008-06-20 04:53:28 UTC (rev 5604)
+++ trunk/matplotlib/lib/matplotlib/font_manager.py 2008-06-20 05:23:08 UTC (rev 5605)
@@ -925,7 +925,7 @@
def set_default_size(self, size):
"Set the default font size in points. The initial value is set by font.size in rc."
- self.__default_size = size
+ self.default_size = size
def update_fonts(self, filenames):
"""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-06-20 04:53:46
|
Revision: 5604
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5604&view=rev
Author: efiring
Date: 2008-06-19 21:53:28 -0700 (Thu, 19 Jun 2008)
Log Message:
-----------
Don't try to render a line collection with no segments
Modified Paths:
--------------
branches/v0_91_maint/lib/matplotlib/collections.py
Modified: branches/v0_91_maint/lib/matplotlib/collections.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/collections.py 2008-06-20 04:51:47 UTC (rev 5603)
+++ branches/v0_91_maint/lib/matplotlib/collections.py 2008-06-20 04:53:28 UTC (rev 5604)
@@ -760,6 +760,8 @@
transoffset.freeze()
segments = self._segments
+ if not segments:
+ return
offsets = self._offsets
if self.have_units():
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-06-20 04:52:12
|
Revision: 5603
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5603&view=rev
Author: efiring
Date: 2008-06-19 21:51:47 -0700 (Thu, 19 Jun 2008)
Log Message:
-----------
Make set_default_size set the variable actually being used elsewhere
Modified Paths:
--------------
branches/v0_91_maint/lib/matplotlib/font_manager.py
Modified: branches/v0_91_maint/lib/matplotlib/font_manager.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/font_manager.py 2008-06-20 02:17:02 UTC (rev 5602)
+++ branches/v0_91_maint/lib/matplotlib/font_manager.py 2008-06-20 04:51:47 UTC (rev 5603)
@@ -921,7 +921,7 @@
def set_default_size(self, size):
"Set the default font size in points. The initial value is set by font.size in rc."
- self.__default_size = size
+ self.default_size = size
def update_fonts(self, filenames):
"""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cm...@us...> - 2008-06-20 02:17:08
|
Revision: 5602
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5602&view=rev
Author: cmoad
Date: 2008-06-19 19:17:02 -0700 (Thu, 19 Jun 2008)
Log Message:
-----------
updated figure dpi call
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_cocoaagg.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_cocoaagg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_cocoaagg.py 2008-06-19 19:55:41 UTC (rev 5601)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_cocoaagg.py 2008-06-20 02:17:02 UTC (rev 5602)
@@ -134,7 +134,7 @@
def windowDidResize_(self, sender):
w,h = self.bounds().size
- dpi = self.canvas.figure.dpi.get()
+ dpi = self.canvas.figure.dpi
self.canvas.figure.set_size_inches(w / dpi, h / dpi)
self.canvas.draw()
self.updatePlot()
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-19 19:53:55
|
Revision: 5600
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5600&view=rev
Author: mdboom
Date: 2008-06-19 12:53:12 -0700 (Thu, 19 Jun 2008)
Log Message:
-----------
docstring formatting fixes.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/artist.py
Modified: trunk/matplotlib/lib/matplotlib/artist.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/artist.py 2008-06-19 19:24:45 UTC (rev 5599)
+++ trunk/matplotlib/lib/matplotlib/artist.py 2008-06-19 19:53:12 UTC (rev 5600)
@@ -23,7 +23,8 @@
class Artist(object):
"""
- Abstract base class for someone who renders into a FigureCanvas
+ Abstract base class for someone who renders into a
+ :class:`FigureCanvas`.
"""
aname = 'Artist'
@@ -52,12 +53,15 @@
def remove(self):
"""
- Remove the artist from the figure if possible. The effect will not
- be visible until the figure is redrawn, e.g., with ax.draw_idle().
- Call ax.relim() to update the axes limits if desired.
+ Remove the artist from the figure if possible. The effect
+ will not be visible until the figure is redrawn, e.g., with
+ :meth:`matplotlib.axes.Axes.draw_idle`. Call
+ :meth:`matplotlib.axes.Axes.relim` to update the axes limits
+ if desired.
- Note: relim() will not see collections even if the collection
- was added to axes with autolim=True.
+ Note: :meth:`~matplotlib.axes.Axes.relim` will not see
+ collections even if the collection was added to axes with
+ *autolim* = True.
Note: there is no support for removing the artist's legend entry.
"""
@@ -134,16 +138,18 @@
def set_transform(self, t):
"""
- set the Transformation instance used by this artist
-
- ACCEPTS: a matplotlib.transform transformation instance
+ Set the :class:`~matplotlib.transforms.Transform` instance
+ used by this artist.
"""
self._transform = t
self._transformSet = True
self.pchanged()
def get_transform(self):
- 'return the Transformation instance used by this artist'
+ """
+ Return the :class:`~matplotlib.transforms.Transform`
+ instance used by this artist.
+ """
if self._transform is None:
self._transform = IdentityTransform()
return self._transform
@@ -228,26 +234,26 @@
None - picking is disabled for this artist (default)
boolean - if True then picking will be enabled and the
- artist will fire a pick event if the mouse event is over
- the artist
+ artist will fire a pick event if the mouse event is over
+ the artist
float - if picker is a number it is interpreted as an
- epsilon tolerance in points and the the artist will fire
- off an event if it's data is within epsilon of the mouse
- event. For some artists like lines and patch collections,
- the artist may provide additional data to the pick event
- that is generated, eg the indices of the data within
- epsilon of the pick event
+ epsilon tolerance in points and the the artist will fire
+ off an event if it's data is within epsilon of the mouse
+ event. For some artists like lines and patch collections,
+ the artist may provide additional data to the pick event
+ that is generated, eg the indices of the data within
+ epsilon of the pick event
function - if picker is callable, it is a user supplied
- function which determines whether the artist is hit by the
- mouse event.
+ function which determines whether the artist is hit by the
+ mouse event::
hit, props = picker(artist, mouseevent)
- to determine the hit test. if the mouse event is over the
- artist, return hit=True and props is a dictionary of
- properties you want added to the PickEvent attributes
+ to determine the hit test. if the mouse event is over the
+ artist, return hit=True and props is a dictionary of
+ properties you want added to the PickEvent attributes.
ACCEPTS: [None|float|boolean|callable]
"""
@@ -288,17 +294,18 @@
"""
Set the artist's clip path, which may be:
- a) a Patch (or subclass) instance
+ a) a :class:`~matplotlib.patches.Patch` (or subclass) instance
- b) a Path instance, in which cas aoptional transform may
- be provided, which will be applied to the path before using it
- for clipping.
+ b) a :class:`~matplotlib.path.Path` instance, in which case
+ an optional :class:`~matplotlib.transforms.Transform`
+ instance may be provided, which will be applied to the
+ path before using it for clipping.
- c) None, to remove the clipping path
+ c) *None*, to remove the clipping path
For efficiency, if the path happens to be an axis-aligned
rectangle, this method will set the clipping box to the
- corresponding rectangle and set the clipping path to None.
+ corresponding rectangle and set the clipping path to *None*.
ACCEPTS: a Path instance and a Transform instance, a Patch
instance, or None
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: <jd...@us...> - 2008-06-19 19:13:23
|
Revision: 5598
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5598&view=rev
Author: jdh2358
Date: 2008-06-19 12:13:15 -0700 (Thu, 19 Jun 2008)
Log Message:
-----------
replaced gtk timeout example
Added Paths:
-----------
trunk/matplotlib/examples/animation/gtk_timeout.py
Removed Paths:
-------------
trunk/matplotlib/examples/animation/dynamic_demo.py
Deleted: trunk/matplotlib/examples/animation/dynamic_demo.py
===================================================================
--- trunk/matplotlib/examples/animation/dynamic_demo.py 2008-06-19 17:23:34 UTC (rev 5597)
+++ trunk/matplotlib/examples/animation/dynamic_demo.py 2008-06-19 19:13:15 UTC (rev 5598)
@@ -1,27 +0,0 @@
-#!/usr/bin/env python
-
-import gobject
-import gtk
-
-from pylab import *
-
-
-fig = figure(1)
-ind = arange(30)
-X = rand(len(ind),10)
-lines = plot(X[:,0], 'o')
-
-manager = get_current_fig_manager()
-def updatefig(*args):
- lines[0].set_data(ind, X[:,updatefig.count])
- manager.canvas.draw()
- updatefig.count += 1
- if updatefig.count<10:
- return True
- else:
- return False
-
-updatefig.count = 0
-
-gobject.timeout_add(300, updatefig)
-show()
Added: trunk/matplotlib/examples/animation/gtk_timeout.py
===================================================================
--- trunk/matplotlib/examples/animation/gtk_timeout.py (rev 0)
+++ trunk/matplotlib/examples/animation/gtk_timeout.py 2008-06-19 19:13:15 UTC (rev 5598)
@@ -0,0 +1,19 @@
+import gobject
+import numpy as np
+import matplotlib
+matplotlib.use('GTKAgg')
+
+import matplotlib.pyplot as plt
+
+fig = plt.figure()
+ax = fig.add_subplot(111)
+line, = ax.plot(np.random.rand(10))
+ax.set_ylim(0, 1)
+
+def update():
+ line.set_ydata(np.random.rand(10))
+ fig.canvas.draw_idle()
+ return True # return False to terminate the updates
+
+gobject.timeout_add(100, update) # you can also use idle_add to update when gtk is idle
+plt.show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-06-19 17:24:25
|
Revision: 5597
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5597&view=rev
Author: jdh2358
Date: 2008-06-19 10:23:34 -0700 (Thu, 19 Jun 2008)
Log Message:
-----------
added support for custom positioning of axis labels
Modified Paths:
--------------
trunk/matplotlib/doc/faq/howto_faq.rst
trunk/matplotlib/lib/matplotlib/axis.py
Added Paths:
-----------
trunk/matplotlib/doc/pyplots/align_ylabels.py
Modified: trunk/matplotlib/doc/faq/howto_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/howto_faq.rst 2008-06-19 16:54:54 UTC (rev 5596)
+++ trunk/matplotlib/doc/faq/howto_faq.rst 2008-06-19 17:23:34 UTC (rev 5597)
@@ -113,6 +113,24 @@
``markersize``. For more information on configuring ticks, see
:ref:`axis-container` and :ref:`tick-container`.
+
+.. _howto-align-label:
+
+How do I align my ylabels across multiple subplots?
+===================================================
+
+If you have multiple subplots over one another, and the y data have
+different scales, you can often get ylabels that do not align
+vertically across the multiple subplots, which can be unattractive.
+By default, matplotlib positions the x location of the ylabel so that
+it does not overlap any of the y ticks. You can override this default
+behavior by specifying the coordinates of the label. The example
+below shows the default behavior in the left subplots, and the manual
+setting in the right subplots.
+
+.. plot:: align_ylabels.py
+ :include-source:
+
.. _howto-webapp:
How do I use matplotlib in a web application server?
Added: trunk/matplotlib/doc/pyplots/align_ylabels.py
===================================================================
--- trunk/matplotlib/doc/pyplots/align_ylabels.py (rev 0)
+++ trunk/matplotlib/doc/pyplots/align_ylabels.py 2008-06-19 17:23:34 UTC (rev 5597)
@@ -0,0 +1,35 @@
+import numpy as np
+import matplotlib.pyplot as plt
+
+box = dict(facecolor='yellow', pad=5, alpha=0.2)
+
+fig = plt.figure()
+fig.subplots_adjust(left=0.2, wspace=0.6)
+
+
+ax1 = fig.add_subplot(221)
+ax1.plot(2000*np.random.rand(10))
+ax1.set_title('ylabels not aligned')
+ax1.set_ylabel('misaligned 1', bbox=box)
+ax1.set_ylim(0, 2000)
+ax3 = fig.add_subplot(223)
+ax3.set_ylabel('misaligned 2',bbox=box)
+ax3.plot(np.random.rand(10))
+
+
+labelx = -0.3 # axes coords
+
+ax2 = fig.add_subplot(222)
+ax2.set_title('ylabels aligned')
+ax2.plot(2000*np.random.rand(10))
+ax2.set_ylabel('aligned 1', bbox=box)
+ax2.yaxis.set_label_coords(labelx, 0.5)
+ax2.set_ylim(0, 2000)
+
+ax4 = fig.add_subplot(224)
+ax4.plot(np.random.rand(10))
+ax4.set_ylabel('aligned 2', bbox=box)
+ax4.yaxis.set_label_coords(labelx, 0.5)
+
+
+plt.show()
Modified: trunk/matplotlib/lib/matplotlib/axis.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axis.py 2008-06-19 16:54:54 UTC (rev 5596)
+++ trunk/matplotlib/lib/matplotlib/axis.py 2008-06-19 17:23:34 UTC (rev 5597)
@@ -503,9 +503,9 @@
"""
Public attributes
- transData - transform data coords to display coords
- transAxis - transform axis coords to display coords
+ * transData - transform data coords to display coords
+ * transAxis - transform axis coords to display coords
"""
LABELPAD = 5
@@ -533,6 +533,7 @@
#self.major = dummy()
#self.minor = dummy()
+ self._autolabelpos = True
self.label = self._get_label()
self.offsetText = self._get_offset_text()
self.majorTicks = []
@@ -542,6 +543,29 @@
self.cla()
self.set_scale('linear')
+
+ def set_label_coords(self, x, y, transform=None):
+ """
+ Set the coordinates of the label. By default, the x
+ coordinate of the y label is determined by the tick label
+ bounding boxes, but this can lead to poor alignment of
+ multiple ylabels if there are multiple axes. Ditto for the y
+ coodinate of the x label.
+
+ You can also specify the coordinate system of the label with
+ the transform. If None, the default coordinate system will be
+ the axes coordinate system (0,0) is (left,bottom), (0.5, 0.5)
+ is middle, etc
+
+ """
+
+ self._autolabelpos = False
+ if transform is None:
+ transform = self.axes.transAxes
+
+ self.label.set_transform(transform)
+ self.label.set_position((x, y))
+
def get_transform(self):
return self._scale.get_transform()
@@ -703,7 +727,9 @@
# just the tick labels that actually overlap note we need a
# *copy* of the axis label box because we don't wan't to scale
# the actual bbox
+
self._update_label_position(ticklabelBoxes, ticklabelBoxes2)
+
self.label.draw(renderer)
self._update_offset_text_position(ticklabelBoxes, ticklabelBoxes2)
@@ -1139,8 +1165,9 @@
verticalalignment='top',
horizontalalignment='center',
)
+
label.set_transform( mtransforms.blended_transform_factory(
- self.axes.transAxes, mtransforms.IdentityTransform() ))
+ self.axes.transAxes, mtransforms.IdentityTransform() ))
self._set_artist_props(label)
self.label_position='bottom'
@@ -1184,7 +1211,7 @@
Update the label position based on the sequence of bounding
boxes of all the ticklabels
"""
-
+ if not self._autolabelpos: return
x,y = self.label.get_position()
if self.label_position == 'bottom':
if not len(bboxes):
@@ -1374,7 +1401,7 @@
rotation='vertical',
)
label.set_transform( mtransforms.blended_transform_factory(
- mtransforms.IdentityTransform(), self.axes.transAxes) )
+ mtransforms.IdentityTransform(), self.axes.transAxes) )
self._set_artist_props(label)
self.label_position='left'
@@ -1418,7 +1445,7 @@
Update the label position based on the sequence of bounding
boxes of all the ticklabels
"""
-
+ if not self._autolabelpos: return
x,y = self.label.get_position()
if self.label_position == 'left':
if not len(bboxes):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-06-19 16:55:24
|
Revision: 5596
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5596&view=rev
Author: jdh2358
Date: 2008-06-19 09:54:54 -0700 (Thu, 19 Jun 2008)
Log Message:
-----------
added auto subplots adj faq
Modified Paths:
--------------
trunk/matplotlib/Makefile
trunk/matplotlib/doc/faq/howto_faq.rst
trunk/matplotlib/doc/glossary/index.rst
trunk/matplotlib/doc/make.py
trunk/matplotlib/doc/users/installing.rst
Added Paths:
-----------
trunk/matplotlib/doc/pyplots/auto_subplots_adjust.py
Modified: trunk/matplotlib/Makefile
===================================================================
--- trunk/matplotlib/Makefile 2008-06-19 13:59:08 UTC (rev 5595)
+++ trunk/matplotlib/Makefile 2008-06-19 16:54:54 UTC (rev 5596)
@@ -39,7 +39,7 @@
rm -rf build;\
python make.py clean;\
svn up;\
- python make.py html latex sf;
+ python make.py html latex sf sfpdf;
Modified: trunk/matplotlib/doc/faq/howto_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/howto_faq.rst 2008-06-19 13:59:08 UTC (rev 5595)
+++ trunk/matplotlib/doc/faq/howto_faq.rst 2008-06-19 16:54:54 UTC (rev 5596)
@@ -54,6 +54,40 @@
`axes_demo.py <http://matplotlib.sf.net/examples/axes_demo.py>`_ for
an example of placing axes manually.
+.. _howto-auto-adjust:
+
+How do I automatically make room for my tick labels?
+====================================================
+
+In most use cases, it is enought to simpy change the subplots adjust
+parameters as described in :ref:`howto-subplots-adjust`. But in some
+cases, you don't know ahead of time what your tick labels will be, or
+how large they will be (data and labels outside your control may be
+being fed into your graphing application), and you may need to
+automatically adjust your subplot parameters based on the size of the
+tick labels. Any :class:`matplotlib.text.Text` instance can report
+its extent in window coordinates (a negative x coordinate is outside
+the window), but there is a rub.
+
+The :class:`matplotlib.backend_bases.RendererBase` instance, which is
+used to calculate the text size, is not known until the figure is
+drawn (:meth:`matplotlib.figure.Figure.draw`). After the window is
+drawn and the text instance knows its renderer, you can call
+:meth:`matplotlib.text.Text.get_window_extent``. One way to solve
+this chicken and egg problem is to wait until the figure is draw by
+connecting
+(:meth:`matplotlib.backend_bases.FigureCanvasBase.mpl_connect`) to the
+"on_draw" signal (:class:`~matplotlib.backend_bases.DrawEvent`) and
+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)
+
+.. plot:: auto_subplots_adjust.py
+ :include-source:
+
.. _howto-ticks:
How do I configure the tick linewidths?
Modified: trunk/matplotlib/doc/glossary/index.rst
===================================================================
--- trunk/matplotlib/doc/glossary/index.rst 2008-06-19 13:59:08 UTC (rev 5595)
+++ trunk/matplotlib/doc/glossary/index.rst 2008-06-19 16:54:54 UTC (rev 5596)
@@ -8,73 +8,138 @@
.. glossary::
AGG
- The Anti-Grain Geometry rendering engine, capable of rendering
- high-quality images.
+ The Anti-Grain Geometry (`Agg <http://antigrain.com>`_) rendering engine, capable of rendering
+ high-quality images
Cairo
- The Cairo graphics engine
+ The `Cairo graphics <http://cairographics.org>`_ engine
EPS
- Encapsulated Postscript
+ Encapsulated Postscript (`EPS <http://en.wikipedia.org/wiki/Encapsulated_PostScript>`_)
FLTK
- FLTK (pronounced "fulltick") is a cross-platform C++ GUI toolkit for
+ `FLTK <http://www.fltk.org/>`_ (pronounced "fulltick") is a cross-platform C++ GUI toolkit for
UNIX/Linux (X11), Microsoft Windows, and MacOS X
+ freetype
+ `freetype <http://www.freetype.org/>`_ is a font rasterization
+ library used by matplotlib which supports TrueType, Type 1, and
+ OpenType fonts.
+
+
GDK
The Gimp Drawing Kit for GTK+
GTK
- The GTK graphical user interface library
+ The GIMP Toolkit (`GTK <http://www.gtk.org/>`_) graphical user interface library
JPG
- A compression method and file format for photographic images
+ The Joint Photographic Experts Group (`JPEG
+ <http://en.wikipedia.org/wiki/Jpeg>`_) compression method and
+ file format for photographic images
+ numpy
+ `numpy <http://numpy.scipy.org>`_ is the standard numerical
+ array library for python, the successor to Numeric and numarray.
+ numpy provides fast operations for homogeneous data sets and
+ common mathematical operations like correlations, standard
+ deviation, fourier transforms, and convolutions.
+
PDF
- Adobe's Portable Document Format
+ Adobe's Portable Document Format (`PDF <http://en.wikipedia.org/wiki/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.
+ Portable Network Graphics (`PNG
+ <http://en.wikipedia.org/wiki/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
+ Postscript (`PS <http://en.wikipedia.org/wiki/PostScript>`_) is a
+ vector graphics ASCII text language widely used in printers and
+ publishing. Postscript was developerd by adobe systems and is
+ starting to show its age: for example is does not have an alpha
+ channel. PDF was designed in part as a next-generation document
+ format to replace postscript
+ pyfltk
+ `pyfltk <http://pyfltk.sourceforge.net/>`_ provides python
+ wrappers for the :term:`FLTK` widgets library for use with
+ FLTKAgg
+
+ pygtk
+ `pygtk <http://www.pygtk.org/>`_ provides python wrappers for
+ the :term:`GTK` widgets library for use with the GTK or GTKAgg
+ backend. Widely used on linux, and is often packages as
+ 'python-gtk2'
+
+ pyqt
+ `pyqt <http://wiki.python.org/moin/PyQt>`_ provides python
+ wrappers for the :term:`Qt` widgets library and is requied by
+ the matplotlib QtAgg and Qt4Agg backends. Widely used on linux
+ and windows; many linux distributions package this as
+ 'python-qt3' or 'python-qt4'.
+
+ python
+ `python <http://python.org>`_ is an object oriented interpreted
+ language widely used for scripting, application development, web
+ application servers, scientific computing and more.
+
Qt
- Qt is a cross-platform application framework for desktop and embedded
- development.
+ `Qt <http://trolltech.com/products/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.
+ `Qt4 <http://trolltech.com/products/qt/>`__ 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. See `raster graphics <http://en.wikipedia.org/wiki/Raster_graphics>`_
+ `Raster graphics
+ <http://en.wikipedia.org/wiki/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.
+ The Scalable Vector Graphics format (`SVG
+ <http://en.wikipedia.org/wiki/Svg>`_). An XML based vector
+ graphics format supported by many web browsers.
TIFF
- Tagged Image File Format
+ Tagged Image File Format (`TIFF
+ <http://en.wikipedia.org/wiki/Tagged_Image_File_Format>`_) is a
+ file format for storing images, including photographs and line
+ art.
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.
+ `Tk <http://www.tcl.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.
+ vector graphics
+ `vector graphics
+ <http://en.wikipedia.org/wiki/Vector_graphics>`_ use 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.
+
+ wxpython
+ `wxpython <http://www.wxpython.org/>`_ provides python wrappers
+ for the :term:`wxWidgets` library for use with the WX and WXAgg
+ backends. Widely used on linux, OS-X and windows, it is often
+ packaged by linux distributions as 'python-wxgtk'
+
wxWidgets
- A cross-platform GUI and tools library for GTK, MS Windows, and MacOS.
+ `WX <http://www.wxwidgets.org/>`_ is cross-platform GUI and
+ tools library for GTK, MS Windows, and MacOS. It uses native
+ widgets for each operating system, so applications will have the
+ look-and-feel that users on that operating system expect.
- 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. See `vector graphics <http://en.wikipedia.org/wiki/Vector_graphics>`_
Modified: trunk/matplotlib/doc/make.py
===================================================================
--- trunk/matplotlib/doc/make.py 2008-06-19 13:59:08 UTC (rev 5595)
+++ trunk/matplotlib/doc/make.py 2008-06-19 16:54:54 UTC (rev 5596)
@@ -17,8 +17,12 @@
def sf():
'push a copy to the sf site'
os.system('cd build; rsync -avz html jd...@ma...:/home/groups/m/ma/matplotlib/htdocs/doc/ -essh')
- os.system('cd build/latex; scp Matplotlib.pdf jd...@ma...:/home/groups/m/ma/matplotlib/htdocs/doc/')
+def sfpdf():
+ 'push a copy to the sf site'
+
+ #os.system('cd build/latex; scp Matplotlib.pdf jd...@ma...:/home/groups/m/ma/matplotlib/htdocs/doc/')
+
def figs():
os.system('cd users/figures/ && python make.py')
@@ -73,6 +77,7 @@
'latex':latex,
'clean':clean,
'sf':sf,
+ 'sfpdf':sfpdf,
'all':all,
}
Added: trunk/matplotlib/doc/pyplots/auto_subplots_adjust.py
===================================================================
--- trunk/matplotlib/doc/pyplots/auto_subplots_adjust.py (rev 0)
+++ trunk/matplotlib/doc/pyplots/auto_subplots_adjust.py 2008-06-19 16:54:54 UTC (rev 5596)
@@ -0,0 +1,19 @@
+import matplotlib.pyplot as plt
+
+fig = plt.figure()
+ax = fig.add_subplot(111)
+ax.plot(range(10))
+ax.set_yticks((2,5,7))
+labels = ax.set_yticklabels(('really, really, really', 'long', 'labels'))
+
+def on_draw(event):
+ 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
+
+fig.canvas.mpl_connect('draw_event', on_draw)
+
+plt.show()
Modified: trunk/matplotlib/doc/users/installing.rst
===================================================================
--- trunk/matplotlib/doc/users/installing.rst 2008-06-19 13:59:08 UTC (rev 5595)
+++ trunk/matplotlib/doc/users/installing.rst 2008-06-19 16:54:54 UTC (rev 5596)
@@ -14,18 +14,18 @@
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
+:term:`python` 2.4 (or later but not python3)
+ matplotlib requires python 2.4 or later (`download <http://www.python.org/download/>`__)
-numpy 1.1 (or later)
- array support for python
+:term:`numpy` 1.1 (or later)
+ array support for python (`download <http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103>`__)
libpng 1.1 (or later)
- library for loading and saving PNG files. libpng requires zlib. If
+ library for loading and saving :term:`PNG` files (`download <http://www.libpng.org/pub/png/libpng.html>`__). libpng requires zlib. If
you are a windows user, you can ignore this since we build support
- into the matplotlib single click installer.
+ into the matplotlib single click installer
-freetype 1.4 (or later)
+:term:`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.
@@ -37,25 +37,25 @@
:ref:`what-is-a-backend` for more details on the optional matplotlib
backends and the capabilities they provide
-tk 8.3 or later
+:term:`tk` 8.3 or later
The TCL/Tk widgets library used by the TkAgg backend
-pyqt 3.1 or later
+:term:`pyqt` 3.1 or later
The Qt3 widgets library python wrappers for the QtAgg backend
-pyqt 4.0 or later
+:term:`pyqt` 4.0 or later
The Qt4 widgets library python wrappersfor the Qt4Agg backend
-pygtk 2.2 or later
+:term:`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
+:term:`wxpython` 2.6 or later
The python wrappers for the wx widgets library for use with the WXAgg backend
-wxpython 2.8 or later
+:term:`wxpython` 2.8 or later
The python wrappers for the wx widgets library for use with the WX backend
-pyfltk 1.0 or later
+:term:`pyfltk` 1.0 or later
The python wrappers of the FLTK widgets library for use with FLTKAgg
**Required libraries that ship with matplotlib**
@@ -65,7 +65,7 @@
developers and packagers who may want to disable the matplotlib
version and ship a packaged version.
-agg2.4
+:term:`agg` 2.4
The antigrain C++ rendering engine
pytz 2007g or later
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: <md...@us...> - 2008-06-19 13:23:43
|
Revision: 5594
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5594&view=rev
Author: mdboom
Date: 2008-06-19 06:23:04 -0700 (Thu, 19 Jun 2008)
Log Message:
-----------
Fix rgrids and thetagrids.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/projections/polar.py
trunk/matplotlib/lib/matplotlib/pyplot.py
Modified: trunk/matplotlib/lib/matplotlib/projections/polar.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/projections/polar.py 2008-06-19 13:16:16 UTC (rev 5593)
+++ trunk/matplotlib/lib/matplotlib/projections/polar.py 2008-06-19 13:23:04 UTC (rev 5594)
@@ -316,6 +316,7 @@
self._theta_label2_position.clear().translate(0.0, 1.0 / frac)
for t in self.xaxis.get_ticklabels():
t.update(kwargs)
+ return self.xaxis.get_ticklines(), self.xaxis.get_ticklabels()
set_thetagrids.__doc__ = cbook.dedent(set_thetagrids.__doc__) % kwdocd
def set_rgrids(self, radii, labels=None, angle=None, rpad=None, **kwargs):
@@ -358,6 +359,7 @@
self._r_label2_position.clear().translate(angle, -self._rpad * rmax)
for t in self.yaxis.get_ticklabels():
t.update(kwargs)
+ return self.yaxis.get_ticklines(), self.yaxis.get_ticklabels()
set_rgrids.__doc__ = cbook.dedent(set_rgrids.__doc__) % kwdocd
Modified: trunk/matplotlib/lib/matplotlib/pyplot.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/pyplot.py 2008-06-19 13:16:16 UTC (rev 5593)
+++ trunk/matplotlib/lib/matplotlib/pyplot.py 2008-06-19 13:23:04 UTC (rev 5594)
@@ -951,8 +951,8 @@
if not isinstance(ax, PolarAxes):
raise RuntimeError('rgrids only defined for polar axes')
if len(args)==0:
- lines = ax.rgridlines()
- labels = ax.rgridlabels()
+ lines = ax.yaxis.get_ticklines()
+ labels = ax.yaxis.get_ticklabels()
else:
lines, labels = ax.set_rgrids(*args, **kwargs)
@@ -1011,8 +1011,8 @@
if not isinstance(ax, PolarAxes):
raise RuntimeError('rgrids only defined for polar axes')
if len(args)==0:
- lines = ax.thetagridlines()
- labels = ax.thetagridlabels()
+ lines = ax.xaxis.get_ticklines()
+ labels = ax.xaxis.get_ticklabels()
else:
lines, labels = ax.set_thetagrids(*args, **kwargs)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-06-19 13:16:39
|
Revision: 5593
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5593&view=rev
Author: mdboom
Date: 2008-06-19 06:16:16 -0700 (Thu, 19 Jun 2008)
Log Message:
-----------
Lots of docstring formatting fixes.
Modified Paths:
--------------
trunk/matplotlib/doc/faq/installing_faq.rst
trunk/matplotlib/lib/matplotlib/__init__.py
trunk/matplotlib/lib/matplotlib/artist.py
trunk/matplotlib/lib/matplotlib/axes.py
trunk/matplotlib/lib/matplotlib/backend_bases.py
trunk/matplotlib/lib/matplotlib/contour.py
trunk/matplotlib/lib/matplotlib/figure.py
trunk/matplotlib/lib/matplotlib/image.py
trunk/matplotlib/lib/matplotlib/lines.py
trunk/matplotlib/lib/matplotlib/pyplot.py
trunk/matplotlib/lib/matplotlib/quiver.py
trunk/matplotlib/lib/matplotlib/text.py
Modified: trunk/matplotlib/doc/faq/installing_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/installing_faq.rst 2008-06-19 12:16:50 UTC (rev 5592)
+++ trunk/matplotlib/doc/faq/installing_faq.rst 2008-06-19 13:16:16 UTC (rev 5593)
@@ -55,8 +55,8 @@
easy_install -m PackageName
-3. Delete any .egg files or directories from your `installation directory
- <locating-matplotlib-install>`.
+3. Delete any .egg files or directories from your :ref:`installation
+ directory <locating-matplotlib-install>`.
Windows installer
Modified: trunk/matplotlib/lib/matplotlib/__init__.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/__init__.py 2008-06-19 12:16:50 UTC (rev 5592)
+++ trunk/matplotlib/lib/matplotlib/__init__.py 2008-06-19 13:16:16 UTC (rev 5593)
@@ -684,11 +684,11 @@
def rc(group, **kwargs):
"""
- Set the current rc params. Group is the grouping for the rc, eg
- for lines.linewidth the group is 'lines', for axes.facecolor, the
- group is 'axes', and so on. Group may also be a list or tuple
- of group names, eg ('xtick','ytick'). kwargs is a list of
- attribute name/value pairs, eg::
+ Set the current rc params. Group is the grouping for the rc, eg.
+ for ``lines.linewidth`` the group is ``lines``, for
+ ``axes.facecolor``, the group is ``axes``, and so on. Group may
+ also be a list or tuple of group names, eg. (*xtick*, *ytick*).
+ *kwargs* is a dictionary attribute name/value pairs, eg::
rc('lines', linewidth=2, color='r')
@@ -728,7 +728,8 @@
rc('font', **font) # pass in the font dict as kwargs
This enables you to easily switch between several configurations.
- Use rcdefaults to restore the default rc params after changes.
+ Use :func:`~matplotlib.pyplot.rcdefaults` to restore the default
+ rc params after changes.
"""
aliases = {
@@ -756,7 +757,7 @@
def rcdefaults():
"""
Restore the default rc params - the ones that were created at
- matplotlib load time
+ matplotlib load time.
"""
rcParams.update(rcParamsDefault)
Modified: trunk/matplotlib/lib/matplotlib/artist.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/artist.py 2008-06-19 12:16:50 UTC (rev 5592)
+++ trunk/matplotlib/lib/matplotlib/artist.py 2008-06-19 13:16:16 UTC (rev 5593)
@@ -707,31 +707,32 @@
def setp(h, *args, **kwargs):
"""
- matplotlib supports the use of setp ("set property") and getp to set
- and get object properties, as well as to do introspection on the
- object For example, to set the linestyle of a line to be dashed, you
- can do
+ matplotlib supports the use of :func:`setp` ("set property") and
+ :func:`getp` to set and get object properties, as well as to do
+ introspection on the object. For example, to set the linestyle of a
+ line to be dashed, you can do::
>>> line, = plot([1,2,3])
>>> setp(line, linestyle='--')
If you want to know the valid types of arguments, you can provide the
- name of the property you want to set without a value
+ name of the property you want to set without a value::
>>> setp(line, 'linestyle')
linestyle: [ '-' | '--' | '-.' | ':' | 'steps' | 'None' ]
If you want to see all the properties that can be set, and their
- possible values, you can do
+ possible values, you can do::
>>> setp(line)
... long output listing omitted
- setp operates on a single instance or a list of instances. If you
- are in query mode introspecting the possible values, only the first
- instance in the sequence is used. When actually setting values,
- all the instances will be set. Eg, suppose you have a list of two
- lines, the following will make both lines thicker and red
+ :func:`setp` operates on a single instance or a list of instances.
+ If you are in query mode introspecting the possible values, only
+ the first instance in the sequence is used. When actually setting
+ values, all the instances will be set. Eg., suppose you have a
+ list of two lines, the following will make both lines thicker and
+ red::
>>> x = arange(0,1.0,0.01)
>>> y1 = sin(2*pi*x)
@@ -739,8 +740,8 @@
>>> lines = plot(x, y1, x, y2)
>>> setp(lines, linewidth=2, color='r')
- setp works with the matlab(TM) style string/value pairs or with
- python kwargs. For example, the following are equivalent
+ :func:`setp` works with the matlab(TM) style string/value pairs or
+ with python kwargs. For example, the following are equivalent
>>> setp(lines, 'linewidth', 2, 'color', r') # matlab style
>>> setp(lines, linewidth=2, color='r') # python style
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-06-19 12:16:50 UTC (rev 5592)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-06-19 13:16:16 UTC (rev 5593)
@@ -1546,17 +1546,18 @@
grid(self, b=None, **kwargs)
- Set the axes grids on or off; b is a boolean
+ Set the axes grids on or off; *b* is a boolean
- if b is None and len(kwargs)==0, toggle the grid state. if
- kwargs are supplied, it is assumed that you want a grid and b
- is thus set to True
+ If *b* is *None* and len(kwargs)==0, toggle the grid state. If
+ kwargs are supplied, it is assumed that you want a grid and *b*
+ is thus set to *True*
kawrgs are used to set the grid line properties, eg::
ax.grid(color='r', linestyle='-', linewidth=2)
- Valid Line2D kwargs are
+ Valid :class:`~matplotlib.lines.Line2D` kwargs are
+
%(Line2D)s
"""
if len(kwargs): b = True
@@ -2457,40 +2458,44 @@
text(x, y, s, fontdict=None, **kwargs)
- Add text in string s to axis at location x,y (data coords)
+ Add text in string *s* to axis at location *x*, *y*, data
+ coordinates.
Keyword arguments:
- fontdict:
- a dictionary to override the default text properties.
- If fontdict is None, the defaults are determined by your rc
+ *fontdict*:
+ A dictionary to override the default text properties.
+ If *fontdict* is *None*, the defaults are determined by your rc
parameters.
- withdash: [ False | True ]
- creates a TextWithDash instance instead of a Text instance.
+ *withdash*: [ False | True ]
+ Creates a :class:`~matplotlib.text.TextWithDash` instance
+ instead of a :class:`~matplotlib.text.Text` instance.
+
Individual keyword arguments can be used to override any given
parameter::
text(x, y, s, fontsize=12)
The default transform specifies that text is in data coords,
- alternatively, you can specify text in axis coords (0,0 lower left and
- 1,1 upper right). The example below places text in the center of the
- axes::
+ alternatively, you can specify text in axis coords (0,0 is
+ lower-left and 1,1 is upper-right). The example below places
+ text in the center of the axes::
text(0.5, 0.5,'matplotlib',
horizontalalignment='center',
verticalalignment='center',
transform = ax.transAxes)
- You can put a rectangular box around the text instance (eg to
- set a background color) by using the keyword bbox. bbox is a
- dictionary of patches.Rectangle properties (see help
- for Rectangle for a list of these). For example::
+ You can put a rectangular box around the text instance (eg. to
+ set a background color) by using the keyword *bbox*. *bbox* is
+ a dictionary of :class:`matplotlib.patches.Rectangle`
+ properties. For example::
text(x, y, s, bbox=dict(facecolor='red', alpha=0.5))
- Valid kwargs are Text properties
+ Valid kwargs are :class:`matplotlib.text.Text` properties:
+
%(Text)s
"""
default = {
@@ -2536,6 +2541,7 @@
textcoords='data', arrowprops=None, **kwargs)
Keyword arguments:
+
%(Annotation)s
"""
a = mtext.Annotation(*args, **kwargs)
@@ -2556,30 +2562,33 @@
Axis Horizontal Line
- Draw a horizontal line at y from xmin to xmax. With the default
- values of xmin=0 and xmax=1, this line will always span the horizontal
- extent of the axes, regardless of the xlim settings, even if you
- change them, eg with the xlim command. That is, the horizontal extent
- is in axes coords: 0=left, 0.5=middle, 1.0=right but the y location is
- in data coordinates.
+ Draw a horizontal line at *y* from *xmin* to *xmax*. With the
+ default values of *xmin* = 0 and *xmax* = 1, this line will
+ always span the horizontal extent of the axes, regardless of
+ the xlim settings, even if you change them, eg. with the
+ :meth:`set_xlim` command. That is, the horizontal extent is
+ in axes coords: 0=left, 0.5=middle, 1.0=right but the *y*
+ location is in data coordinates.
- Return value is the Line2D instance. kwargs are the same as kwargs to
- plot, and can be used to control the line properties. Eg
+ Return value is the :class:`~matplotlib.lines.Line2D`
+ instance. kwargs are the same as kwargs to plot, and can be
+ used to control the line properties. Eg.,
- * draw a thick red hline at y=0 that spans the xrange
+ * draw a thick red hline at *y* = 0 that spans the xrange
>>> axhline(linewidth=4, color='r')
- * draw a default hline at y=1 that spans the xrange
+ * draw a default hline at *y* = 1 that spans the xrange
>>> axhline(y=1)
- * draw a default hline at y=.5 that spans the the middle half of
+ * draw a default hline at *y* = .5 that spans the the middle half of
the xrange
>>> axhline(y=.5, xmin=0.25, xmax=0.75)
- Valid kwargs are Line2D properties
+ Valid kwargs are :class:`~matplotlib.lines.Line2D` properties:
+
%(Line2D)s
"""
@@ -2603,30 +2612,33 @@
Axis Vertical Line
- Draw a vertical line at x from ymin to ymax. With the default values
- of ymin=0 and ymax=1, this line will always span the vertical extent
- of the axes, regardless of the xlim settings, even if you change them,
- eg with the xlim command. That is, the vertical extent is in axes
- coords: 0=bottom, 0.5=middle, 1.0=top but the x location is in data
- coordinates.
+ Draw a vertical line at *x* from *ymin* to *ymax*. With the
+ default values of *ymin* = 0 and *ymax* = 1, this line will
+ always span the vertical extent of the axes, regardless of the
+ xlim settings, even if you change them, eg. with the
+ :meth:`set_xlim` command. That is, the vertical extent is in
+ axes coords: 0=bottom, 0.5=middle, 1.0=top but the *x* location
+ is in data coordinates.
- Return value is the Line2D instance. kwargs are the same as
- kwargs to plot, and can be used to control the line properties. Eg
+ Return value is the :class:`~matplotlib.lines.Line2D`
+ instance. kwargs are the same as kwargs to plot, and can be
+ used to control the line properties. Eg.,
- * draw a thick red vline at x=0 that spans the yrange
+ * draw a thick red vline at *x* = 0 that spans the yrange
>>> axvline(linewidth=4, color='r')
- * draw a default vline at x=1 that spans the yrange
+ * draw a default vline at *x* = 1 that spans the yrange
>>> axvline(x=1)
- * draw a default vline at x=.5 that spans the the middle half of
+ * draw a default vline at *x* = .5 that spans the the middle half of
the yrange
>>> axvline(x=.5, ymin=0.25, ymax=0.75)
- Valid kwargs are Line2D properties
+ Valid kwargs are :class:`~matplotlib.lines.Line2D` properties:
+
%(Line2D)s
"""
@@ -2648,26 +2660,31 @@
axhspan(ymin, ymax, xmin=0, xmax=1, **kwargs)
- Axis Horizontal Span. ycoords are in data units and x
- coords are in axes (relative 0-1) units
+ Axis Horizontal Span.
- Draw a horizontal span (regtangle) from ymin to ymax. With the
- default values of xmin=0 and xmax=1, this always span the xrange,
- regardless of the xlim settings, even if you change them, eg with the
- xlim command. That is, the horizontal extent is in axes coords:
- 0=left, 0.5=middle, 1.0=right but the y location is in data
+ *y* coords are in data units and *x* coords are in axes (relative
+ 0-1) units.
+
+ Draw a horizontal span (rectangle) from *ymin* to *ymax*.
+ With the default values of *xmin* = 0 and *xmax* = 1, this
+ always span the xrange, regardless of the xlim settings, even
+ if you change them, eg. with the :meth:`set_xlim` command.
+ That is, the horizontal extent is in axes coords: 0=left,
+ 0.5=middle, 1.0=right but the *y* location is in data
coordinates.
- Return value is the patches.Polygon instance.
+ Return value is a :class:`matplotlib.patches.Polygon`
+ instance.
Examples:
- * draw a gray rectangle from y=0.25-0.75 that spans the horizontal
- extent of the axes
+ * draw a gray rectangle from *y* = 0.25-0.75 that spans the
+ horizontal extent of the axes
>>> axhspan(0.25, 0.75, facecolor='0.5', alpha=0.5)
- Valid kwargs are Polygon properties
+ Valid kwargs are :class:`~matplotlib.patches.Polygon` properties:
+
%(Polygon)s
"""
# convert y axis units
@@ -2686,17 +2703,21 @@
axvspan(xmin, xmax, ymin=0, ymax=1, **kwargs)
- Axis Vertical Span. xcoords are in data units and y coords
- are in axes (relative 0-1) units
+ Axis Vertical Span.
- Draw a vertical span (regtangle) from xmin to xmax. With the default
- values of ymin=0 and ymax=1, this always span the yrange, regardless
- of the ylim settings, even if you change them, eg with the ylim
- command. That is, the vertical extent is in axes coords: 0=bottom,
- 0.5=middle, 1.0=top but the y location is in data coordinates.
+ *x* coords are in data units and *y* coords are in axes (relative
+ 0-1) units.
- return value is the patches.Polygon instance.
+ Draw a vertical span (rectangle) from *xmin* to *xmax*. With
+ the default values of *ymin* = 0 and *ymax* = 1, this always
+ span the yrange, regardless of the ylim settings, even if you
+ change them, eg. with the :meth:`set_ylim` command. That is,
+ the vertical extent is in axes coords: 0=bottom, 0.5=middle,
+ 1.0=top but the *y* location is in data coordinates.
+ Return value is the :class:`matplotlib.patches.Polygon`
+ instance.
+
Examples:
* draw a vertical green translucent rectangle from x=1.25 to 1.55 that
@@ -2704,7 +2725,9 @@
>>> axvspan(1.25, 1.55, facecolor='g', alpha=0.5)
- Valid kwargs are Polygon properties:
+ Valid kwargs are :class:`~matplotlib.patches.Polygon`
+ properties:
+
%(Polygon)s
"""
# convert x axis units
@@ -2725,27 +2748,28 @@
hlines(y, xmin, xmax, colors='k', linestyle='solid', **kwargs)
- plot horizontal lines at each y from xmin to xmax.
+ Plot horizontal lines at each *y* from *xmin* to *xmax*.
- Returns the LineCollection that was added
+ Returns the :class:`~matplotlib.collections.LineCollection`
+ that was added.
Required arguments:
- y:
+ *y*:
a 1-D numpy array or iterable.
- xmin and xmax:
- can be scalars or len(x) numpy arrays. If they are scalars, then
- the respective values are constant, else the widths of the lines
- are determined by xmin and xmax
+ *xmin* and *xmax*:
+ can be scalars or ``len(x)`` numpy arrays. If they are
+ scalars, then the respective values are constant, else the
+ widths of the lines are determined by *xmin* and *xmax*.
Optional keyword arguments:
- colors:
+ *colors*:
a line collections color argument, either a single color
- or a len(y) list of colors
+ or a ``len(y)`` list of colors
- linestyle:
+ *linestyle*:
[ 'solid' | 'dashed' | 'dashdot' | 'dotted' ]
"""
@@ -2800,20 +2824,21 @@
vlines(x, ymin, ymax, color='k')
- Plot vertical lines at each x from ymin to ymax. ymin or ymax can be
- scalars or len(x) numpy arrays. If they are scalars, then the
- respective values are constant, else the heights of the lines are
- determined by ymin and ymax
+ Plot vertical lines at each *x* from *ymin* to *ymax*. *ymin*
+ or *ymax* can be scalars or len(*x*) numpy arrays. If they are
+ scalars, then the respective values are constant, else the
+ heights of the lines are determined by *ymin* and *ymax*.
+ *colors* is a line collections color args, either a single color
+ or a len(*x*) list of colors
- colors is a line collections color args, either a single color
- or a len(x) list of colors
+ *linestyle* is one of [ 'solid' | 'dashed' | 'dashdot' | 'dotted' ]
- linestyle is one of [ 'solid' | 'dashed' | 'dashdot' | 'dotted' ]
+ Returns the :class:`matplotlib.collections.LineCollection`
+ that was added.
- Returns the collections.LineCollection that was added
+ kwargs are :class:`~matplotlib.collections.LineCollection` properties:
- kwargs are collections.LineCollection properties:
%(LineCollection)s
"""
@@ -2870,19 +2895,22 @@
#### Basic plotting
def plot(self, *args, **kwargs):
"""
- Plot lines and/or markers to the Axes. ``*args`` is a variable length
- argument, allowing for multiple *x*, *y* pairs with an optional format
- string. For example, each of the following is legal::
+ Plot lines and/or markers to the
+ :class:`~matplotlib.axes.Axes`. *args* is a variable length
+ argument, allowing for multiple *x*, *y* pairs with an
+ optional format string. For example, each of the following is
+ legal::
plot(x, y) # plot x and y using the default line style and color
plot(x, y, 'bo') # plot x and y using blue circle markers
plot(y) # plot y using x as index array 0..N-1
plot(y, 'r+') # ditto, but with red plusses
- If ``x`` and/or ``y`` is 2-dimensional, then the corresponding columns
+ If *x* and/or *y* is 2-dimensional, then the corresponding columns
will be plotted.
- An arbitrary number of ``x``, ``y``, ``fmt`` groups can be specified, as in::
+ An arbitrary number of *x*, *y*, *fmt* groups can be
+ specified, as in::
a.plot(x1, y1, 'g^', x2, y2, 'g-')
@@ -2929,16 +2957,16 @@
w # white
In addition, you can specify colors in many weird and
- wonderful ways, including full names (``'green'``), hex strings
- (``'#008000'``), RGB or RGBA tuples (``(0,1,0,1)``) or grayscale
- intensities as a string (``'0.8'``). Of these, the string
- specifications can be used in place of a ``fmt`` group, but the
- tuple forms can be used only as ``kwargs``.
+ wonderful ways, including full names (``'green'``), hex
+ strings (``'#008000'``), RGB or RGBA tuples (``(0,1,0,1)``) or
+ grayscale intensities as a string (``'0.8'``). Of these, the
+ string specifications can be used in place of a ``fmt`` group,
+ but the tuple forms can be used only as ``kwargs``.
Line styles and colors are combined in a single format string, as in
``'bo'`` for blue circles.
- The ``**kwargs`` can be used to set line properties (any property that has
+ The *kwargs* can be used to set line properties (any property that has
a ``set_*`` method). You can use this to set a line label (for auto
legends), linewidth, anitialising, marker face color, etc. Here is an
example::
@@ -2948,19 +2976,21 @@
axis([0, 4, 0, 10])
legend()
- If you make multiple lines with one plot command, the ``kwargs`` apply
- to all those lines, e.g.::
+ If you make multiple lines with one plot command, the kwargs
+ apply to all those lines, e.g.::
plot(x1, y1, x2, y2, antialised=False)
Neither line will be antialiased.
- The kwargs are Line2D properties:
+ The kwargs are :class:`~matplotlib.lines.Line2D` properties:
+
%(Line2D)s
- kwargs ``scalex`` and ``scaley``, if defined, are passed on to
- :meth:`autoscale_view` to determine whether the *x* and *y* axes
- are autoscaled; the default is ``True``.
+ kwargs *scalex* and *scaley*, if defined, are passed on to
+ :meth:`~matplotlib.axes.Axes.autoscale_view` to determine
+ whether the *x* and *y* axes are autoscaled; the default is
+ *True*.
"""
scalex = kwargs.pop( 'scalex', True)
scaley = kwargs.pop( 'scaley', True)
@@ -2985,36 +3015,48 @@
plot_date(x, y, fmt='bo', tz=None, xdate=True, ydate=False, **kwargs)
- Similar to the plot() command, except the x or y (or both) data
- is considered to be dates, and the axis is labeled accordingly.
+ Similar to the :func:`~matplotlib.pyplot.plot` command, except
+ the *x* or *y* (or both) data is considered to be dates, and the
+ axis is labeled accordingly.
- x and/or y can be a sequence of dates represented as float days since
+ *x* and/or *y* can be a sequence of dates represented as float days since
0001-01-01 UTC.
- See dates for helper functions date2num, num2date
- and drange for help on creating the required floating point dates
+ See :mod:`~matplotlib.dates` for helper functions
+ :func:`~matplotlib.dates.date2num`,
+ :func:`~matplotlib.dates.num2date` and
+ :func:`~matplotlib.dates.drange` for help on creating the
+ required floating point dates.
Keyword arguments:
- fmt: string
+ *fmt*: string
The plot format string.
- tz: [ None | timezone string ]
- The time zone to use in labeling dates. If None, defaults to rc
+
+ *tz*: [ None | timezone string ]
+ The time zone to use in labeling dates. If *None*, defaults to rc
value.
- xdate: [ True | False ]
- If True, the x-axis will be labeled with dates.
- ydate: [ False | True ]
- If True, the y-axis will be labeled with dates.
+ *xdate*: [ True | False ]
+ If *True*, the *x*-axis will be labeled with dates.
+
+ *ydate*: [ False | True ]
+ If *True*, the *y*-axis will be labeled with dates.
+
Note if you are using custom date tickers and formatters, it
may be necessary to set the formatters/locators after the call
- to plot_date since plot_date will set the default tick locator
- to ticker.AutoDateLocator (if the tick locator is not already set to
- a ticker.DateLocator instance) and the default tick formatter to
- AutoDateFormatter (if the tick formatter is not already set to
- a DateFormatter instance).
+ to :meth:`plot_date` since :meth:`plot_date` will set the
+ default tick locator to
+ :class:`matplotlib.ticker.AutoDateLocator` (if the tick
+ locator is not already set to a
+ :class:`matplotlib.ticker.DateLocator` instance) and the
+ default tick formatter to
+ :class:`matplotlib.ticker.AutoDateFormatter` (if the tick
+ formatter is not already set to a
+ :class:`matplotlib.ticker.DateFormatter` instance).
- Valid kwargs are Line2D properties:
+ Valid kwargs are :class:`~matplotlib.lines.Line2D` properties:
+
%(Line2D)s
"""
@@ -3040,22 +3082,27 @@
loglog(*args, **kwargs)
- Make a plot with log scaling on the x and y axis. The args to loglog
- are the same as the args to plot. See plot for more info.
+ Make a plot with log scaling on the *x* and *y* axis.
- loglog supports all the keyword arguments of plot and
- Axes.set_xscale/Axes.set_yscale.
+ :func:`~matplotlib.pyplot.loglog` supports all the keyword
+ arguments of :func:`~matplotlib.pyplot.plot` and
+ :meth:`matplotlib.axes.Axes.set_xscale`/:meth:`matplotlib.axes.Axes.set_yscale`.
Notable keyword arguments:
- basex/basey: scalar > 1
- base of the x/y logarithm
- subsx/subsy: [ None | sequence ]
- the location of the minor x/yticks; None defaults to
- autosubs, which depend on the number of decades in the
- plot; see set_xscale/set_yscale for details
+ *basex*/*basey*: scalar > 1
+ base of the *x*/*y* logarithm
- The remaining valid kwargs are Line2D properties:
+ *subsx*/*subsy*: [ None | sequence ]
+ the location of the minor *x*/*y* ticks; *None* defaults
+ to autosubs, which depend on the number of decades in the
+ plot; see
+ :meth:`matplotlib.axes.Axes.set_xscale`/:meth:`matplotlib.axes.Axes.set_yscale`
+ for details
+
+ The remaining valid kwargs are
+ :class:`~matplotlib.lines.Line2D` properties:
+
%(Line2D)s
"""
if not self._hold: self.cla()
@@ -3084,23 +3131,26 @@
semilogx(*args, **kwargs)
- Make a plot with log scaling on the x axis. The args to
- semilogx are the same as the args to plot. See plot for
- more info.
+ Make a plot with log scaling on the *x* axis.
- semilogx supports all the keyword arguments of plot and
- Axes.set_xscale.
+ :func:`semilogx` supports all the keyword arguments of
+ :func:`~matplotlib.pyplot.plot` and
+ :meth:`matplotlib.axes.Axes.set_xscale`.
Notable keyword arguments:
- basex: scalar > 1
- base of the x logarithm
- subsx: [ None | sequence ]
- the location of the minor xticks; None defaults to
+ *basex*: scalar > 1
+ base of the *x* logarithm
+
+ *subsx*: [ None | sequence ]
+ The location of the minor xticks; *None* defaults to
autosubs, which depend on the number of decades in the
- plot; see set_xscale for details
+ plot; see :meth:`~matplotlib.axes.Axes.set_xscale` for
+ details.
- The remaining valid kwargs are Line2D properties:
+ The remaining valid kwargs are
+ :class:`~matplotlib.lines.Line2D` properties:
+
%(Line2D)s
"""
if not self._hold: self.cla()
@@ -3122,23 +3172,26 @@
semilogy(*args, **kwargs)
- Make a plot with log scaling on the y axis. The args to
- semilogy are the same as the args to plot. See plot for
- more info.
+ Make a plot with log scaling on the *y* axis.
- semilogy supports all the keyword arguments of plot and
- Axes.set_yscale.
+ :func:`semilogy` supports all the keyword arguments of
+ :func:`~matplotlib.pylab.plot` and
+ :meth:`matplotlib.axes.Axes.set_yscale`.
Notable keyword arguments:
- basey: scalar > 1
- base of the y logarithm
- subsy: [ None | sequence ]
- the location of the minor yticks; None defaults to
+ *basey*: scalar > 1
+ Base of the *y* logarithm
+
+ *subsy*: [ None | sequence ]
+ The location of the minor yticks; *None* defaults to
autosubs, which depend on the number of decades in the
- plot; see set_yscale for details
+ plot; see :meth:`~matplotlib.axes.Axes.set_yscale` for
+ details.
- The remaining valid kwargs are Line2D properties:
+ The remaining valid kwargs are
+ :class:`~matplotlib.lines.Line2D` properties:
+
%(Line2D)s
"""
if not self._hold: self.cla()
@@ -3161,33 +3214,47 @@
acorr(x, normed=False, detrend=mlab.detrend_none, usevlines=False,
maxlags=None, **kwargs)
- Plot the autocorrelation of x. If normed=True, normalize the
- data but the autocorrelation at 0-th lag. x is detrended by
- the detrend callable (default no normalization.
+ Plot the autocorrelation of *x*. If *normed* = *True*,
+ normalize the data but the autocorrelation at 0-th lag. *x* is
+ detrended by the *detrend* callable (default no normalization).
- data are plotted as ``plot(lags, c, **kwargs)``
+ Data are plotted as ``plot(lags, c, **kwargs)``
- return value is lags, c, line where lags are a length
- 2*maxlags+1 lag vector, c is the 2*maxlags+1 auto correlation
- vector, and line is a Line2D instance returned by plot. The
- default linestyle is None and the default marker is 'o',
- though these can be overridden with keyword args. The cross
- correlation is performed with numpy correlate with
- mode=2.
+ Return value is a tuple (*lags*, *c*, *line*) where:
- If usevlines is True, Axes.vlines rather than Axes.plot is used
- to draw vertical lines from the origin to the acorr.
- Otherwise the plotstyle is determined by the kwargs, which are
- Line2D properties. If usevlines, the return value is lags, c,
- linecol, b where linecol is the collections.LineCollection and b is the x-axis
+ - *lags* are a length 2*maxlags+1 lag vector
- if usevlines=True, kwargs are passed onto Axes.vlines
- if usevlines=False, kwargs are passed onto Axes.plot
+ - *c* is the 2*maxlags+1 auto correlation vector
- maxlags is a positive integer detailing the number of lags to show.
- The default value of None will return all (2*len(x)-1) lags.
+ - *line* is a :class:`~matplotlib.lines.Line2D` instance
+ returned by :meth:`plot`
- See the respective function for documentation on valid kwargs
+ The default *linestyle* is None and the default *marker* is
+ ``'o'``, though these can be overridden with keyword args.
+ The cross correlation is performed with :func:`numpy.correlate` with
+ *mode* = 2.
+
+ If *usevlines* is *True*:
+
+ :meth:`~matplotlib.axes.Axes.vlines` rather than
+ :meth:`~matplotlib.axes.Axes.plot` is used to draw
+ vertical lines from the origin to the acorr. Otherwise,
+ the plot style is determined by the kwargs, which are
+ :class:`~matplotlib.lines.Line2D` properties. The return
+ value is a tuple (*lags*, *c*, *linecol*, *b*) where
+
+ - *linecol* is the
+ :class:`~matplotlib.collections.LineCollection`
+
+ - *b* is the *x*-axis.
+
+ *maxlags* is a positive integer detailing the number of lags
+ to show. The default value of *None* will return all
+ ``(2*len(x)-1)`` lags.
+
+ See the respective :meth:`~matplotlib.axes.Axes.plot` or
+ :meth:`~matplotlib.axes.Axes.vlines` functions for
+ documentation on valid kwargs.
"""
return self.xcorr(x, x, **kwargs)
acorr.__doc__ = cbook.dedent(acorr.__doc__) % martist.kwdocd
@@ -3200,35 +3267,42 @@
xcorr(x, y, normed=False, detrend=mlab.detrend_none,
usevlines=False, **kwargs):
- Plot the cross correlation between x and y. If normed=True,
- normalize the data but the cross correlation at 0-th lag. x
- and y are detrended by the detrend callable (default no
- normalization. x and y must be equal length
+ Plot the cross correlation between *x* and *y*. If *normed* =
+ *True*, normalize the data but the cross correlation at 0-th
+ lag. *x* and y are detrended by the *detrend* callable
+ (default no normalization). *x* and *y* must be equal length.
- data are plotted as ``plot(lags, c, **kwargs)``
+ Data are plotted as ``plot(lags, c, **kwargs)``
- return value is lags, c, line where lags are a length
- ``2*maxlags+1`` lag vector, c is the ``2*maxlags+1`` auto correlation
- vector, and line is a Line2D instance returned by plot. The
- default linestyle is None and the default marker is 'o',
- though these can be overridden with keyword args. The cross
- correlation is performed with numpy correlate with
- mode=2.
+ Return value is a tuple (*lags*, *c*, *line*) where:
- If usevlines is True, Axes.vlines rather than Axes.plot is used
- to draw vertical lines from the origin to the acorr.
- Otherwise the plotstyle is determined by the kwargs, which are
- Line2D properties. If usevlines, the return value is lags, c,
- linecol, b where linecol is the collections.LineCollection and b is the
- x-axis
+ - *lags* are a length ``2*maxlags+1`` lag vector
- if ``usevlines=True``, kwargs are passed onto Axes.vlines
- if ``usevlines=False``, kwargs are passed onto Axes.plot
+ - *c* is the ``2*maxlags+1`` auto correlation vector
- maxlags is a positive integer detailing the number of lags to show.
- The default value of None will return all ``(2*len(x)-1)`` lags.
+ - *line* is a :class:`~matplotlib.lines.Line2D` instance
+ returned by :func:`~matplotlib.pyplot.plot`.
- See the respective function for documentation on valid kwargs
+ The default *linestyle* is *None* and the default *marker* is
+ 'o', though these can be overridden with keyword args. The
+ cross correlation is performed with :func:`numpy.correlate`
+ with *mode* = 2.
+
+ If *usevlines* is *True*:
+
+ :func:`~matplotlib.pyplot.vlines`
+ rather than :func:`~matplotlib.pyplot.plot` is used to draw
+ vertical lines from the origin to the xcorr. Otherwise the
+ plotstyle is determined by the kwargs, which are
+ :class:`~matplotlib.lines.Line2D` properties.
+
+ The return value is a tuple (*lags*, *c*, *linecol*, *b*)
+ where *linecol* is the
+ :class:`matplotlib.collections.LineCollection` instance and
+ *b* is the *x*-axis.
+
+ *maxlags* is a positive integer detailing the number of lags to show.
+ The default value of *None* will return all ``(2*len(x)-1)`` lags.
"""
Nx = len(x)
@@ -3269,20 +3343,27 @@
legend(*args, **kwargs)
- Place a legend on the current axes at location loc. Labels are a
- sequence of strings and loc can be a string or an integer specifying
- the legend location
+ Place a legend on the current axes at location *loc*. Labels are a
+ sequence of strings and *loc* can be a string or an integer specifying
+ the legend location.
To make a legend with existing lines::
legend()
- legend by itself will try and build a legend using the label
+ :meth:`legend` by itself will try and build a legend using the label
property of the lines/patches/collections. You can set the label of
- a line by doing plot(x, y, label='my data') or line.set_label('my
- data'). If label is set to '_nolegend_', the item will not be shown
- in legend.
+ a line by doing::
+ plot(x, y, label='my data')
+
+ or::
+
+ line.set_label('my data').
+
+ If label is set to '_nolegend_', the item will not be shown in
+ legend.
+
To automatically generate the legend from labels::
legend( ('label1', 'label2', 'label3') )
@@ -3325,32 +3406,41 @@
Keyword arguments:
- isaxes: [ True | False ]
+ *isaxes*: [ True | False ]
Indicates that this is an axes legend
- numpoints: integer
+
+ *numpoints*: integer
The number of points in the legend line, default is 4
- prop: [ None | FontProperties ]
- A FontProperties instance, or None to use rc settings.
- see :class:`~matplotlib.font_manager.FontProperties`
- pad: [ None | scalar ]
+
+ *prop*: [ None | FontProperties ]
+ A :class:`matplotlib.font_manager.FontProperties`
+ instance, or *None* to use rc settings.
+
+ *pad*: [ None | scalar ]
The fractional whitespace inside the legend border, between 0 and 1.
- If None, use rc settings
- markerscale: [ None | scalar ]
- The relative size of legend markers vs. original. If None, use rc
- settings
- shadow: [ None | False | True ]
- If True, draw a shadow behind legend. If None, use rc settings.
- labelsep: [ None | scalar ]
- The vertical space between the legend entries. If None, use rc
- settings
- handlelen: [ None | scalar ]
- The length of the legend lines. If None, use rc settings.
- handletextsep: [ None | scalar ]
- The space between the legend line and legend text. If None, use rc
+ If *None*, use rc settings.
+
+ *markerscale*: [ None | scalar ]
+ The relative size of legend markers vs. original. If *None*, use rc
settings.
- axespad: [ None | scalar ]
- The border between the axes and legend edge. If None, use rc
+
+ *shadow*: [ None | False | True ]
+ If *True*, draw a shadow behind legend. If *None*, use rc settings.
+
+ *labelsep*: [ None | scalar ]
+ The vertical space between the legend entries. If *None*, use rc
settings.
+
+ *handlelen*: [ None | scalar ]
+ The length of the legend lines. If *None*, use rc settings.
+
+ *handletextsep*: [ None | scalar ]
+ The space between the legend line and legend text. If *None*, use rc
+ settings.
+
+ *axespad*: [ None | scalar ]
+ The border between the axes and legend edge. If *None*, use rc
+ settings.
"""
def get_handles():
@@ -3409,21 +3499,21 @@
step(x, y, *args, **kwargs)
- x and y must be 1-D sequences, and it is assumed, but not checked,
- that x is uniformly increasing.
+ Make a step plot. Additional keyword args to :func:`step` are the same
+ as those for :func:`~matplotlib.pyplot.plot`.
+ *x* and *y* must be 1-D sequences, and it is assumed, but not checked,
+ that *x* is uniformly increasing.
+
Keyword arguments:
- where: [ 'pre' | 'post' | 'mid' ]
- if 'pre', the interval from x[i] to x[i+1] has level y[i]
+ *where*: [ 'pre' | 'post' | 'mid' ]
+ If 'pre', the interval from x[i] to x[i+1] has level y[i]
- if 'post', that interval has level y[i+1]
+ If 'post', that interval has level y[i+1]
- if 'mid', the jumps in y occur half-way between the x-values.
-
- Make a step plot. Additional keyword args to step are the same
- as those for plot. See plot for more info.
-
+ If 'mid', the jumps in *y* occur half-way between the
+ *x*-values.
'''
where = kwargs.pop('where', 'pre')
@@ -3450,12 +3540,14 @@
Make a bar plot with rectangles bounded by:
- left, left+width, bottom, bottom+height
+ *left*, *left* + *width*, *bottom*, *bottom* + *height*
(left, right, bottom and top edges)
- left, height, width, and bottom can be either scalars or sequences
+ *left*, *height*, *width*, and *bottom* can be either scalars
+ or sequences
- Return value is a list of Rectangle patch instances
+ Return value is a list of
+ :class:`matplotlib.patches.Rectangle` instances.
Required arguments:
@@ -3488,18 +3580,20 @@
axis as-is; True sets it to log scale
============= ===================================================
- For vertical bars, align='edge' aligns bars by their left edges in
- left, while 'center' interprets these values as the x coordinates of
- the bar centers. For horizontal bars, 'edge' aligns bars by their
- bottom edges in bottom, while 'center' interprets these values as the
- y coordinates of the bar centers.
+ For vertical bars, *align* = 'edge' aligns bars by their left
+ edges in left, while *align* = 'center' interprets these
+ values as the *x* coordinates of the bar centers. For
+ horizontal bars, *align* = 'edge' aligns bars by their bottom
+ edges in bottom, while *align* = 'center' interprets these
+ values as the *y* coordinates of the bar centers.
- The optional arguments color, edgecolor, linewidth, xerr, and yerr can
- be either scalars or sequences of length equal to the number of bars.
- This enables you to use bar as the basis for stacked bar charts, or
- candlestick plots.
+ The optional arguments *color*, *edgecolor*, *linewidth*,
+ *xerr*, and *yerr* can be either scalars or sequences of
+ length equal to the number of bars. This enables you to use
+ bar as the basis for stacked bar charts, or candlestick plots.
Other optional kwargs:
+
%(Rectangle)s
"""
if not self._hold: self.cla()
@@ -3698,12 +3792,14 @@
Make a horizontal bar plot with rectangles bounded by:
- left, left+width, bottom, bottom+height
+ *left*, *left* + *width*, *bottom*, *bottom* + *height*
(left, right, bottom and top edges)
- bottom, width, height, and left can be either scalars or sequences
+ *bottom*, *width*, *height*, and *left* can be either scalars
+ or sequences
- Return value is a list of Rectangle patch instances
+ Return value is a list of
+ :class:`matplotlib.patches.Rectangle` instances.
Required arguments:
@@ -3735,16 +3831,18 @@
axis as-is; True sets it to log scale
============= ===================================================
- Setting align='edge' aligns bars by their bottom edges in bottom,
- while 'center' interprets these values as the y coordinates of the bar
- centers.
+ Setting *align* = 'edge' aligns bars by their bottom edges in
+ bottom, while *align* = 'center' interprets these values as
+ the *y* coordinates of the bar centers.
- The optional arguments color, edgecolor, linewidth, xerr, and yerr can
- be either scalars or sequences of length equal to the number of bars.
- This enables you to use barh as the basis for stacked bar charts, or
- candlestick plots.
+ The optional arguments *color*, *edgecolor*, *linewidth*,
+ *xerr*, and *yerr* can be either scalars or sequences of
+ length equal to the number of bars. This enables you to use
+ barh as the basis for stacked bar charts, or candlestick
+ plots.
other optional kwargs:
+
%(Rectangle)s
"""
@@ -3760,8 +3858,8 @@
broken_barh(self, xranges, yrange, **kwargs)
- A collection of horizontal bars spanning yrange with a sequence of
- xranges
+ A collection of horizontal bars spanning *yrange* with a sequence of
+ *xranges*.
Required arguments:
@@ -3772,7 +3870,10 @@
yrange sequence of (ymin, ywidth)
======== ==========================
- kwargs are collections.BrokenBarHCollection properties:
+ kwargs are
+ :class:`matplotlib.collections.BrokenBarHCollection`
+ properties:
+
%(BrokenBarHCollection)s
these can either be a single argument, ie::
@@ -3781,8 +3882,7 @@
or a sequence of arguments for the various bars, ie::
- facecolors = 'black', 'red', 'green'
-
+ facecolors = ('black', 'red', 'green')
"""
col = mcoll.BrokenBarHCollection(xranges, yrange, **kwargs)
self.add_collection(col, autolim=True)
@@ -3798,15 +3898,17 @@
stem(x, y, linefmt='b-', markerfmt='bo', basefmt='r-')
- A stem plot plots vertical lines (using linefmt) at each x location
- from the baseline to y, and places a marker there using markerfmt. A
- horizontal line at 0 is is plotted using basefmt
+ A stem plot plots vertical lines (using *linefmt*) at each *x*
+ location from the baseline to *y*, and places a marker there
+ using *markerfmt*. A horizontal line at 0 is is plotted using
+ *basefmt*.
- Return value is (markerline, stemlines, baseline) .
+ Return value is a tuple (*markerline*, *stemlines*,
+ *baseline*).
- See
- http://www.mathworks.com/access/helpdesk/help/techdoc/ref/stem.html
- for details and examples/stem_plot.py for a demo.
+ See `this document
+ <http://www.mathworks.com/access/helpdesk/help/techdoc/ref/stem.html>`_
+ for details and :file:`examples/pylab_examples/stem_plot.py` for a demo.
"""
remember_hold=self._hold
if not self._hold: self.cla()
@@ -3829,56 +3931,68 @@
def pie(self, x, explode=None, labels=None, colors=None,
autopct=None, pctdistance=0.6, shadow=False,
labeldistance=1.1):
- """
+ r"""
call signature::
pie(x, explode=None, labels=None,
colors=('b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'),
autopct=None, pctdistance=0.6, labeldistance=1.1, shadow=False)
- Make a pie chart of array x. The fractional area of each wedge is
- given by x/sum(x). If sum(x)<=1, then the values of x give the
- fractional area directly and the array will not be normalized.
+ Make a pie chart of array *x*. The fractional area of each
+ wedge is given by x/sum(x). If sum(x) <= 1, then the values
+ of x give the fractional area directly and the array will not
+ be normalized.
Keyword arguments:
- explode: [ None | len(x) sequence ]
- If not None, is a len(x) array which specifies the
+ *explode*: [ None | len(x) sequence ]
+ If not *None*, is a len(*x*) array which specifies the
fraction of the radius with which to offset each wedge.
- colors: [ None | color sequence ]
+
+ *colors*: [ None | color sequence ]
A sequence of matplotlib color args through which the pie chart
will cycle.
- labels: [ None | len(x) sequence of strings ]
+
+ *labels*: [ None | len(x) sequence of strings ]
A sequence of strings providing the labels for each wedge
- autopct: [ None | format string | format function ]
- If not None, is a string or function used to label the
+
+ *autopct*: [ None | format string | format function ]
+ If not *None*, is a string or function used to label the
wedges with their numeric value. The label will be placed inside
- the wedge. If it is a format string, the label will be fmt%pct.
- If it is a function, it will be called
- pctdistance: scalar
- The ratio between the center of each pie slice and the start of the
- text generated by autopct. Ignored if autopct is None; default is
- 0.6.
- labeldistance: scalar
+ the wedge. If it is a format string, the label will be ``fmt%pct``.
+ If it is a function, it will be called.
+
+ *pctdistance*: scalar
+ The ratio between the center of each pie slice and the
+ start of the text generated by *autopct*. Ignored if
+ *autopct* is *None*; default is 0.6.
+
+ *labeldistance*: scalar
The radial distance at which the pie labels are drawn
- shadow: [ False | True ]
+
+ *shadow*: [ False | True ]
Draw a shadow beneath the pie.
The pie chart will probably look best if the figure and axes are
- square. Eg::
+ square. Eg.::
figure(figsize=(8,8))
ax = axes([0.1, 0.1, 0.8, 0.8])
Return value:
- If autopct is None, return a list of (patches, texts), where patches
- is a sequence of mpatches.Wedge instances and texts is a
- list of the label Text instnaces
+ If *autopct* is None, return the tuple (*patches*, *texts*):
- If autopct is not None, return (patches, texts, autotexts), where
- patches and texts are as above, and autotexts is a list of text
- instances for the numeric labels
+ - *patches* is a sequence of
+ :class:`matplotlib.patches.Wedge` instances
+ - *texts* is a list of the label
+ :class:`matplotlib.text.Text` instances.
+
+ If *autopct* is not *None*, return the tuple (*patches*,
+ *texts*, *autotexts*), where *patches* and *texts* are as
+ above, and *autotexts* is a list of
+ :class:`~matplotlib.text.Text` instances for the numeric
+ labels.
"""
self.set_frame_on(False)
@@ -3975,40 +4089,47 @@
barsabove=False, lolims=False, uplims=False,
xlolims=False, xuplims=False)
- Plot x versus y with error deltas in yerr and xerr.
- Vertical errorbars are plotted if yerr is not None.
- Horizontal errorbars are plotted if xerr is not None.
+ Plot *x* versus *y* with error deltas in *yerr* and *xerr*.
+ Vertical errorbars are plotted if *yerr* is not *None*.
+ Horizontal errorbars are plotted if *xerr* is not *None*.
- x, y, xerr, and yerr can all be scalars, which plots a single error bar
- at x, y.
+ *x*, *y*, *xerr*, and *yerr* can all be scalars, which plots a
+ single error bar at *x*, *y*.
Optional keyword arguments:
- xerr/yerr: [ scalar | N, Nx1, Nx2 array-like ]
+ *xerr*/*yerr*: [ scalar | N, Nx1, Nx2 array-like ]
If a scalar number, len(N) array-like object, or an Nx1 array-like
object, errorbars are drawn +/- value.
If a rank-1, Nx2 Numpy array, errorbars are drawn at -column1 and
+column2
- fmt: '-'
- The plot format symbol for y. If fmt is None, just plot the
+
+ *fmt*: '-'
+ The plot format symbol for *y*. If *fmt* is *None*, just plot the
errorbars with no line symbols. This can be useful for creating a
bar plot with errorbars.
- ecolor: [ None | mpl color ]
+
+ *ecolor*: [ None | mpl color ]
a matplotlib color arg which gives the color the errorbar lines; if
- None, use the marker color.
- elinewidth: scalar
- the linewidth of the errorbar lines. If None, use the linewidth.
- capsize: scalar
+ *None*, use the marker color.
+
+ *elinewidth*: scalar
+ the linewidth of the errorbar lines. If *None*, use the linewidth.
+
+ *capsize*: scalar
the size of the error bar caps in points
- barsabove: [ True | False ]
- if True, will plot the errorbars above the plot symbols. Default is
- below.
- lolims/uplims/xlolims/xuplims: [ False | True ]
- These arguments can be used to indicate that a value gives only
- upper/lower limits. In that case a caret symbol is used to indicate
- this. lims-arguments may be of the same type as xerr and yerr.
+ *barsabove*: [ True | False ]
+ if *True*, will plot the errorbars above the plot
+ symbols. Default is below.
+
+ *lolims*/*uplims*/*xlolims*/*xuplims*: [ False | True ]
+ These arguments can be used to indicate that a value gives
+ only upper/lower limits. In that case a caret symbol is
+ used to indicate this. lims-arguments may be of the same
+ type as *xerr* and *yerr*.
+
All other keyword arguments are passed on to the plot command for the
markers, so you can add additional key=value pairs to control the
errorbar markers. For example, this code makes big red squares with
@@ -4018,16 +4139,20 @@
errorbar(x, y, yerr, marker='s',
mfc='red', mec='green', ms=20, mew=4)
- where mfc, mec, ms and mew are aliases for the longer property names,
- markerfacecolor, markeredgecolor, markersize and markeredgewith.
+ where *mfc*, *mec*, *ms* and *mew* are aliases for the longer
+ property names, *markerfacecolor*, *markeredgecolor*, *markersize*
+ and *markeredgewith*.
valid kwargs for the marker properties are
+
%(Line2D)s
Return value is a length 3 tuple. The first element is the
- Line2D instance for the y symbol lines. The second element is
- a list of error bar cap lines, the third element is a list of
- line collections for the horizontal and vertical error ranges
+ :class:`~matplotlib.lines.Line2D` instance for the *y* symbol
+ lines. The second element is a list of error bar cap lines,
+ the third element is a list of
+ :class:`~matplotlib.collections.LineCollection` instances for
+ the horizontal and vertical error ranges.
"""
self._process_unit_info(xdata=x, ydata=y, kwargs=kwargs)
@@ -4196,38 +4321,38 @@
boxplot(x, notch=0, sym='+', vert=1, whis=1.5,
positions=None, widths=None)
- Make a box and whisker plot for each column of x or
- each vector in sequence x.
- The box extends from the lower to upper quartile values
- of the data, with a line at the median. The whiskers
- extend from the box to show the range of the data. Flier
- points are those past the end of the whiskers.
+ Make a box and whisker plot for each column of *x* or each
+ vector in sequence *x*. The box extends from the lower to
+ upper quartile values of the data, with a line at the median.
+ The whiskers extend from the box to show the range of the
+ data. Flier points are those past the end of the whiskers.
- ``notch = 0`` (default) produces a rectangular box plot.
- ``notch = 1`` will produce a notched box plot
+ - *notch* = 0 (default) produces a rectangular box plot.
+ - *notch* = 1 will produce a notched box plot
- sym (default 'b+') is the default symbol for flier points.
+ *sym* (default 'b+') is the default symbol for flier points.
Enter an empty string ('') if you don't want to show fliers.
- ``vert = 1`` (default) makes the boxes vertical.
- ``vert = 0`` makes horizontal boxes. This seems goofy, but
- that's how Matlab did it.
+ - *vert* = 1 (default) makes the boxes vertical.
+ - *vert* = 0 makes horizontal boxes. This seems goofy, but
+ that's how Matlab did it.
- whis (default 1.5) defines the length of the whiskers as
+ *whis* (default 1.5) defines the length of the whiskers as
a function of the inner quartile range. They extend to the
most extreme data point within ( ``whis*(75%-25%)`` ) data range.
- positions (default 1,2,...,n) sets the horizontal positions of
+ *positions* (default 1,2,...,n) sets the horizontal positions of
the boxes. The ticks and limits are automatically set to match
the positions.
- widths is either a scalar or a vector and sets the width of
+ *widths* is either a scalar or a vector and sets the width of
each box. The default is 0.5, or ``0.15*(distance between extreme
positions)`` if that is smaller.
- x is an array or a sequence of vectors.
+ *x* is an array or a sequence of vectors.
- Returns a list of the lines added.
+ Returns a list of the :class:`matplotlib.lines.Line2D`
+ instances added.
"""
if not self._hold: self.cla()
@@ -4382,24 +4507,26 @@
vmin=None, vmax=None, alpha=1.0, linewidths=None,
verts=None, **kwargs)
- Make a scatter plot of x versus y, where x, y are 1-D sequences
- of the same length, N.
+ Make a scatter plot of *x* versus *y*, where *x*, *y* are 1-D
+ sequences of the same length, *N*.
Keyword arguments:
- s:
+ *s*:
size in points^2. It is a scalar or an array of the same
- length as x and y.
- c:
- a color. c can be a single color format string, or a
- sequence of color specifications of length N, or a sequence
- of N numbers to be mapped to colors using the cmap and norm
- specified via kwargs (see below). Note that c should not be
- a single numeric RGB or RGBA sequence because that is
- indistinguishable from an array of values to be colormapped.
- c can be a 2-D array in which the rows are RGB or RGBA,
- however.
- marker:
+ length as *x* and *y*.
+
+ *c*:
+ a color. *c* can be a single color format string, or a
+ sequence of color specifications of length *N*, or a
+ sequence of *N* numbers to be mapped to colors using the
+ *cmap* and *norm* specified via kwargs (see below). Note
+ that *c* should not be a single numeric RGB or RGBA
+ sequence because that is indistinguishable from an array
+ of values to be colormapped. *c* can be a 2-D array in
+ which the rows are RGB or RGBA, however.
+
+ *marker*:
can be on...
[truncated message content] |
|
From: <jd...@us...> - 2008-06-19 12:16:51
|
Revision: 5592
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5592&view=rev
Author: jdh2358
Date: 2008-06-19 05:16:50 -0700 (Thu, 19 Jun 2008)
Log Message:
-----------
reverted typo I accidentally introduced into mathtext.rst
Modified Paths:
--------------
trunk/matplotlib/doc/users/mathtext.rst
Modified: trunk/matplotlib/doc/users/mathtext.rst
===================================================================
--- trunk/matplotlib/doc/users/mathtext.rst 2008-06-19 12:15:20 UTC (rev 5591)
+++ trunk/matplotlib/doc/users/mathtext.rst 2008-06-19 12:16:50 UTC (rev 5592)
@@ -4,7 +4,7 @@
================================
You can use TeX markup in any matplotlib text string. Note that you
-do not need to have TeX installed, since matplotlib ships its own` TeX
+do not need to have TeX installed, since matplotlib ships its own TeX
expression parser, layout engine and fonts. The layout engine is a
fairly direct adaptation of the layout algorithms in Donald Knuth's
TeX, so the quality is quite good (matplotlib also provides a
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-06-19 12:15:34
|
Revision: 5591
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5591&view=rev
Author: jdh2358
Date: 2008-06-19 05:15:20 -0700 (Thu, 19 Jun 2008)
Log Message:
-----------
added installing section to users guide
Modified Paths:
--------------
trunk/matplotlib/doc/users/index.rst
trunk/matplotlib/doc/users/mathtext.rst
trunk/matplotlib/lib/matplotlib/lines.py
Modified: trunk/matplotlib/doc/users/index.rst
===================================================================
--- trunk/matplotlib/doc/users/index.rst 2008-06-18 22:06:03 UTC (rev 5590)
+++ trunk/matplotlib/doc/users/index.rst 2008-06-19 12:15:20 UTC (rev 5591)
@@ -13,6 +13,7 @@
:maxdepth: 2
intro.rst
+ installing.rst
pyplot_tutorial.rst
navigation_toolbar.rst
customizing.rst
Modified: trunk/matplotlib/doc/users/mathtext.rst
===================================================================
--- trunk/matplotlib/doc/users/mathtext.rst 2008-06-18 22:06:03 UTC (rev 5590)
+++ trunk/matplotlib/doc/users/mathtext.rst 2008-06-19 12:15:20 UTC (rev 5591)
@@ -4,7 +4,7 @@
================================
You can use TeX markup in any matplotlib text string. Note that you
-do not need to have TeX installed, since matplotlib ships its own TeX
+do not need to have TeX installed, since matplotlib ships its own` TeX
expression parser, layout engine and fonts. The layout engine is a
fairly direct adaptation of the layout algorithms in Donald Knuth's
TeX, so the quality is quite good (matplotlib also provides a
Modified: trunk/matplotlib/lib/matplotlib/lines.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/lines.py 2008-06-18 22:06:03 UTC (rev 5590)
+++ trunk/matplotlib/lib/matplotlib/lines.py 2008-06-19 12:15:20 UTC (rev 5591)
@@ -837,7 +837,7 @@
def _draw_thin_diamond(self, renderer, gc, path, path_trans):
offset = renderer.points_to_pixels(self._markersize)
transform = Affine2D().translate(-0.5, -0.5) \
- .rotate_deg(45).scale(offset * 0.6, offset)
+ .rot<ate_deg(45).scale(offset * 0.6, offset)
rgbFace = self._get_rgb_face()
renderer.draw_markers(gc, Path.unit_rectangle(), transform,
path, path_trans, rgbFace)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-06-18 22:06:13
|
Revision: 5590
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5590&view=rev
Author: jdh2358
Date: 2008-06-18 15:06:03 -0700 (Wed, 18 Jun 2008)
Log Message:
-----------
fixed some fig/colorbar rest problems
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/colorbar.py
trunk/matplotlib/lib/matplotlib/figure.py
Modified: trunk/matplotlib/lib/matplotlib/colorbar.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/colorbar.py 2008-06-18 20:26:35 UTC (rev 5589)
+++ trunk/matplotlib/lib/matplotlib/colorbar.py 2008-06-18 22:06:03 UTC (rev 5590)
@@ -89,6 +89,7 @@
'''
colorbar_doc = '''
+
Add a colorbar to a plot.
Function signatures for the :mod:`~matplotlib.pyplot` interface; all
Modified: trunk/matplotlib/lib/matplotlib/figure.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/figure.py 2008-06-18 20:26:35 UTC (rev 5589)
+++ trunk/matplotlib/lib/matplotlib/figure.py 2008-06-18 22:06:03 UTC (rev 5590)
@@ -1008,7 +1008,9 @@
colorbar.__doc__ = '''
Create a colorbar for a ScalarMappable instance.
- Documentation for the pylab thin wrapper: %s
+ Documentation for the pylab thin wrapper:
+ %s
+
'''% cbar.colorbar_doc
def subplots_adjust(self, *args, **kwargs):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-06-18 20:27:19
|
Revision: 5589
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5589&view=rev
Author: jdh2358
Date: 2008-06-18 13:26:35 -0700 (Wed, 18 Jun 2008)
Log Message:
-----------
added figure api doc
Modified Paths:
--------------
trunk/matplotlib/doc/api/index.rst
trunk/matplotlib/lib/matplotlib/colorbar.py
trunk/matplotlib/lib/matplotlib/figure.py
Added Paths:
-----------
trunk/matplotlib/doc/api/figure_api.rst
Added: trunk/matplotlib/doc/api/figure_api.rst
===================================================================
--- trunk/matplotlib/doc/api/figure_api.rst (rev 0)
+++ trunk/matplotlib/doc/api/figure_api.rst 2008-06-18 20:26:35 UTC (rev 5589)
@@ -0,0 +1,12 @@
+*****************
+matplotlib figure
+*****************
+
+
+:mod:`matplotlib.figure`
+========================
+
+.. automodule:: matplotlib.figure
+ :members:
+ :undoc-members:
+ :show-inheritance:
Modified: trunk/matplotlib/doc/api/index.rst
===================================================================
--- trunk/matplotlib/doc/api/index.rst 2008-06-18 19:38:57 UTC (rev 5588)
+++ trunk/matplotlib/doc/api/index.rst 2008-06-18 20:26:35 UTC (rev 5589)
@@ -13,6 +13,7 @@
matplotlib_configuration_api.rst
artist_api.rst
+ figure_api.rst
axes_api.rst
axis_api.rst
cbook_api.rst
Modified: trunk/matplotlib/lib/matplotlib/colorbar.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/colorbar.py 2008-06-18 19:38:57 UTC (rev 5588)
+++ trunk/matplotlib/lib/matplotlib/colorbar.py 2008-06-18 20:26:35 UTC (rev 5589)
@@ -101,6 +101,7 @@
colorbar(mappable, ax=ax, **kwargs)
arguments:
+
*mappable*
the image, :class:`~matplotlib.contours.ContourSet`, etc. to
which the colorbar applies; this argument is mandatory for the
@@ -109,6 +110,7 @@
default to the current image.
keyword arguments:
+
*cax*
None | axes object into which the colorbar will be drawn
*ax*
@@ -117,6 +119,7 @@
Additional keyword arguments are of two kinds:
+
axes properties:
%s
colorbar properties:
Modified: trunk/matplotlib/lib/matplotlib/figure.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/figure.py 2008-06-18 19:38:57 UTC (rev 5588)
+++ trunk/matplotlib/lib/matplotlib/figure.py 2008-06-18 20:26:35 UTC (rev 5589)
@@ -1,5 +1,18 @@
"""
-Figure class -- add docstring here!
+The figure module provides the top-level
+:class:`~matplotlib.artist.Artist`, the :class:`Figure`, which
+contains all the plot elements. The following classes are defined
+
+:class:`SubplotParams`
+ control the default spacing of the subplots
+
+:class:`BlockingMouseInput`
+ creates a callable object to retrieve mouse clicks in a blocking way for interactive sessions
+
+:class:`Figure`
+ top level container for all plot elements
+
+
"""
import numpy as np
import time
@@ -32,18 +45,24 @@
All dimensions are fraction of the figure width or height.
All values default to their rc params
- The following attributes are available:
+ The following attributes are available
- left : the left side of the subplots of the figure
- right : the right side of the subplots of the figure
- bottom : the bottom of the subplots of the figure
- top : the top of the subplots of the figure
- wspace : the amount of width reserved for blank space between subplots
- hspace : the amount of height reserved for white space between subplots
+ *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
+ *validate*
+ make sure the params are in a legal state (*left*<*right*, etc)
+ """
- validate : make sure the params are in a legal state
- (left<right, etc)
- """
self.validate = True
self.update(left, bottom, right, top, wspace, hspace)
@@ -100,17 +119,19 @@
class BlockingMouseInput(object):
- """ Class that creates a callable object to retrieve mouse clicks in a
- blocking way.
"""
+ Class that creates a callable object to retrieve mouse clicks in a
+ blocking way.
+ """
def __init__(self, fig):
self.fig = fig
def on_click(self, event):
- """ Event handler that will be passed to the current figure to
- retrieve clicks.
"""
+ Event handler that will be passed to the current figure to
+ retrieve clicks.
+ """
if event.button == 3:
# If it's a right click, pop the last coordinates.
if len(self.clicks) > 0:
@@ -137,9 +158,10 @@
def __call__(self, n=1, timeout=30, verbose=False, show_clicks=True):
- """ Blocking call to retrieve n coordinate pairs through mouse
- clicks.
"""
+ Blocking call to retrieve n coordinate pairs through mouse
+ clicks.
+ """
self.verbose = verbose
self.done = False
self.clicks = []
@@ -179,10 +201,17 @@
class Figure(Artist):
"""
- The Figure instance supports callbacks through a callbacks
- attribute which is a cbook.CallbackRegistry instance. The events
- you can connect to are 'dpi_changed', and the callback will be
- called with func(fig) where fig is the Figure instance
+ The Figure instance supports callbacks through a *callbacks*
+ attribute which is a :class:`matplotlib.cbook.CallbackRegistry`
+ instance. The events you can connect to are 'dpi_changed', and
+ the callback will be called with ``func(fig)`` where fig is the
+ :class:`Figure` instance.
+
+ The figure patch is drawn by a the attribute
+
+ *figurePatch*
+ a :class:`matplotlib.patches.Rectangle` instance
+
"""
def __str__(self):
@@ -198,9 +227,20 @@
subplotpars = None, # default to rc
):
"""
- figsize is a w,h tuple in inches
- dpi is dots per inch
- subplotpars is a SubplotParams instance, defaults to rc
+ *figsize*
+ w,h tuple in inches
+ *dpi*
+ dots per inch
+ *facecolor*
+ the figure patch facecolor; defaults to rc ``figure.facecolor``
+ *edgecolor*
+ the figure patch edge color; defaults to rc ``figure.edgecolor``
+ *linewidth*
+ the figure patch edge linewidth; the default linewidth of the frame
+ *frameon*
+ if False, suppress drawing the figure frame
+ *subplotpars*
+ a :class:`SubplotParams` instance, defaults to rc
"""
Artist.__init__(self)
@@ -258,10 +298,12 @@
bottom subplot and turn them off on other subplots, as well as
turn off xlabels.
-
- bottom : the bottom of the subplots for subplots_adjust
- rotation: the rotation of the xtick labels
- ha : the horizontal alignment of the xticklabels
+ *bottom*
+ the bottom of the subplots for :meth:`subplots_adjust`
+ *rotation*
+ the rotation of the xtick labels
+ *ha*
+ the horizontal alignment of the xticklabels
"""
allsubplots = np.alltrue([hasattr(ax, 'is_last_row') for ax in self.axes])
if len(self.axes)==1:
@@ -295,7 +337,8 @@
return children
def contains(self, mouseevent):
- """Test whether the mouse event occurred on the figure.
+ """
+ Test whether the mouse event occurred on the figure.
Returns True,{}
"""
@@ -313,17 +356,21 @@
"""
add a centered title to the figure
- kwargs are matplotlib.text.Text properties. Using figure
+ kwargs are :class:`matplotlib.text.Text` properties. Using figure
coordinates, the defaults are
- x = 0.5
- y = 0.98
- horizontalalignment = 'center'
- verticalalignment = 'top'
+ *x* = 0.5
+ the x location of text in figure coords
+ *y* = 0.98
+ the y location of the text in figure coords
+ *horizontalalignment* = 'center'
+ the horizontal alignment of the text
+ *verticalalignment* = 'top'
+ the vertical alignment of the text
- The matplotlib.text.Text instance is returned
+ The :class:`matplotlib.text.Text` instance is returned
- Example:
+ Example::
fig.subtitle('this is the figure title', fontsize=12)
"""
@@ -351,10 +398,11 @@
Set the hold state. If hold is None (default), toggle the
hold state. Else set the hold state to boolean value b.
- Eg
- hold() # toggle hold
- hold(True) # hold is on
- hold(False) # hold is off
+ Eg::
+
+ hold() # toggle hold
+ hold(True) # hold is on
+ hold(False) # hold is off
"""
if b is None: self._hold = not self._hold
else: self._hold = b
@@ -411,7 +459,7 @@
resampled to fit the current axes. If you want a resampled image to
fill the entire figure, you can define an Axes with size [0,1,0,1].
- An image.FigureImage instance is returned.
+ An :class:`matplotlib.image.FigureImage` instance is returned.
"""
if not self._hold: self.clf()
@@ -435,10 +483,12 @@
Set the figure size in inches
- Usage: set_size_inches(self, w,h) OR
- set_size_inches(self, (w,h) )
+ Usage::
- optional kwarg forward=True will cause the canvas size to be
+ fig.set_size_inches(w,h) # OR
+ fig.set_size_inches((w,h) )
+
+ optional kwarg *forward=True* will cause the canvas size to be
automatically updated; eg you can resize the figure window
from the shell
@@ -578,31 +628,30 @@
Add an a axes with axes rect [left, bottom, width, height] where all
quantities are in fractions of figure width and height. kwargs are
legal Axes kwargs plus "projection" which sets the projection type
- of the axes. (For backward compatibility, polar=True may also be
- provided, which is equivalent to projection='polar').
+ of the axes. (For backward compatibility, *polar=True* may also be
+ provided, which is equivalent to *projection='polar'*).
Valid values for "projection" are: %s. Some of these projections
- support additional kwargs, which may be provided to add_axes.
+ support additional kwargs, which may be provided to add_axes::
rect = l,b,w,h
- add_axes(rect)
- add_axes(rect, frameon=False, axisbg='g')
- add_axes(rect, polar=True)
- add_axes(rect, projection='polar')
- add_axes(ax) # add an Axes instance
+ fig.add_axes(rect)
+ fig.add_axes(rect, frameon=False, axisbg='g')
+ fig.add_axes(rect, polar=True)
+ fig.add_axes(rect, projection='polar')
+ fig.add_axes(ax) # add an Axes instance
-
If the figure already has an axes with key *args, *kwargs then it will
simply make that axes current and return it. If you do not want this
behavior, eg you want to force the creation of a new axes, you must
use a unique set of args and kwargs. The artist "label" attribute has
been exposed for this purpose. Eg, if you want two axes that are
otherwise identical to be added to the figure, make sure you give them
- unique labels:
+ unique labels::
- add_axes(rect, label='axes1')
- add_axes(rect, label='axes2')
+ fig.add_axes(rect, label='axes1')
+ fig.add_axes(rect, label='axes2')
- The Axes instance will be returned
+ The :class:`~matplotlib.axes.Axes` instance will be returned.
The following kwargs are supported:
%s
@@ -643,24 +692,24 @@
def add_subplot(self, *args, **kwargs):
"""
- Add a subplot. Examples
+ Add a subplot. Examples:
- add_subplot(111)
- add_subplot(1,1,1) # equivalent but more general
- add_subplot(212, axisbg='r') # add subplot with red background
- add_subplot(111, polar=True) # add a polar subplot
- add_subplot(sub) # add Subplot instance sub
+ fig.add_subplot(111)
+ fig.add_subplot(1,1,1) # equivalent but more general
+ fig.add_subplot(212, axisbg='r') # add subplot with red background
+ fig.add_subplot(111, polar=True) # add a polar subplot
+ fig.add_subplot(sub) # add Subplot instance sub
- kwargs are legal Axes kwargs plus "projection", which chooses
+ *kwargs* are legal :class:`!matplotlib.axes.Axes` kwargs plus *projection*, which chooses
a projection type for the axes. (For backward compatibility,
- polar=True may also be provided, which is equivalent to
- projection='polar'). Valid values for "projection" are: %s.
- Some of these projections support additional kwargs, which may
- be provided to add_axes.
+ *polar=True* may also be provided, which is equivalent to
+ *projection='polar'*). Valid values for *projection* are: %s.
+ Some of these projections support additional *kwargs*, which may
+ be provided to :meth:`add_axes`.
- The Axes instance will be returned.
+ The :class:`~matplotlib.axes.Axes` instance will be returned.
- If the figure already has a subplot with key *args, *kwargs then it will
+ If the figure already has a subplot with key *args*, *kwargs* then it will
simply make that subplot current and return it
The following kwargs are supported:
@@ -731,7 +780,7 @@
def draw(self, renderer):
"""
- Render the figure using Renderer instance renderer
+ Render the figure using :class:`matplotlib.backend_bases.RendererBase` instance renderer
"""
# draw the figure bounding box, perhaps none for white figure
#print 'figure draw'
@@ -777,7 +826,10 @@
self.canvas.draw_event(renderer)
def draw_artist(self, a):
- 'draw artist only -- this is available only after the figure is drawn'
+ """
+ draw :class:`matplotlib.artist.Artist` instance *a* only --
+ this is available only after the figure is drawn
+ """
assert self._cachedRenderer is not None
a.draw(self._cachedRenderer)
@@ -787,16 +839,18 @@
def legend(self, handles, labels, *args, **kwargs):
"""
Place a legend in the figure. Labels are a sequence of
- strings, handles is a sequence of line or patch instances, and
- loc can be a string or an integer specifying the legend
- location
+ strings, handles is a sequence of
+ :class:`~matplotlib.lines.Line2D` or
+ :class:`~matplotlib.patches.Patch` instances, and loc can be a
+ string or an integer specifying the legend location
- USAGE:
+ USAGE::
+
legend( (line1, line2, line3),
('label1', 'label2', 'label3'),
'upper right')
- The LOC location codes are
+ The *loc* location codes are::
'best' : 0, (currently not supported for figure legends)
'upper right' : 1,
@@ -810,27 +864,35 @@
'upper center' : 9,
'center' : 10,
- loc can also be an (x,y) tuple in figure coords, which
+ *loc* can also be an (x,y) tuple in figure coords, which
specifies the lower left of the legend box. figure coords are
(0,0) is the left, bottom of the figure and 1,1 is the right,
top.
- The legend instance is returned. The following kwargs are supported:
+ The legend instance is returned. The following kwargs are supported
- loc = "upper right" #
- numpoints = 4 # the number of points in the legend line
- prop = FontProperties(size='smaller') # the font property
- pad = 0.2 # the fractional whitespace inside the legend border
- markerscale = 0.6 # the relative size of legend markers vs. original
- shadow # if True, draw a shadow behind legend
- labelsep = 0.005 # the vertical space between the legend entries
- handlelen = 0.05 # the length of the legend lines
- handletextsep = 0.02 # the space between the legend line and legend text
- axespad = 0.02 # the border between the axes and legend edge
+ *loc*
+ the location of the legend
+ *numpoints*
+ the number of points in the legend line
+ *prop*
+ a :class:`matplotlib.font_manager.FontProperties` instance
+ *pad*
+ the fractional whitespace inside the legend border
+ *markerscale*
+ the relative size of legend markers vs. original
+ *shadow*
+ if True, draw a shadow behind legend
+ *labelsep*
+ the vertical space between the legend entries
+ *handlelen*
+ the length of the legend lines
+ *handletextsep*
+ the space between the legend line and legend text
+ *axespad*
+ the border between the axes and legend edge
"""
-
-
handles = flatten(handles)
l = Legend(self, handles, labels, *args, **kwargs)
self.legends.append(l)
@@ -841,7 +903,7 @@
Add text to figure at location x,y (relative 0-1 coords) See
the help for Axis text for the meaning of the other arguments
- kwargs control the Text properties:
+ kwargs control the :class:`~matplotlib.text.Text` properties:
%(Text)s
"""
@@ -951,11 +1013,11 @@
def subplots_adjust(self, *args, **kwargs):
"""
- subplots_adjust(self, left=None, bottom=None, right=None, top=None,
- wspace=None, hspace=None)
- fig.subplots_adjust(left=None, bottom=None, right=None, wspace=None, hspace=None):
- Update the SubplotParams with kwargs (defaulting to rc where
+ fig.subplots_adjust(left=None, bottom=None, right=None, wspace=None, hspace=None)
+
+ Update the :class:`SubplotParams` with *kwargs* (defaulting to rc where
None) and update the subplot locations
+
"""
self.subplotpars.update(*args, **kwargs)
import matplotlib.axes
@@ -994,14 +1056,14 @@
def figaspect(arg):
"""
- Create a figure with specified aspect ratio. If arg is a number,
- use that aspect ratio. If arg is an array, figaspect will
+ Create a figure with specified aspect ratio. If *arg* is a number,
+ use that aspect ratio. If *arg* is an array, figaspect will
determine the width and height for a figure that would fit array
preserving aspect ratio. The figure width, height in inches are
returned. Be sure to create an axes with equal with and height,
eg
- Example usage:
+ Example usage::
# make a figure twice as tall as it is wide
w, h = figaspect(2.)
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: <md...@us...> - 2008-06-18 17:23:02
|
Revision: 5587
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5587&view=rev
Author: mdboom
Date: 2008-06-18 10:20:40 -0700 (Wed, 18 Jun 2008)
Log Message:
-----------
Fix wx backend clipping bug.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_wx.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_wx.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2008-06-17 21:01:29 UTC (rev 5586)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2008-06-18 17:20:40 UTC (rev 5587)
@@ -283,13 +283,13 @@
if new_bounds is not None:
new_bounds = new_bounds.bounds
gfx_ctx = gc.gfx_ctx
- if True or gfx_ctx._lastcliprect != new_bounds:
+ if gfx_ctx._lastcliprect != new_bounds:
gfx_ctx._lastcliprect = new_bounds
if new_bounds is None:
gfx_ctx.ResetClip()
else:
gfx_ctx.Clip(new_bounds[0], self.height - new_bounds[1] - new_bounds[3],
- new_bounds[1], new_bounds[3])
+ new_bounds[2], new_bounds[3])
#@staticmethod
def convert_path(gfx_ctx, tpath):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|