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: <ef...@us...> - 2008-06-17 21:01:46
|
Revision: 5586
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5586&view=rev
Author: efiring
Date: 2008-06-17 14:01:29 -0700 (Tue, 17 Jun 2008)
Log Message:
-----------
Accepted coding guide; deleted notes from outline.rst
Modified Paths:
--------------
trunk/matplotlib/doc/devel/outline.rst
Modified: trunk/matplotlib/doc/devel/outline.rst
===================================================================
--- trunk/matplotlib/doc/devel/outline.rst 2008-06-17 19:07:51 UTC (rev 5585)
+++ trunk/matplotlib/doc/devel/outline.rst 2008-06-17 21:01:29 UTC (rev 5586)
@@ -62,7 +62,7 @@
the artist John has author ?
transforms Michael submitted John
documenting mpl Darren submitted John, Eric, Mike?
-coding guide John in review Eric
+coding guide John complete Eric
and_much_more ? ? ?
=============================== ==================== =========== ===================
@@ -136,105 +136,3 @@
- Done. It's pretty extensive, thanks to STIX... - MGD
-coding guide (reviewed by EF)
------------------------------
-
-Mostly fine (see :ref:`coding-guide`), just a few comments.
-Also, there are a couple of typos, but I would rather just edit those
-directly in another pass (if you don't happen to find them) than
-include them as formal review notes.
-
-#. DONE - Import recommendation for ma: given that the trunk is
- requiring numpy 1.1, perhaps we should be consistent and
- recommend the form::
-
- import numpy.ma as ma
-
- for use in the trunk.
- A note about the difference between the two forms and the
- history can stay in place, and the alternative form would
- still be required for the maintenance branch, I presume.
-
-#. This is peripheral, but regarding the example::
-
- mpl.rcParams['xtick.major.pad'] = 6
-
- At least at the application level, I think we should move
- towards using validation routinely when setting rcParams,
- to reduce a source of hard-to-find bugs. I don't know to
- what extent Darren's traits-based system takes care of
- this, but if it does, that is a big point in its favor.
- There are alternatives (e.g. building validation into the
- rc() function and using that instead of setting the
- dictionary entries directly), if necessary.
-
- Darren notes:
-
- Validation is actually built into RcParams. This was done
- just prior to development of the traited config, validation is done using
- the mechanisms developed in rcsetup. For example::
-
- >>> rcParams['a.b']=1
- ---------------------------------------------------------------------------
- KeyError Traceback (most recent call last)
-
- /home/darren/<ipython console> in <module>()
-
- /usr/lib64/python2.5/site-packages/matplotlib/__init__.pyc in __setitem__(self, key, val)
- 555 except KeyError:
- 556 raise KeyError('%s is not a valid rc parameter.\
- --> 557 See rcParams.keys() for a list of valid parameters.'%key)
- 558
- 559
-
- KeyError: 'a.b is not a valid rc parameter.See rcParams.keys() for a list of valid parameters.'
-
- also::
-
- rcParams['text.usetex']=''
- ---------------------------------------------------------------------------
- ValueError Traceback (most recent call last)
-
- /home/darren/<ipython console> in <module>()
-
- /usr/lib64/python2.5/site-packages/matplotlib/__init__.pyc in __setitem__(self, key, val)
- 551 instead.'% (key, alt))
- 552 key = alt
- --> 553 cval = self.validate[key](val)
- 554 dict.__setitem__(self, key, cval)
- 555 except KeyError:
-
- /usr/lib64/python2.5/site-packages/matplotlib/rcsetup.pyc in validate_bool(b)
- 56 elif b in ('f', 'n', 'no', 'off', 'false', '0', 0, False): return False
- 57 else:
- ---> 58 raise ValueError('Could not convert "%s" to boolean' % b)
- 59
- 60 def validate_bool_maybe_none(b):
-
- ValueError: Could not convert "" to boolean
-
-
-
-#. DONE - You give the example::
-
- import matplotlib.cbook as cbook
-
- Should there also be a list of the standard variants like
- ``mtransforms``? (And, again peripherally, I would
- shorten that one to ``mtrans``.)
-
-#. DONE - The treatment of whitespace is split into two parts
- separated by paragraphs on docstrings and line length;
- this can be consolidated. It might be worth mentioning
- the ``reindent.py`` and ``tabnanny.py`` utilities here.
-
-#. DONE - (removed first person usage) - Minor question of literary
- style: should use of the first person be avoided in most places?
- It is used, for example, in the discussion of the automatic kwarg
- doc generation. I don't mind leaving the first person in, with the
- general understanding that it means you.
-
-#. DONE - Licenses: you might want to add a link to your
- explanation of your BSD choice. Peripheral question: is
- there any problem with basemap's inclusion of
- sub-packages with the gamut of licenses, GPL to MIT?
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-06-17 19:08:02
|
Revision: 5585
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5585&view=rev
Author: mdboom
Date: 2008-06-17 12:07:51 -0700 (Tue, 17 Jun 2008)
Log Message:
-----------
Minor doc formatting issues.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backend_bases.py
trunk/matplotlib/lib/matplotlib/cbook.py
trunk/matplotlib/lib/matplotlib/collections.py
trunk/matplotlib/lib/matplotlib/path.py
trunk/matplotlib/lib/matplotlib/transforms.py
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py 2008-06-17 19:01:38 UTC (rev 5584)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py 2008-06-17 19:07:51 UTC (rev 5585)
@@ -56,14 +56,14 @@
def open_group(self, s):
"""
- Open a grouping element with label ``s.`` Is only currently used by
+ Open a grouping element with label *s*. Is only currently used by
:mod:`~matplotlib.backends.backend_svg`
"""
pass
def close_group(self, s):
"""
- Close a grouping element with label ``s``
+ Close a grouping element with label *s*
Is only currently used by :mod:`~matplotlib.backends.backend_svg`
"""
pass
@@ -82,20 +82,19 @@
that behavior, those vertices should be removed before calling
this function.
- ``gc``
+ *gc*
the :class:`GraphicsContextBase` instance
- ``marker_trans``
+ *marker_trans*
is an affine transform applied to the marker.
- ``trans``
+ *trans*
is an affine transform applied to the path.
This provides a fallback implementation of draw_markers that
- makes multiple calls to
- :meth:`draw_path`. Some
- backends may want to override this method in order to draw the
- marker only once and reuse it multiple times.
+ makes multiple calls to :meth:`draw_path`. Some backends may
+ want to override this method in order to draw the marker only
+ once and reuse it multiple times.
"""
tpath = trans.transform_path(path)
for x, y in tpath.vertices:
@@ -109,25 +108,23 @@
linestyles, antialiaseds):
"""
Draws a collection of paths, selecting drawing properties from
- the lists ``facecolors``, ``edgecolors``, ``linewidths``,
- ``linestyles`` and ``antialiaseds``. `` offsets`` is a list of
+ the lists *facecolors*, *edgecolors*, *linewidths*,
+ *linestyles* and *antialiaseds*. *offsets* is a list of
offsets to apply to each of the paths. The offsets in
- ``offsets`` are first transformed by ``offsetTrans`` before
+ *offsets* are first transformed by *offsetTrans* before
being applied.
This provides a fallback implementation of
- draw_path_collection that makes multiple calls to draw_path.
- Some backends may want to override this in order to render
- each set of path data only once, and then reference that path
- multiple times with the different offsets, colors, styles etc.
- The generator methods
- :meth:`_iter_collection_raw_paths`
- and
- :meth:`_iter_collection`
- are provided to help with (and standardize) the implementation
- across backends. It is highly recommended to use those
- generators, so that changes to the behavior of
- draw_path_collection can be made globally.
+ :meth:`draw_path_collection` that makes multiple calls to
+ draw_path. Some backends may want to override this in order
+ to render each set of path data only once, and then reference
+ that path multiple times with the different offsets, colors,
+ styles etc. The generator methods
+ :meth:`_iter_collection_raw_paths` and
+ :meth:`_iter_collection` are provided to help with (and
+ standardize) the implementation across backends. It is highly
+ recommended to use those generators, so that changes to the
+ behavior of :meth:`draw_path_collection` can be made globally.
"""
path_ids = []
for path, transform in self._iter_collection_raw_paths(
@@ -147,8 +144,9 @@
offsets, offsetTrans, facecolors, antialiased,
showedges):
"""
- This provides a fallback implementation of draw_quad_mesh that
- generates paths and then calls :meth:`draw_path_collection`.
+ This provides a fallback implementation of
+ :meth:`draw_quad_mesh` that generates paths and then calls
+ :meth:`draw_path_collection`.
"""
from matplotlib.collections import QuadMesh
paths = QuadMesh.convert_mesh_to_paths(
@@ -180,7 +178,7 @@
:meth:`draw_path_collection`.
The backend should take each yielded path and transform and
- create an object can be referenced (reused) later.
+ create an object that can be referenced (reused) later.
"""
Npaths = len(paths)
Ntransforms = len(all_transforms)
@@ -208,20 +206,20 @@
This method yields all of the path, offset and graphics
context combinations to draw the path collection. The caller
should already have looped over the results of
- _iter_collection_raw_paths to draw this collection.
+ :meth:`_iter_collection_raw_paths` to draw this collection.
The arguments should be the same as that passed into
- draw_path_collection, with the exception of path_ids, which
- is a list of arbitrary objects that the backend will use to
- reference one of the paths created in the
- _iter_collection_raw_paths stage.
+ :meth:`draw_path_collection`, with the exception of
+ *path_ids*, which is a list of arbitrary objects that the
+ backend will use to reference one of the paths created in the
+ :meth:`_iter_collection_raw_paths` stage.
- Each yielded result is of the form:
+ Each yielded result is of the form::
xo, yo, path_id, gc, rgbFace
- where xo, yo is an offset; path_id is one of the elements of
- path_ids; gc is a graphics context and rgbFace is a color to
+ where *xo*, *yo* is an offset; *path_id* is one of the elements of
+ *path_ids*; *gc* is a graphics context and *rgbFace* is a color to
use for filling the path.
"""
Npaths = len(path_ids)
@@ -280,18 +278,18 @@
"""
Draw the image instance into the current axes;
- ``x``
+ *x*
is the distance in pixels from the left hand side of the canvas.
- ``y``
+ *y*
the distance from the origin. That is, if origin is
upper, y is the distance from top. If origin is lower, y
is the distance from bottom
- ``im``
+ *im*
the :class:`matplotlib._image.Image` instance
- ``bbox``
+ *bbox*
a :class:`matplotlib.transforms.Bbox` instance for clipping, or
None
@@ -312,22 +310,22 @@
"""
Draw the text instance
- ``gc``
+ *gc*
the :class:`GraphicsContextBase` instance
- ``x``
+ *x*
the x location of the text in display coords
- ``y``
+ *y*
the y location of the text in display coords
- ``s``
+ *s*
a :class:`matplotlib.text.Text` instance
- ``prop``
+ *prop*
a :class:`matplotlib.font_manager.FontProperties` instance
- ``angle``
+ *angle*
the rotation angle in degrees
**backend implementers note**
@@ -382,7 +380,7 @@
"""
Convert points to display units
- ``points``
+ *points*
a float or a numpy array of float
return points converted to pixels
@@ -559,10 +557,10 @@
"""
Set the dash style for the gc.
- ``dash_offset``
+ *dash_offset*
is the offset (usually 0).
- ``dash_list``
+ *dash_list*
specifies the on-off sequence as points. ``(None, None)`` specifies a solid line
"""
@@ -574,9 +572,9 @@
html hex color string, an rgb unit tuple, or a float between 0
and 1. In the latter case, grayscale is used.
- The :class:`GraphicsContextBase` converts colors to rgb internally. If you
- know the color is rgb already, you can set ``isRGB=True`` to
- avoid the performace hit of the conversion
+ The :class:`GraphicsContextBase` converts colors to rgb
+ internally. If you know the color is rgb already, you can set
+ ``isRGB=True`` to avoid the performace hit of the conversion
"""
if isRGB:
self._rgb = fg
@@ -585,7 +583,7 @@
def set_graylevel(self, frac):
"""
- Set the foreground color to be a gray level with ``frac`` frac
+ Set the foreground color to be a gray level with *frac*
"""
self._rgb = (frac, frac, frac)
@@ -634,13 +632,13 @@
:meth:`FigureCanvasBase.mpl_connect`. The following attributes
are defined and shown with their default values
- ``name``
+ *name*
the event name
- ``canvas``
+ *canvas*
the FigureCanvas instance generating the event
- ``guiEvent``
+ *guiEvent*
the GUI event that triggered the matplotlib event
@@ -657,7 +655,7 @@
In addition to the :class:`Event` attributes, the following event attributes are defined:
- ``renderer``
+ *renderer*
the :class:`RendererBase` instance for the draw event
"""
@@ -671,10 +669,10 @@
In addition to the :class:`Event` attributes, the following event attributes are defined:
- ``width``
+ *width*
width of the canvas in pixels
- ``height``
+ *height*
height of the canvas in pixels
"""
@@ -691,19 +689,19 @@
In addition to the :class:`Event` attributes, the following event attributes are defined:
- ``x``
+ *x*
x position - pixels from left of canvas
- ``y``
+ *y*
y position - pixels from bottom of canvas
- ``inaxes``
+ *inaxes*
the :class:`~matplotlib.axes.Axes` instance if mouse is over axes
- ``xdata``
+ *xdata*
x coord of mouse in data coords
- ``ydata``
+ *ydata*
y coord of mouse in data coords
"""
@@ -715,7 +713,7 @@
def __init__(self, name, canvas, x, y,guiEvent=None):
"""
- ``x``, ``y`` in figure coords, 0,0 = bottom, left
+ *x*, *y* in figure coords, 0,0 = bottom, left
"""
Event.__init__(self, name, canvas,guiEvent=guiEvent)
self.x = x
@@ -755,10 +753,10 @@
In addition to the :class:`Event` and :class:`LocationEvent`
attributes, the following attributes are defined:
- ``button``
+ *button*
button pressed None, 1, 2, 3, 'up', 'down' (up and down are used for scroll events)
- ``key``
+ *key*
the key pressed: None, chr(range(255), 'shift', 'win', or 'control'
@@ -794,10 +792,10 @@
Attrs: all the :class:`Event` attributes plus
- ``mouseevent``
+ *mouseevent*
the :class:`MouseEvent` that generated the pick
- ``artist``
+ *artist*
the :class:`~matplotlib.artist.Artist` picked
other
@@ -837,7 +835,7 @@
In addition to the :class:`Event` and :class:`LocationEvent`
attributes, the following attributes are defined:
- ``key``
+ *key*
the key pressed: None, chr(range(255), shift, win, or control
This interface may change slightly when better support for
@@ -864,7 +862,7 @@
Public attributes
- ``figure``
+ *figure*
A :class:`matplotlib.figure.Figure` instance
"""
@@ -1077,13 +1075,13 @@
Backend derived classes should call this function on any mouse
button release.
- ``x``
+ *x*
the canvas coordinates where 0=left
- ``y``
+ *y*
the canvas coordinates where 0=bottom
- ``guiEvent``
+ *guiEvent*
the native UI event that generated the mpl event
@@ -1101,13 +1099,13 @@
Backend derived classes should call this function on any
motion-notify-event.
- ``x``
+ *x*
the canvas coordinates where 0=left
- ``y``
+ *y*
the canvas coordinates where 0=bottom
- ``guiEvent``
+ *guiEvent*
the native UI event that generated the mpl event
@@ -1225,25 +1223,25 @@
Arguments are:
- ``filename``
+ *filename*
can also be a file object on image backends
- ``orientation``
+ *orientation*
only currently applies to PostScript printing.
- ``dpi``
+ *dpi*
the dots per inch to save the figure in; if None, use savefig.dpi
- ``facecolor``
+ *facecolor*
the facecolor of the figure
- ``edgecolor``
+ *edgecolor*
the edgecolor of the figure
- ``orientation`` '
+ *orientation* '
landscape' | 'portrait' (not supported on all backends)
- ``format``
+ *format*
when set, forcibly set the file format to save to
"""
if format is None:
@@ -1380,10 +1378,10 @@
Public attibutes:
- ``canvas``
+ *canvas*
A :class:`FigureCanvasBase` instance
- ``num``
+ *num*
The figure nuamber
"""
def __init__(self, canvas, num):
Modified: trunk/matplotlib/lib/matplotlib/cbook.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/cbook.py 2008-06-17 19:01:38 UTC (rev 5584)
+++ trunk/matplotlib/lib/matplotlib/cbook.py 2008-06-17 19:07:51 UTC (rev 5585)
@@ -212,7 +212,7 @@
return 1
def is_writable_file_like(obj):
- 'return true if *obj* looks like a file object'
+ 'return true if *obj* looks like a file object with a *write* method'
return hasattr(obj, 'write') and callable(obj.write)
def is_scalar(obj):
@@ -615,8 +615,8 @@
def allequal(seq):
"""
- return true if all elements of *seq* compare equal. If *seq* is 0
- or 1 length, return *True*
+ Return *True* if all elements of *seq* compare equal. If *seq* is
+ 0 or 1 length, return *True*
"""
if len(seq)<2: return True
val = seq[0]
@@ -626,14 +626,20 @@
return True
def alltrue(seq):
- #return true if all elements of seq are true. If seq is empty return false
+ """
+ Return *True* if all elements of *seq* evaluate to *True*. If
+ *seq* is empty, return *False*.
+ """
if not len(seq): return False
for val in seq:
if not val: return False
return True
def onetrue(seq):
- #return true if one element of seq is true. If seq is empty return false
+ """
+ Return *True* if one element of *seq* is *True*. It *seq* is
+ empty, return *False*.
+ """
if not len(seq): return False
for val in seq:
if val: return True
@@ -948,8 +954,8 @@
would be overkill.
Objects can be joined using :meth:`join`, tested for connectedness
- using :meth:`joined`, and all disjoint sets can be retreived using
- :meth:`get`.
+ using :meth:`joined`, and all disjoint sets can be retreived by
+ using the object as an iterator.
The objects being joined must be hashable.
@@ -978,8 +984,8 @@
def join(self, a, *args):
"""
- Join given arguments into the same set.
- Accepts one or more arguments.
+ Join given arguments into the same set. Accepts one or more
+ arguments.
"""
mapping = self._mapping
set_a = mapping.setdefault(a, [a])
@@ -1018,8 +1024,7 @@
def get_siblings(self, a):
"""
- Returns all of the items joined with the given item, including
- itself.
+ Returns all of the items joined with *a*, including itself.
"""
return self._mapping.get(a, [a])
Modified: trunk/matplotlib/lib/matplotlib/collections.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/collections.py 2008-06-17 19:01:38 UTC (rev 5584)
+++ trunk/matplotlib/lib/matplotlib/collections.py 2008-06-17 19:07:51 UTC (rev 5585)
@@ -393,27 +393,31 @@
class QuadMesh(Collection):
"""
Class for the efficient drawing of a quadrilateral mesh.
- A quadrilateral mesh consists of a grid of vertices. The dimensions
- of this array are (meshWidth+1, meshHeight+1). Each vertex in
- the mesh has a different set of "mesh coordinates" representing
- its position in the topology of the mesh. For any values (m, n)
- such that 0 <= m <= meshWidth and 0 <= n <= meshHeight, the
- vertices at mesh coordinates (m, n), (m, n+1), (m+1, n+1), and
- (m+1, n) form one of the quadrilaterals in the mesh. There are
- thus (meshWidth * meshHeight) quadrilaterals in the mesh.
- The mesh need not be regular and the polygons need not be convex.
- A quadrilateral mesh is represented by a
- (2 x ((meshWidth + 1) * (meshHeight + 1))) numpy array
- 'coordinates' where each row is the X and Y coordinates of one
- of the vertices.
- To define the function that maps from a data point to
- its corresponding color, use the set_cmap() function.
- Each of these arrays is indexed in row-major order by the
- mesh coordinates of the vertex (or the mesh coordinates of
- the lower left vertex, in the case of the colors). For example,
- the first entry in coordinates is the coordinates of the vertex
- at mesh coordinates (0, 0), then the one at (0, 1), then at
- (0, 2) .. (0, meshWidth), (1, 0), (1, 1), and so on.
+
+ A quadrilateral mesh consists of a grid of vertices. The
+ dimensions of this array are (*meshWidth* + 1, *meshHeight* +
+ 1). Each vertex in the mesh has a different set of "mesh
+ coordinates" representing its position in the topology of the
+ mesh. For any values (*m*, *n*) such that 0 <= *m* <= *meshWidth*
+ and 0 <= *n* <= *meshHeight*, the vertices at mesh coordinates
+ (*m*, *n*), (*m*, *n* + 1), (*m* + 1, *n* + 1), and (*m* + 1, *n*)
+ form one of the quadrilaterals in the mesh. There are thus
+ (*meshWidth* * *meshHeight*) quadrilaterals in the mesh. The mesh
+ need not be regular and the polygons need not be convex.
+
+ A quadrilateral mesh is represented by a (2 x ((*meshWidth* + 1) *
+ (*meshHeight* + 1))) numpy array *coordinates*, where each row is
+ the *x* and *y* coordinates of one of the vertices. To define the
+ function that maps from a data point to its corresponding color,
+ use the :meth:`set_cmap` method. Each of these arrays is indexed in
+ row-major order by the mesh coordinates of the vertex (or the mesh
+ coordinates of the lower left vertex, in the case of the
+ colors).
+
+ For example, the first entry in *coordinates* is the
+ coordinates of the vertex at mesh coordinates (0, 0), then the one
+ at (0, 1), then at (0, 2) .. (0, meshWidth), (1, 0), (1, 1), and
+ so on.
"""
def __init__(self, meshWidth, meshHeight, coordinates, showedges, antialiased=True):
Collection.__init__(self)
@@ -441,6 +445,13 @@
#@staticmethod
def convert_mesh_to_paths(meshWidth, meshHeight, coordinates):
+ """
+ Converts a given mesh into a sequence of
+ :class:`matplotlib.path.Path` objects for easier rendering by
+ backends that do not directly support quadmeshes.
+
+ This function is primarily of use to backend implementers.
+ """
Path = mpath.Path
c = coordinates
@@ -502,11 +513,11 @@
def __init__(self, verts, sizes = None, **kwargs):
"""
*verts* is a sequence of ( *verts0*, *verts1*, ...) where
- *verts_i* is a sequence of xy tuples of vertices, or an
- equivalent :mod:`numpy` array of shape (nv,2).
+ *verts_i* is a sequence of *xy* tuples of vertices, or an
+ equivalent :mod:`numpy` array of shape (*nv*, 2).
*sizes* gives the area of the circle circumscribing the
- polygon in points^2
+ polygon in points^2.
%(Collection)s
"""
@@ -534,16 +545,16 @@
class BrokenBarHCollection(PolyCollection):
"""
- A collection of horizontal bars spanning yrange with a sequence of
- xranges
+ A collection of horizontal bars spanning *yrange* with a sequence of
+ *xranges*.
"""
def __init__(self, xranges, yrange, **kwargs):
"""
*xranges*
- sequence of (xmin, xwidth)
+ sequence of (*xmin*, *xwidth*)
*yrange*
- ymin, ywidth
+ *ymin*, *ywidth*
%(Collection)s
"""
@@ -554,6 +565,7 @@
__init__.__doc__ = cbook.dedent(__init__.__doc__) % artist.kwdocd
class RegularPolyCollection(Collection):
+ """Draw a collection of regular polygons with *numsides*."""
_path_generator = mpath.Path.unit_regular_polygon
def __init__(self,
@@ -562,22 +574,16 @@
sizes = (1,),
**kwargs):
"""
- Draw a regular polygon with numsides.
-
- *dpi*
- the figure dpi instance, and is required to do the
- area scaling.
-
*numsides*
the number of sides of the polygon
+ *rotation*
+ the rotation of the polygon in radians
+
*sizes*
gives the area of the circle circumscribing the
regular polygon in points^2
- *rotation*
- the rotation of the polygon in radians
-
%(Collection)s
Example: see :file:`examples/dynamic_collection.py` for
@@ -619,10 +625,16 @@
class StarPolygonCollection(RegularPolyCollection):
+ """
+ Draw a collection of regular stars with *numsides* points."""
+
_path_generator = mpath.Path.unit_regular_star
class AsteriskPolygonCollection(RegularPolyCollection):
+ """
+ Draw a collection of regular asterisks with *numsides* points."""
+
_path_generator = mpath.Path.unit_regular_asterisk
@@ -630,8 +642,12 @@
"""
All parameters must be sequences or scalars; if scalars, they will
be converted to sequences. The property of the ith line
- segment is the prop[i % len(props)], ie the properties cycle if
- the len of props is less than the number of sements
+ segment is::
+
+ prop[i % len(props)]
+
+ i.e., the properties cycle if the ``len`` of props is less than the
+ number of segments.
"""
zorder = 2
def __init__(self, segments, # Can be None.
@@ -648,7 +664,7 @@
):
"""
*segments*
- a sequence of ( *line0*, *line1*, *line2*), where::
+ a sequence of (*line0*, *line1*, *line2*), where::
linen = (x0, y0), (x1, y1), ... (xm, ym)
@@ -656,7 +672,7 @@
can be a different length.
*colors*
- must be a tuple of RGBA tuples (eg arbitrary color
+ must be a sequence of RGBA tuples (eg arbitrary color
strings, etc, not allowed).
*antialiaseds*
@@ -792,8 +808,9 @@
a sequence of Patch objects. This list may include
a heterogeneous assortment of different patch types.
- *match_original* If True, use the colors and linewidths of the
- original patches. If False, new colors may be assigned by
+ *match_original*
+ If True, use the colors and linewidths of the original
+ patches. If False, new colors may be assigned by
providing the standard collection arguments, facecolor,
edgecolor, linewidths, norm or cmap.
Modified: trunk/matplotlib/lib/matplotlib/path.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/path.py 2008-06-17 19:01:38 UTC (rev 5584)
+++ trunk/matplotlib/lib/matplotlib/path.py 2008-06-17 19:07:51 UTC (rev 5585)
@@ -158,9 +158,9 @@
def iter_segments(self):
"""
Iterates over all of the curve segments in the path. Each
- iteration returns a 2-tuple ``(vertices, code)``, where
- vertices is a sequence of 1 - 3 coordinate pairs, and code is
- one of the ``Path`` codes.
+ iteration returns a 2-tuple (*vertices*, *code*), where
+ *vertices* is a sequence of 1 - 3 coordinate pairs, and *code* is
+ one of the :class:`Path` codes.
"""
vertices = self.vertices
if not len(vertices):
Modified: trunk/matplotlib/lib/matplotlib/transforms.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/transforms.py 2008-06-17 19:01:38 UTC (rev 5584)
+++ trunk/matplotlib/lib/matplotlib/transforms.py 2008-06-17 19:07:51 UTC (rev 5585)
@@ -3,13 +3,13 @@
transformations that is used determine the final position of all
elements drawn on the canvas.
-Transforms are composed into trees of ``TransformNode`` objects whose
-actual value depends on their children. When the contents of children
-change, their parents are automatically invalidated. The next time an
-invalidated transform is accessed, it is recomputed to reflect those
-changes. This invalidation/caching approach prevents unnecessary
-recomputations of transforms, and contributes to better interactive
-performance.
+Transforms are composed into trees of :class:`TransformNode` objects
+whose actual value depends on their children. When the contents of
+children change, their parents are automatically invalidated. The
+next time an invalidated transform is accessed, it is recomputed to
+reflect those changes. This invalidation/caching approach prevents
+unnecessary recomputations of transforms, and contributes to better
+interactive performance.
For example, here is a graph of the transform tree used to plot data
to the graph:
@@ -395,7 +395,7 @@
def overlaps(self, other):
"""
Returns True if this bounding box overlaps with the given
- bounding box ``other``.
+ bounding box *other*.
"""
ax1, ay1, ax2, ay2 = self._get_extents()
bx1, by1, bx2, by2 = other._get_extents()
@@ -445,7 +445,7 @@
def fully_overlaps(self, other):
"""
Returns True if this bounding box overlaps with the given
- bounding box ``other``, but not on its edge alone."""
+ bounding box *other*, but not on its edge alone."""
ax1, ay1, ax2, ay2 = self._get_extents()
bx1, by1, bx2, by2 = other._get_extents()
@@ -503,7 +503,7 @@
- E for left
- etc.
- Optional argument ``container`` is the box within which the :class:`Bbox`
+ Optional argument *container* is the box within which the :class:`Bbox`
is positioned; it defaults to the initial :class:`Bbox`.
"""
if container is None:
@@ -533,10 +533,10 @@
"""
Return a copy of the :class:`Bbox`, shrunk so that it is as
large as it can be while having the desired aspect ratio,
- ``box_aspect``. If the box coordinates are relative---that
+ *box_aspect*. If the box coordinates are relative---that
is, fractions of a larger box such as a figure---then the
physical aspect ratio of that figure is specified with
- ``fig_aspect``, so that ``box_aspect`` can also be given as a
+ *fig_aspect*, so that *box_aspect* can also be given as a
ratio of the absolute dimensions, not the relative dimensions.
"""
assert box_aspect > 0 and fig_aspect > 0
@@ -558,7 +558,7 @@
Returns a list of new :class:`Bbox` objects formed by
splitting the original one with vertical lines at fractional
- positions f1, f2, ...
+ positions *f1*, *f2*, ...
"""
boxes = []
xf = [0] + list(args) + [1]
@@ -574,7 +574,7 @@
Returns a list of new :class:`Bbox` objects formed by
splitting the original one with horizontal lines at fractional
- positions f1, f2, ...
+ positions *f1*, *f2*, ...
"""
boxes = []
yf = [0] + list(args) + [1]
@@ -612,8 +612,8 @@
def expanded(self, sw, sh):
"""
Return a new :class:`Bbox` which is this :class:`Bbox`
- expanded around its center by the given factors ``sw`` and
- ``sh``.
+ expanded around its center by the given factors *sw* and
+ *sh*.
"""
width = self.width
height = self.height
@@ -641,8 +641,8 @@
"""
Return an array of points which are the four corners of this
rectangle. For example, if this :class:`Bbox` is defined by
- the points (a, b) and (c, d), ``corners`` returns (a, b), (a,
- d), (c, b) and (c, d).
+ the points (*a*, *b*) and (*c*, *d*), :meth:`corners` returns
+ (*a*, *b*), (*a*, *d*), (*c*, *b*) and (*c*, *d*).
"""
l, b, r, t = self.get_points().flatten()
return np.array([[l, b], [l, t], [r, b], [r, t]])
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-06-17 19:01:43
|
Revision: 5584
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5584&view=rev
Author: mdboom
Date: 2008-06-17 12:01:38 -0700 (Tue, 17 Jun 2008)
Log Message:
-----------
Make mathtext slightly smaller.
Modified Paths:
--------------
trunk/matplotlib/doc/sphinxext/mathpng.py
Modified: trunk/matplotlib/doc/sphinxext/mathpng.py
===================================================================
--- trunk/matplotlib/doc/sphinxext/mathpng.py 2008-06-17 18:02:08 UTC (rev 5583)
+++ trunk/matplotlib/doc/sphinxext/mathpng.py 2008-06-17 19:01:38 UTC (rev 5584)
@@ -117,11 +117,11 @@
orig_fontset = rcParams['mathtext.fontset']
rcParams['mathtext.fontset'] = fontset
if os.path.exists(filename):
- depth = mathtext_parser.get_depth(latex, dpi=120)
+ depth = mathtext_parser.get_depth(latex, dpi=100)
else:
print latex.encode("ascii", "backslashreplace")
try:
- depth = mathtext_parser.to_png(filename, latex, dpi=120)
+ depth = mathtext_parser.to_png(filename, latex, dpi=100)
except:
warnings.warn("Could not render math expression %s" % latex,
Warning)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-06-17 18:03:02
|
Revision: 5583
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5583&view=rev
Author: mdboom
Date: 2008-06-17 11:02:08 -0700 (Tue, 17 Jun 2008)
Log Message:
-----------
Add a generic PatchCollection class.
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/collections.py
Added Paths:
-----------
trunk/matplotlib/examples/api/patch_collection.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-06-17 17:23:30 UTC (rev 5582)
+++ trunk/matplotlib/CHANGELOG 2008-06-17 18:02:08 UTC (rev 5583)
@@ -1,3 +1,6 @@
+2008-06-17 Add a generic PatchCollection class that can contain any
+ kind of patch. - MGD
+
2008-06-13 Change pie chart label alignment to avoid having labels
overwrite the pie - MGD
Added: trunk/matplotlib/examples/api/patch_collection.py
===================================================================
--- trunk/matplotlib/examples/api/patch_collection.py (rev 0)
+++ trunk/matplotlib/examples/api/patch_collection.py 2008-06-17 18:02:08 UTC (rev 5583)
@@ -0,0 +1,38 @@
+import matplotlib
+from matplotlib.patches import Circle, Wedge, Polygon
+from matplotlib.collections import PatchCollection
+import pylab
+
+fig=pylab.figure()
+ax=fig.add_subplot(111)
+
+resolution = 50 # the number of vertices
+N = 3
+x = pylab.rand(N)
+y = pylab.rand(N)
+radii = 0.1*pylab.rand(N)
+patches = []
+for x1,y1,r in zip(x, y, radii):
+ circle = Circle((x1,y1), r)
+ patches.append(circle)
+
+x = pylab.rand(N)
+y = pylab.rand(N)
+radii = 0.1*pylab.rand(N)
+theta1 = 360.0*pylab.rand(N)
+theta2 = 360.0*pylab.rand(N)
+for x1,y1,r,t1,t2 in zip(x, y, radii, theta1, theta2):
+ wedge = Wedge((x1,y1), r, t1, t2)
+ patches.append(wedge)
+
+for i in range(N):
+ polygon = Polygon(pylab.rand(N,2), True)
+ patches.append(polygon)
+
+colors = 100*pylab.rand(len(patches))
+p = PatchCollection(patches, cmap=matplotlib.cm.jet)
+p.set_array(pylab.array(colors))
+ax.add_collection(p)
+pylab.colorbar(p)
+
+pylab.show()
Modified: trunk/matplotlib/lib/matplotlib/collections.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/collections.py 2008-06-17 17:23:30 UTC (rev 5582)
+++ trunk/matplotlib/lib/matplotlib/collections.py 2008-06-17 18:02:08 UTC (rev 5583)
@@ -775,7 +775,68 @@
return self._edgecolors
get_colors = get_color # for compatibility with old versions
+class PatchCollection(Collection):
+ """
+ A generic collection of patches.
+ This makes it easier to assign a color map to a heterogeneous
+ collection of patches.
+
+ This also may improve plotting speed, since PatchCollection will
+ draw faster than a large number of patches.
+ """
+
+ def __init__(self, patches, match_original=False, **kwargs):
+ """
+ *patches*
+ a sequence of Patch objects. This list may include
+ a heterogeneous assortment of different patch types.
+
+ *match_original* If True, use the colors and linewidths of the
+ original patches. If False, new colors may be assigned by
+ providing the standard collection arguments, facecolor,
+ edgecolor, linewidths, norm or cmap.
+
+ If any of *edgecolors*, *facecolors*, *linewidths*,
+ *antialiaseds* are None, they default to their
+ :data:`matplotlib.rcParams` patch setting, in sequence form.
+
+ The use of :class:`~matplotlib.cm.ScalarMappable` is optional.
+ If the :class:`~matplotlib.cm.ScalarMappable` matrix _A is not
+ None (ie a call to set_array has been made), at draw time a
+ call to scalar mappable will be made to set the face colors.
+ """
+
+ if match_original:
+ def determine_facecolor(patch):
+ if patch.fill():
+ return patch.get_facecolor()
+ return [0, 0, 0, 0]
+
+ facecolors = [determine_facecolor(p) for p in patches]
+ edgecolors = [p.get_edgecolor() for p in patches]
+ linewidths = [p.get_linewidths() for p in patches]
+ antialiaseds = [p.get_antialiased() for p in patches]
+
+ Collection.__init__(
+ self,
+ edgecolors=edgecolors,
+ facecolors=facecolors,
+ linewidths=linewidths,
+ linestyles='solid',
+ antialiaseds = antialiaseds)
+ else:
+ Collection.__init__(self, **kwargs)
+
+ paths = [p.get_transform().transform_path(p.get_path())
+ for p in patches]
+
+ self._paths = paths
+
+ def get_paths(self):
+ return self._paths
+
+
artist.kwdocd['Collection'] = patchstr = artist.kwdoc(Collection)
for k in ('QuadMesh', 'PolyCollection', 'BrokenBarHCollection', 'RegularPolyCollection',
'StarPolygonCollection'):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-06-17 17:25:29
|
Revision: 5582
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5582&view=rev
Author: mdboom
Date: 2008-06-17 10:23:30 -0700 (Tue, 17 Jun 2008)
Log Message:
-----------
Use new "show-inheritance" feature to show base classes in Sphinx autodoc.
Modified Paths:
--------------
trunk/matplotlib/doc/api/artist_api.rst
trunk/matplotlib/doc/api/axes_api.rst
trunk/matplotlib/doc/api/axis_api.rst
trunk/matplotlib/doc/api/backend_bases_api.rst
trunk/matplotlib/doc/api/backend_gtkagg_api.rst
trunk/matplotlib/doc/api/backend_qt4agg_api.rst
trunk/matplotlib/doc/api/backend_wxagg_api.rst
trunk/matplotlib/doc/api/cbook_api.rst
trunk/matplotlib/doc/api/cm_api.rst
trunk/matplotlib/doc/api/collections_api.rst
trunk/matplotlib/doc/api/colorbar_api.rst
trunk/matplotlib/doc/api/matplotlib_configuration_api.rst
trunk/matplotlib/doc/api/pyplot_api.rst
trunk/matplotlib/doc/devel/transformations.rst
Modified: trunk/matplotlib/doc/api/artist_api.rst
===================================================================
--- trunk/matplotlib/doc/api/artist_api.rst 2008-06-17 17:21:08 UTC (rev 5581)
+++ trunk/matplotlib/doc/api/artist_api.rst 2008-06-17 17:23:30 UTC (rev 5582)
@@ -8,6 +8,7 @@
.. automodule:: matplotlib.artist
:members:
:undoc-members:
+ :show-inheritance:
:mod:`matplotlib.lines`
=============================
@@ -15,6 +16,7 @@
.. automodule:: matplotlib.lines
:members:
:undoc-members:
+ :show-inheritance:
:mod:`matplotlib.patches`
=============================
@@ -22,6 +24,7 @@
.. automodule:: matplotlib.patches
:members:
:undoc-members:
+ :show-inheritance:
:mod:`matplotlib.text`
=============================
@@ -29,3 +32,4 @@
.. automodule:: matplotlib.text
:members:
:undoc-members:
+ :show-inheritance:
Modified: trunk/matplotlib/doc/api/axes_api.rst
===================================================================
--- trunk/matplotlib/doc/api/axes_api.rst 2008-06-17 17:21:08 UTC (rev 5581)
+++ trunk/matplotlib/doc/api/axes_api.rst 2008-06-17 17:23:30 UTC (rev 5582)
@@ -9,3 +9,4 @@
.. automodule:: matplotlib.axes
:members:
:undoc-members:
+ :show-inheritance:
Modified: trunk/matplotlib/doc/api/axis_api.rst
===================================================================
--- trunk/matplotlib/doc/api/axis_api.rst 2008-06-17 17:21:08 UTC (rev 5581)
+++ trunk/matplotlib/doc/api/axis_api.rst 2008-06-17 17:23:30 UTC (rev 5582)
@@ -9,3 +9,4 @@
.. automodule:: matplotlib.axis
:members:
:undoc-members:
+ :show-inheritance:
Modified: trunk/matplotlib/doc/api/backend_bases_api.rst
===================================================================
--- trunk/matplotlib/doc/api/backend_bases_api.rst 2008-06-17 17:21:08 UTC (rev 5581)
+++ trunk/matplotlib/doc/api/backend_bases_api.rst 2008-06-17 17:23:30 UTC (rev 5582)
@@ -5,3 +5,4 @@
.. automodule:: matplotlib.backend_bases
:members:
:undoc-members:
+ :show-inheritance:
Modified: trunk/matplotlib/doc/api/backend_gtkagg_api.rst
===================================================================
--- trunk/matplotlib/doc/api/backend_gtkagg_api.rst 2008-06-17 17:21:08 UTC (rev 5581)
+++ trunk/matplotlib/doc/api/backend_gtkagg_api.rst 2008-06-17 17:23:30 UTC (rev 5582)
@@ -7,4 +7,5 @@
.. .. automodule:: matplotlib.backends.backend_gtkagg
.. :members:
-.. :undoc-members:
\ No newline at end of file
+.. :undoc-members:
+.. :show-inheritance:
Modified: trunk/matplotlib/doc/api/backend_qt4agg_api.rst
===================================================================
--- trunk/matplotlib/doc/api/backend_qt4agg_api.rst 2008-06-17 17:21:08 UTC (rev 5581)
+++ trunk/matplotlib/doc/api/backend_qt4agg_api.rst 2008-06-17 17:23:30 UTC (rev 5582)
@@ -4,4 +4,6 @@
.. automodule:: matplotlib.backends.backend_qt4agg
:members:
- :undoc-members:
\ No newline at end of file
+ :undoc-members:
+ :show-inheritance:
+
Modified: trunk/matplotlib/doc/api/backend_wxagg_api.rst
===================================================================
--- trunk/matplotlib/doc/api/backend_wxagg_api.rst 2008-06-17 17:21:08 UTC (rev 5581)
+++ trunk/matplotlib/doc/api/backend_wxagg_api.rst 2008-06-17 17:23:30 UTC (rev 5582)
@@ -4,4 +4,5 @@
.. automodule:: matplotlib.backends.backend_wxagg
:members:
- :undoc-members:
\ No newline at end of file
+ :undoc-members:
+ :show-inheritance:
Modified: trunk/matplotlib/doc/api/cbook_api.rst
===================================================================
--- trunk/matplotlib/doc/api/cbook_api.rst 2008-06-17 17:21:08 UTC (rev 5581)
+++ trunk/matplotlib/doc/api/cbook_api.rst 2008-06-17 17:23:30 UTC (rev 5582)
@@ -9,3 +9,4 @@
.. automodule:: matplotlib.cbook
:members:
:undoc-members:
+ :show-inheritance:
Modified: trunk/matplotlib/doc/api/cm_api.rst
===================================================================
--- trunk/matplotlib/doc/api/cm_api.rst 2008-06-17 17:21:08 UTC (rev 5581)
+++ trunk/matplotlib/doc/api/cm_api.rst 2008-06-17 17:23:30 UTC (rev 5582)
@@ -9,3 +9,4 @@
.. automodule:: matplotlib.cm
:members:
:undoc-members:
+ :show-inheritance:
Modified: trunk/matplotlib/doc/api/collections_api.rst
===================================================================
--- trunk/matplotlib/doc/api/collections_api.rst 2008-06-17 17:21:08 UTC (rev 5581)
+++ trunk/matplotlib/doc/api/collections_api.rst 2008-06-17 17:23:30 UTC (rev 5582)
@@ -9,3 +9,4 @@
.. automodule:: matplotlib.collections
:members:
:undoc-members:
+ :show-inheritance:
Modified: trunk/matplotlib/doc/api/colorbar_api.rst
===================================================================
--- trunk/matplotlib/doc/api/colorbar_api.rst 2008-06-17 17:21:08 UTC (rev 5581)
+++ trunk/matplotlib/doc/api/colorbar_api.rst 2008-06-17 17:23:30 UTC (rev 5582)
@@ -9,3 +9,4 @@
.. automodule:: matplotlib.colorbar
:members:
:undoc-members:
+ :show-inheritance:
Modified: trunk/matplotlib/doc/api/matplotlib_configuration_api.rst
===================================================================
--- trunk/matplotlib/doc/api/matplotlib_configuration_api.rst 2008-06-17 17:21:08 UTC (rev 5581)
+++ trunk/matplotlib/doc/api/matplotlib_configuration_api.rst 2008-06-17 17:23:30 UTC (rev 5582)
@@ -9,4 +9,5 @@
.. automodule:: matplotlib
:members: rc, rcdefaults, use
:undoc-members:
+ :show-inheritance:
Modified: trunk/matplotlib/doc/api/pyplot_api.rst
===================================================================
--- trunk/matplotlib/doc/api/pyplot_api.rst 2008-06-17 17:21:08 UTC (rev 5581)
+++ trunk/matplotlib/doc/api/pyplot_api.rst 2008-06-17 17:23:30 UTC (rev 5582)
@@ -8,4 +8,5 @@
.. automodule:: matplotlib.pyplot
:members:
- :undoc-members:
\ No newline at end of file
+ :undoc-members:
+ :show-inheritance:
Modified: trunk/matplotlib/doc/devel/transformations.rst
===================================================================
--- trunk/matplotlib/doc/devel/transformations.rst 2008-06-17 17:21:08 UTC (rev 5581)
+++ trunk/matplotlib/doc/devel/transformations.rst 2008-06-17 17:23:30 UTC (rev 5582)
@@ -13,9 +13,11 @@
composite_transform_factory, BboxTransform, BboxTransformTo,
BboxTransformFrom, ScaledTranslation, TransformedPath, nonsingular,
interval_contains, interval_contains_open
+ :show-inheritance:
:mod:`matplotlib.path`
=============================
.. automodule:: matplotlib.path
:members: Path, get_path_collection_extents
+ :show-inheritance:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-06-17 17:23:14
|
Revision: 5581
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5581&view=rev
Author: mdboom
Date: 2008-06-17 10:21:08 -0700 (Tue, 17 Jun 2008)
Log Message:
-----------
Bugfix for re-generating math images
Modified Paths:
--------------
trunk/matplotlib/doc/sphinxext/mathpng.py
Modified: trunk/matplotlib/doc/sphinxext/mathpng.py
===================================================================
--- trunk/matplotlib/doc/sphinxext/mathpng.py 2008-06-17 16:10:17 UTC (rev 5580)
+++ trunk/matplotlib/doc/sphinxext/mathpng.py 2008-06-17 17:21:08 UTC (rev 5581)
@@ -114,16 +114,18 @@
# This uses mathtext to render the expression
def latex2png(latex, filename, fontset='cm'):
latex = "$%s$" % latex
- if os.path.exists(filename):
- return mathtext_parser.get_depth(latex, dpi=120)
orig_fontset = rcParams['mathtext.fontset']
rcParams['mathtext.fontset'] = fontset
- try:
- depth = mathtext_parser.to_png(filename, latex, dpi=120)
- except:
- warnings.warn("Could not render math expression %s" % latex,
- Warning)
- depth = 0
+ if os.path.exists(filename):
+ depth = mathtext_parser.get_depth(latex, dpi=120)
+ else:
+ print latex.encode("ascii", "backslashreplace")
+ try:
+ depth = mathtext_parser.to_png(filename, latex, dpi=120)
+ except:
+ warnings.warn("Could not render math expression %s" % latex,
+ Warning)
+ depth = 0
rcParams['mathtext.fontset'] = orig_fontset
return depth
@@ -131,7 +133,6 @@
def latex2html(node, source):
inline = isinstance(node.parent, nodes.TextElement)
latex = node['latex']
- print latex.encode("ascii", "backslashreplace")
name = 'math-%s' % md5(latex).hexdigest()[-10:]
dest = '_static/%s.png' % name
depth = latex2png(latex, dest, node['fontset'])
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-06-17 16:11:48
|
Revision: 5580
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5580&view=rev
Author: mdboom
Date: 2008-06-17 09:10:17 -0700 (Tue, 17 Jun 2008)
Log Message:
-----------
Fixing baseline alignment -- the align="absmiddle" hack is removed.
Modified Paths:
--------------
trunk/matplotlib/doc/sphinxext/mathpng.py
Modified: trunk/matplotlib/doc/sphinxext/mathpng.py
===================================================================
--- trunk/matplotlib/doc/sphinxext/mathpng.py 2008-06-17 16:08:18 UTC (rev 5579)
+++ trunk/matplotlib/doc/sphinxext/mathpng.py 2008-06-17 16:10:17 UTC (rev 5580)
@@ -142,10 +142,6 @@
if os.path.exists(path): break
path = '../'+path
path = '../'+path #specifically added for matplotlib
- if inline and '_' in latex:
- align = 'align="absmiddle" '
- else:
- align = ''
if inline:
cls = ''
else:
@@ -155,5 +151,5 @@
else:
style = ''
- return '<img src="%s/%s.png" %s%s%s/>' % (path, name, align, cls, style)
+ return '<img src="%s/%s.png" %s%s/>' % (path, name, cls, style)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-06-17 16:09:44
|
Revision: 5579
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5579&view=rev
Author: mdboom
Date: 2008-06-17 09:08:18 -0700 (Tue, 17 Jun 2008)
Log Message:
-----------
Adding missing colon.
Modified Paths:
--------------
trunk/matplotlib/doc/devel/documenting_mpl.rst
Modified: trunk/matplotlib/doc/devel/documenting_mpl.rst
===================================================================
--- trunk/matplotlib/doc/devel/documenting_mpl.rst 2008-06-17 16:03:20 UTC (rev 5578)
+++ trunk/matplotlib/doc/devel/documenting_mpl.rst 2008-06-17 16:08:18 UTC (rev 5579)
@@ -83,7 +83,7 @@
* Mathematical expressions can be rendered as png images in html, and in the
usual way by latex. For example:
- ``math:`\sin(x_n^2)``` yields: :math:`\sin(x_n^2)`, and::
+ ``:math:`\sin(x_n^2)``` yields: :math:`\sin(x_n^2)`, and::
.. math::
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-06-17 16:04:36
|
Revision: 5578
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5578&view=rev
Author: mdboom
Date: 2008-06-17 09:03:20 -0700 (Tue, 17 Jun 2008)
Log Message:
-----------
Fix math expression to use \sin
Modified Paths:
--------------
trunk/matplotlib/doc/devel/documenting_mpl.rst
Modified: trunk/matplotlib/doc/devel/documenting_mpl.rst
===================================================================
--- trunk/matplotlib/doc/devel/documenting_mpl.rst 2008-06-17 15:42:12 UTC (rev 5577)
+++ trunk/matplotlib/doc/devel/documenting_mpl.rst 2008-06-17 16:03:20 UTC (rev 5578)
@@ -51,7 +51,7 @@
.. include:: ../../TODO
-
+
Formatting
==========
@@ -76,14 +76,14 @@
nor the ``literal`` role::
Please do not describe ``argument`` like this.
-
+
* Sphinx does not support tables with column- or row-spanning cells for
latex output. Such tables can not be used when documenting matplotlib.
* Mathematical expressions can be rendered as png images in html, and in the
usual way by latex. For example:
- ``math:`sin(x_n^2)``` yields: :math:`sin(x_n^2)`, and::
+ ``math:`\sin(x_n^2)``` yields: :math:`\sin(x_n^2)`, and::
.. math::
@@ -152,7 +152,7 @@
.. versionadded:: 0.98
The transforms have been completely revamped.
-
+
* Use the *seealso* directive, for example::
.. seealso::
@@ -164,7 +164,7 @@
One more
yields:
-
+
.. seealso::
Using ResT :ref:`emacs-helpers`:
@@ -178,7 +178,7 @@
* The autodoc extension will handle index entries for the API, but additional
entries in the index_ need to be explicitly added.
-
+
.. _documentation: http://sphinx.pocoo.org/contents.html
.. _`inline markup`: http://sphinx.pocoo.org/markup/inline.html
.. _index: http://sphinx.pocoo.org/markup/para.html#index-generating-markup
@@ -189,15 +189,15 @@
In addition to the aforementioned formatting suggestions:
* Please limit the text width of docstrings to 70 characters.
-
+
* Keyword arguments should be described using a definition list.
.. note::
matplotlib makes extensive use of keyword arguments as pass-through
arguments, there are a many cases where a table is used in place of a
definition list for autogenerated sections of docstrings.
-
+
Figures
=======
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-06-17 15:44:21
|
Revision: 5577
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5577&view=rev
Author: mdboom
Date: 2008-06-17 08:42:12 -0700 (Tue, 17 Jun 2008)
Log Message:
-----------
Align inline mathtext correctly in HTML docs (by adjusting for the baseline)
Modified Paths:
--------------
trunk/matplotlib/doc/sphinxext/mathpng.py
trunk/matplotlib/examples/user_interfaces/mathtext_wx.py
trunk/matplotlib/lib/matplotlib/mathtext.py
Modified: trunk/matplotlib/doc/sphinxext/mathpng.py
===================================================================
--- trunk/matplotlib/doc/sphinxext/mathpng.py 2008-06-17 15:09:09 UTC (rev 5576)
+++ trunk/matplotlib/doc/sphinxext/mathpng.py 2008-06-17 15:42:12 UTC (rev 5577)
@@ -113,16 +113,19 @@
# This uses mathtext to render the expression
def latex2png(latex, filename, fontset='cm'):
+ latex = "$%s$" % latex
if os.path.exists(filename):
- return
+ return mathtext_parser.get_depth(latex, dpi=120)
orig_fontset = rcParams['mathtext.fontset']
rcParams['mathtext.fontset'] = fontset
try:
- mathtext_parser.to_png(filename, "$%s$" % latex, dpi=120)
+ depth = mathtext_parser.to_png(filename, latex, dpi=120)
except:
- warnings.warn("Could not render math expression $%s$" % latex,
- warnings.Warning)
+ warnings.warn("Could not render math expression %s" % latex,
+ Warning)
+ depth = 0
rcParams['mathtext.fontset'] = orig_fontset
+ return depth
# LaTeX to HTML translation stuff:
def latex2html(node, source):
@@ -131,8 +134,7 @@
print latex.encode("ascii", "backslashreplace")
name = 'math-%s' % md5(latex).hexdigest()[-10:]
dest = '_static/%s.png' % name
- if not isfile(dest):
- latex2png(latex, dest, node['fontset'])
+ depth = latex2png(latex, dest, node['fontset'])
path = '_static'
count = source.split('/doc/')[-1].count('/')
@@ -148,5 +150,10 @@
cls = ''
else:
cls = 'class="center" '
- return '<img src="%s/%s.png" %s%s/>' % (path, name, align, cls)
+ if inline and depth != 0:
+ style = 'style="position: relative; bottom: -%dpx"' % (depth + 1)
+ else:
+ style = ''
+ return '<img src="%s/%s.png" %s%s%s/>' % (path, name, align, cls, style)
+
Modified: trunk/matplotlib/examples/user_interfaces/mathtext_wx.py
===================================================================
--- trunk/matplotlib/examples/user_interfaces/mathtext_wx.py 2008-06-17 15:09:09 UTC (rev 5576)
+++ trunk/matplotlib/examples/user_interfaces/mathtext_wx.py 2008-06-17 15:42:12 UTC (rev 5577)
@@ -21,7 +21,7 @@
from matplotlib.mathtext import MathTextParser
mathtext_parser = MathTextParser("Bitmap")
def mathtext_to_wxbitmap(s):
- ftimage = mathtext_parser.parse(s, 150)
+ ftimage, depth = mathtext_parser.parse(s, 150)
return wx.BitmapFromBufferRGBA(
ftimage.get_width(), ftimage.get_height(),
ftimage.as_rgba_str())
Modified: trunk/matplotlib/lib/matplotlib/mathtext.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mathtext.py 2008-06-17 15:09:09 UTC (rev 5576)
+++ trunk/matplotlib/lib/matplotlib/mathtext.py 2008-06-17 15:42:12 UTC (rev 5577)
@@ -341,7 +341,7 @@
class MathtextBackendBitmapRender(MathtextBackendAggRender):
def get_results(self, box):
- return self.image
+ return self.image, self.depth
def MathtextBackendBitmap():
return MathtextBackendBbox(MathtextBackendBitmapRender())
@@ -2726,8 +2726,14 @@
def to_mask(self, texstr, dpi=120, fontsize=14):
"""
- return an NxM uint8 alpha ubyte mask array of rasterized tex
+ Returns a tuple (*array*, *depth*)
+ - *array* is an NxM uint8 alpha ubyte mask array of
+ rasterized tex.
+
+ - depth is the offset of the baseline from the bottom of the
+ image in pixels.
+
''texstr''
A valid mathtext string, eg r'IQ: $\sigma_i=15$'
@@ -2739,15 +2745,23 @@
"""
assert(self._output=="bitmap")
prop = FontProperties(size=fontsize)
- ftimage = self.parse(texstr, dpi=dpi, prop=prop)
+ ftimage, depth = self.parse(texstr, dpi=dpi, prop=prop)
x = ftimage.as_array()
- return x
+ return x, depth
def to_rgba(self, texstr, color='black', dpi=120, fontsize=14):
"""
- return an NxMx4 RGBA array of ubyte rasterized tex
+ Returns a tuple (*array*, *depth*)
+ - *array* is an NxMx4 RGBA array of ubyte rasterized tex.
+
+ - depth is the offset of the baseline from the bottom of the
+ image in pixels.
+
+ Returns a tuple (array, depth), where depth is the offset of
+ the baseline from the bottom of the image.
+
''texstr''
A valid mathtext string, eg r'IQ: $\sigma_i=15$'
@@ -2760,7 +2774,7 @@
''fontsize''
The font size in points
"""
- x = self.to_mask(texstr, dpi=dpi, fontsize=fontsize)
+ x, depth = self.to_mask(texstr, dpi=dpi, fontsize=fontsize)
r, g, b = mcolors.colorConverter.to_rgb(color)
RGBA = np.zeros((x.shape[0], x.shape[1], 4), dtype=np.uint8)
@@ -2768,11 +2782,15 @@
RGBA[:,:,1] = int(255*g)
RGBA[:,:,2] = int(255*b)
RGBA[:,:,3] = x
- return RGBA
+ return RGBA, depth
def to_png(self, filename, texstr, color='black', dpi=120, fontsize=14):
"""
+ Writes a tex expression to a PNG file.
+ Returns the offset of the baseline from the bottom of the
+ image in pixels.
+
''filename''
A writable filename or fileobject
@@ -2790,7 +2808,27 @@
"""
- rgba = self.to_rgba(texstr, color=color, dpi=dpi, fontsize=fontsize)
+ rgba, depth = self.to_rgba(texstr, color=color, dpi=dpi, fontsize=fontsize)
numrows, numcols, tmp = rgba.shape
- return _png.write_png(rgba.tostring(), numcols, numrows, filename)
+ _png.write_png(rgba.tostring(), numcols, numrows, filename)
+ return depth
+ def get_depth(self, texstr, dpi=120, fontsize=14):
+ """
+ Returns the offset of the baseline from the bottom of the
+ image in pixels.
+
+ ''texstr''
+ A valid mathtext string, eg r'IQ: $\sigma_i=15$'
+
+ ''dpi''
+ The dots-per-inch to render the text
+
+ ''fontsize''
+ The font size in points
+
+ """
+ assert(self._output=="bitmap")
+ prop = FontProperties(size=fontsize)
+ ftimage, depth = self.parse(texstr, dpi=dpi, prop=prop)
+ return depth
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-06-17 15:09:54
|
Revision: 5576
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5576&view=rev
Author: mdboom
Date: 2008-06-17 08:09:09 -0700 (Tue, 17 Jun 2008)
Log Message:
-----------
Hopefully got to_polygons correct now.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/path.py
Modified: trunk/matplotlib/lib/matplotlib/path.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/path.py 2008-06-17 15:06:29 UTC (rev 5575)
+++ trunk/matplotlib/lib/matplotlib/path.py 2008-06-17 15:09:09 UTC (rev 5576)
@@ -301,7 +301,7 @@
if transform is not None:
transform = transform.frozen()
- if self.codes is None and width == 0 or height == 0:
+ if self.codes is None and (width == 0 or height == 0):
if transform is None:
return [self.vertices]
else:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-06-17 15:07:46
|
Revision: 5575
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5575&view=rev
Author: mdboom
Date: 2008-06-17 08:06:29 -0700 (Tue, 17 Jun 2008)
Log Message:
-----------
Hopefully got to_polygons correct now.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/path.py
Modified: trunk/matplotlib/lib/matplotlib/path.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/path.py 2008-06-17 14:59:13 UTC (rev 5574)
+++ trunk/matplotlib/lib/matplotlib/path.py 2008-06-17 15:06:29 UTC (rev 5575)
@@ -300,11 +300,13 @@
if transform is not None:
transform = transform.frozen()
- if self.codes is None:
+
+ if self.codes is None and width == 0 or height == 0:
+ if transform is None:
+ return [self.vertices]
+ else:
return [transform.transform(self.vertices)]
- else:
- if self.codes is None:
- return [self.vertices]
+
# Deal with the case where there are curves and/or multiple
# subpaths (using extension code)
return convert_path_to_polygons(self, transform, width, height)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-06-17 15:01:47
|
Revision: 5574
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5574&view=rev
Author: mdboom
Date: 2008-06-17 07:59:13 -0700 (Tue, 17 Jun 2008)
Log Message:
-----------
Merged revisions 5444-5487,5489-5573 via svnmerge from
https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_91_maint
........
r5573 | mdboom | 2008-06-17 10:55:52 -0400 (Tue, 17 Jun 2008) | 2 lines
Fix STIX fonts on narrow Unicode platforms.
........
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-5443,5488
+ /branches/v0_91_maint:1-5573
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-06-17 14:56:28
|
Revision: 5573
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5573&view=rev
Author: mdboom
Date: 2008-06-17 07:55:52 -0700 (Tue, 17 Jun 2008)
Log Message:
-----------
Fix STIX fonts on narrow Unicode platforms.
Modified Paths:
--------------
branches/v0_91_maint/lib/matplotlib/_mathtext_data.py
branches/v0_91_maint/lib/matplotlib/backends/backend_pdf.py
branches/v0_91_maint/lib/matplotlib/backends/backend_ps.py
branches/v0_91_maint/lib/matplotlib/mathtext.py
Modified: branches/v0_91_maint/lib/matplotlib/_mathtext_data.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/_mathtext_data.py 2008-06-17 14:46:00 UTC (rev 5572)
+++ branches/v0_91_maint/lib/matplotlib/_mathtext_data.py 2008-06-17 14:55:52 UTC (rev 5573)
@@ -39,6 +39,8 @@
r'\}' : ('cmex10', 130),
r'\leftangle' : ('cmex10', 97),
r'\rightangle' : ('cmex10', 64),
+ r'\langle' : ('cmex10', 97),
+ r'\rangle' : ('cmex10', 64),
r'\widehat' : ('cmex10', 15),
r'\widetilde' : ('cmex10', 52),
@@ -1761,6 +1763,54 @@
tex2uni = {
'widehat': 0x0302,
'widetilde': 0x0303,
+'langle': 0x27e8,
+'rangle': 0x27e9,
+'perp': 0x27c2,
+'neq': 0x2260,
+'Join': 0x2a1d,
+'leqslant': 0x2a7d,
+'geqslant': 0x2a7e,
+'lessapprox': 0x2a85,
+'gtrapprox': 0x2a86,
+'lesseqqgtr': 0x2a8b,
+'gtreqqless': 0x2a8c,
+'triangleeq': 0x225c,
+'eqslantless': 0x2a95,
+'eqslantgtr': 0x2a96,
+'backepsilon': 0x03f6,
+'precapprox': 0x2ab7,
+'succapprox': 0x2ab8,
+'fallingdotseq': 0x2252,
+'subseteqq': 0x2ac5,
+'supseteqq': 0x2ac6,
+'varpropto': 0x221d,
+'precnapprox': 0x2ab9,
+'succnapprox': 0x2aba,
+'subsetneqq': 0x2acb,
+'supsetneqq': 0x2acc,
+'lnapprox': 0x2ab9,
+'gnapprox': 0x2aba,
+'longleftarrow': 0x27f5,
+'longrightarrow': 0x27f6,
+'longleftrightarrow': 0x27f7,
+'Longleftarrow': 0x27f8,
+'Longrightarrow': 0x27f9,
+'Longleftrightarrow': 0x27fa,
+'longmapsto': 0x27fc,
+'leadsto': 0x21dd,
+'dashleftarrow': 0x290e,
+'dashrightarrow': 0x290f,
+'circlearrowleft': 0x21ba,
+'circlearrowright': 0x21bb,
+'leftrightsquigarrow': 0x21ad,
+'leftsquigarrow': 0x219c,
+'rightsquigarrow': 0x219d,
+'Game': 0x2141,
+'hbar': 0x0127,
+'hslash': 0x210f,
+'ldots': 0x22ef,
+'vdots': 0x22ee,
+'doteqdot': 0x2251,
'doteq': 8784,
'partial': 8706,
'gg': 8811,
Modified: branches/v0_91_maint/lib/matplotlib/backends/backend_pdf.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/backends/backend_pdf.py 2008-06-17 14:46:00 UTC (rev 5572)
+++ branches/v0_91_maint/lib/matplotlib/backends/backend_pdf.py 2008-06-17 14:55:52 UTC (rev 5573)
@@ -683,7 +683,7 @@
differences = []
two_byte_chars = Set()
for c in characters:
- ccode = ord(c)
+ ccode = c
gind = cmap.get(ccode) or 0
glyph_ids.append(gind)
glyph_name = font.get_glyph_name(gind)
@@ -799,7 +799,7 @@
widths = []
max_ccode = 0
for c in characters:
- ccode = ord(c)
+ ccode = c
gind = cmap.get(ccode) or 0
glyph = font.load_char(ccode, flags=LOAD_NO_HINTING)
widths.append((ccode, glyph.horiAdvance / 6))
@@ -1194,7 +1194,7 @@
realpath, stat_key = get_realpath_and_stat(fname)
used_characters = self.used_characters.setdefault(
stat_key, (realpath, Set()))
- used_characters[1].update(s)
+ used_characters[1].update([ord(x) for x in s])
def merge_used_characters(self, other):
for stat_key, (realpath, set) in other.items():
Modified: branches/v0_91_maint/lib/matplotlib/backends/backend_ps.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/backends/backend_ps.py 2008-06-17 14:46:00 UTC (rev 5572)
+++ branches/v0_91_maint/lib/matplotlib/backends/backend_ps.py 2008-06-17 14:55:52 UTC (rev 5573)
@@ -151,14 +151,14 @@
self.mathtext_parser = MathTextParser("PS")
self._clip_paths = dict()
-
+
def track_characters(self, font, s):
"""Keeps track of which characters are required from
each font."""
realpath, stat_key = get_realpath_and_stat(font.fname)
used_characters = self.used_characters.setdefault(
stat_key, (realpath, Set()))
- used_characters[1].update(s)
+ used_characters[1].update([ord(x) for x in s])
def merge_used_characters(self, other):
for stat_key, (realpath, set) in other.items():
@@ -1231,7 +1231,7 @@
cmap = font.get_charmap()
glyph_ids = []
for c in chars:
- gind = cmap.get(ord(c)) or 0
+ gind = cmap.get(c) or 0
glyph_ids.append(gind)
# The ttf to ps (subsetting) support doesn't work for
# OpenType fonts that are Postscript inside (like the
Modified: branches/v0_91_maint/lib/matplotlib/mathtext.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/mathtext.py 2008-06-17 14:46:00 UTC (rev 5572)
+++ branches/v0_91_maint/lib/matplotlib/mathtext.py 2008-06-17 14:55:52 UTC (rev 5573)
@@ -522,7 +522,7 @@
realpath, stat_key = get_realpath_and_stat(info.font.fname)
used_characters = self.used_characters.setdefault(
stat_key, (realpath, Set()))
- used_characters[1].update(unichr(info.num))
+ used_characters[1].add(info.num)
self.mathtext_backend.render_glyph(ox, oy, info)
def render_rect_filled(self, x1, y1, x2, y2):
@@ -655,8 +655,9 @@
return xHeight
def get_underline_thickness(self, font, fontsize, dpi):
- cached_font = self._get_font(font)
- return cached_font.font.underline_thickness / 64.0 / fontsize * (10.0 * dpi / 100.0)
+ # This function used to grab underline thickness from the font,
+ # but that information is just too un-reliable, so it is now hardcoded.
+ return ((0.75 / 12.0) * fontsize * dpi) / 72.0
def get_kern(self, font1, fontclass1, sym1, fontsize1,
font2, fontclass2, sym2, fontsize2, dpi):
@@ -840,10 +841,11 @@
new_fontname = fontname
if fontname == 'it':
- unistring = unichr(uniindex)
- if (not unicodedata.category(unistring)[0] == "L"
- or unicodedata.name(unistring).startswith("GREEK CAPITAL")):
- new_fontname = 'rm'
+ if uniindex < 0x10000:
+ unistring = unichr(uniindex)
+ if (not unicodedata.category(unistring)[0] == "L"
+ or unicodedata.name(unistring).startswith("GREEK CAPITAL")):
+ new_fontname = 'rm'
slanted = (new_fontname == 'it') or sym in self._slanted_symbols
found_symbol = False
@@ -868,6 +870,8 @@
return self.cm_fallback._get_glyph(
fontname, 'it', sym, fontsize)
else:
+ if fontname == 'it' and isinstance(self, StixFonts):
+ return self._get_glyph('rm', font_class, sym, fontsize)
warn("Substituting with a dummy symbol.", MathTextWarning)
fontname = 'rm'
new_fontname = fontname
@@ -2031,7 +2035,8 @@
bslash = Literal('\\')
- accent = oneOf(self._accent_map.keys() + list(self._wide_accents))
+ accent = oneOf(self._accent_map.keys() +
+ list(self._wide_accents))
function = oneOf(list(self._function_names))
@@ -2058,10 +2063,10 @@
unicode_range = u"\U00000080-\U0001ffff"
symbol =(Regex(UR"([a-zA-Z0-9 +\-*/<>=:,.;!'@()\[\]|%s])|(\\[%%${}\[\]_|])" % unicode_range)
- | Combine(
+ | (Combine(
bslash
+ oneOf(tex2uni.keys())
- )
+ ) + FollowedBy(Regex("[^A-Za-z]")))
).setParseAction(self.symbol).leaveWhitespace()
c_over_c =(Suppress(bslash)
@@ -2498,14 +2503,14 @@
if super is not None:
hlist = HCentered([super])
hlist.hpack(width, 'exactly')
- vlist.extend([hlist, Kern(rule_thickness * 2.0)])
+ vlist.extend([hlist, Kern(rule_thickness * 3.0)])
hlist = HCentered([nucleus])
hlist.hpack(width, 'exactly')
vlist.append(hlist)
if sub is not None:
hlist = HCentered([sub])
hlist.hpack(width, 'exactly')
- vlist.extend([Kern(rule_thickness * 2.0), hlist])
+ vlist.extend([Kern(rule_thickness * 3.0), hlist])
shift = hlist.height + hlist.depth + rule_thickness * 2.0
vlist = Vlist(vlist)
vlist.shift_amount = shift + nucleus.depth * 0.5
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-06-17 14:46:45
|
Revision: 5572
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5572&view=rev
Author: mdboom
Date: 2008-06-17 07:46:00 -0700 (Tue, 17 Jun 2008)
Log Message:
-----------
Warn when a math expression can not be rendered, rather than hard-failing.
Modified Paths:
--------------
trunk/matplotlib/doc/sphinxext/mathpng.py
Modified: trunk/matplotlib/doc/sphinxext/mathpng.py
===================================================================
--- trunk/matplotlib/doc/sphinxext/mathpng.py 2008-06-17 14:42:31 UTC (rev 5571)
+++ trunk/matplotlib/doc/sphinxext/mathpng.py 2008-06-17 14:46:00 UTC (rev 5572)
@@ -8,6 +8,7 @@
from docutils.parsers.rst import directives
from docutils.writers.html4css1 import HTMLTranslator
from sphinx.latexwriter import LaTeXTranslator
+import warnings
# Define LaTeX math node:
class latex_math(nodes.General, nodes.Element):
@@ -116,7 +117,11 @@
return
orig_fontset = rcParams['mathtext.fontset']
rcParams['mathtext.fontset'] = fontset
- mathtext_parser.to_png(filename, "$%s$" % latex, dpi=120)
+ try:
+ mathtext_parser.to_png(filename, "$%s$" % latex, dpi=120)
+ except:
+ warnings.warn("Could not render math expression $%s$" % latex,
+ warnings.Warning)
rcParams['mathtext.fontset'] = orig_fontset
# LaTeX to HTML translation stuff:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-06-17 14:43:38
|
Revision: 5571
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5571&view=rev
Author: mdboom
Date: 2008-06-17 07:42:31 -0700 (Tue, 17 Jun 2008)
Log Message:
-----------
Final fix to get STIX fonts working on Unicode-narrow platforms.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/mathtext.py
Modified: trunk/matplotlib/lib/matplotlib/mathtext.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mathtext.py 2008-06-17 14:40:10 UTC (rev 5570)
+++ trunk/matplotlib/lib/matplotlib/mathtext.py 2008-06-17 14:42:31 UTC (rev 5571)
@@ -842,10 +842,11 @@
new_fontname = fontname
if fontname == 'it':
- unistring = unichr(uniindex)
- if (not unicodedata.category(unistring)[0] == "L"
- or unicodedata.name(unistring).startswith("GREEK CAPITAL")):
- new_fontname = 'rm'
+ if uniindex < 0x10000:
+ unistring = unichr(uniindex)
+ if (not unicodedata.category(unistring)[0] == "L"
+ or unicodedata.name(unistring).startswith("GREEK CAPITAL")):
+ new_fontname = 'rm'
slanted = (new_fontname == 'it') or sym in self._slanted_symbols
found_symbol = False
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-06-17 14:41:11
|
Revision: 5570
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5570&view=rev
Author: mdboom
Date: 2008-06-17 07:40:10 -0700 (Tue, 17 Jun 2008)
Log Message:
-----------
Support getting the vertices of curved paths.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/patches.py
trunk/matplotlib/lib/matplotlib/path.py
trunk/matplotlib/src/_path.cpp
Modified: trunk/matplotlib/lib/matplotlib/patches.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/patches.py 2008-06-17 14:04:19 UTC (rev 5569)
+++ trunk/matplotlib/lib/matplotlib/patches.py 2008-06-17 14:40:10 UTC (rev 5570)
@@ -83,11 +83,17 @@
def get_verts(self):
"""
return a copy of the vertices used in this patch
+
+ If the patch contains Bezier curves, the curves will be
+ interpolated by line segments. To access the curves as
+ curves, use :meth:`get_path`.
"""
trans = self.get_transform()
path = self.get_path()
- tverts = trans.transform(path.vertices)
- return tverts
+ polygons = path.to_polygons(trans)
+ if len(polygons):
+ return polygons[0]
+ return []
def contains(self, mouseevent):
"""Test whether the mouse event occurred in the patch.
Modified: trunk/matplotlib/lib/matplotlib/path.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/path.py 2008-06-17 14:04:19 UTC (rev 5569)
+++ trunk/matplotlib/lib/matplotlib/path.py 2008-06-17 14:40:10 UTC (rev 5570)
@@ -290,14 +290,21 @@
``MOVETO`` instructions or curves. This is useful for
displaying in backends that do not support compound paths or
Bezier curves, such as GDK.
+
+ If width and height are both non-zero then the lines will be
+ simplified so that vertices outside of (0, 0), (width, height)
+ will be clipped.
"""
+ if len(self.vertices) == 0:
+ return []
+
if transform is not None:
transform = transform.frozen()
- # Deal with the common and simple case
- if self.codes is None and len(self.vertices) < 100:
- if len(self.vertices):
+ if self.codes is None:
return [transform.transform(self.vertices)]
- return []
+ else:
+ if self.codes is None:
+ return [self.vertices]
# Deal with the case where there are curves and/or multiple
# subpaths (using extension code)
return convert_path_to_polygons(self, transform, width, height)
Modified: trunk/matplotlib/src/_path.cpp
===================================================================
--- trunk/matplotlib/src/_path.cpp 2008-06-17 14:04:19 UTC (rev 5569)
+++ trunk/matplotlib/src/_path.cpp 2008-06-17 14:40:10 UTC (rev 5570)
@@ -52,7 +52,7 @@
add_varargs_method("path_intersects_path", &_path_module::path_intersects_path,
"path_intersects_path(p1, p2)");
add_varargs_method("convert_path_to_polygons", &_path_module::convert_path_to_polygons,
- "convert_path_to_polygons(path, trans)");
+ "convert_path_to_polygons(path, trans, width, height)");
initialize("Helper functions for paths");
}
@@ -1115,7 +1115,7 @@
double width = Py::Float(args[2]);
double height = Py::Float(args[3]);
- bool simplify = !path.has_curves();
+ bool simplify = !path.has_curves() && width != 0.0 && height != 0.0;
transformed_path_t tpath(path, trans);
simplify_t simplified(tpath, false, simplify, width, height);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-06-17 14:05:51
|
Revision: 5569
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5569&view=rev
Author: jdh2358
Date: 2008-06-17 07:04:19 -0700 (Tue, 17 Jun 2008)
Log Message:
-----------
added get_verts method to patches
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/patches.py
Modified: trunk/matplotlib/lib/matplotlib/patches.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/patches.py 2008-06-17 13:02:56 UTC (rev 5568)
+++ trunk/matplotlib/lib/matplotlib/patches.py 2008-06-17 14:04:19 UTC (rev 5569)
@@ -80,6 +80,14 @@
__init__.__doc__ = cbook.dedent(__init__.__doc__) % artist.kwdocd
+ def get_verts(self):
+ """
+ return a copy of the vertices used in this patch
+ """
+ trans = self.get_transform()
+ path = self.get_path()
+ tverts = trans.transform(path.vertices)
+ return tverts
def contains(self, mouseevent):
"""Test whether the mouse event occurred in the patch.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-06-17 13:03:06
|
Revision: 5568
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5568&view=rev
Author: mdboom
Date: 2008-06-17 06:02:56 -0700 (Tue, 17 Jun 2008)
Log Message:
-----------
Store integers rather than unicode strings in used_characters mapping
to get around narrow Unicode problems on some platforms.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
trunk/matplotlib/lib/matplotlib/mathtext.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2008-06-17 12:10:43 UTC (rev 5567)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2008-06-17 13:02:56 UTC (rev 5568)
@@ -689,7 +689,7 @@
differences = []
multi_byte_chars = Set()
for c in characters:
- ccode = ord(c)
+ ccode = c
gind = cmap.get(ccode) or 0
glyph_ids.append(gind)
glyph_name = font.get_glyph_name(gind)
@@ -805,7 +805,7 @@
widths = []
max_ccode = 0
for c in characters:
- ccode = ord(c)
+ ccode = c
gind = cmap.get(ccode) or 0
glyph = font.load_char(ccode, flags=LOAD_NO_HINTING)
widths.append((ccode, glyph.horiAdvance / 6))
@@ -1209,7 +1209,7 @@
realpath, stat_key = get_realpath_and_stat(fname)
used_characters = self.used_characters.setdefault(
stat_key, (realpath, Set()))
- used_characters[1].update(s)
+ used_characters[1].update([ord(x) for x in s])
def merge_used_characters(self, other):
for stat_key, (realpath, set) in other.items():
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_ps.py 2008-06-17 12:10:43 UTC (rev 5567)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_ps.py 2008-06-17 13:02:56 UTC (rev 5568)
@@ -158,7 +158,7 @@
realpath, stat_key = get_realpath_and_stat(font.fname)
used_characters = self.used_characters.setdefault(
stat_key, (realpath, Set()))
- used_characters[1].update(s)
+ used_characters[1].update([ord(x) for x in s])
def merge_used_characters(self, other):
for stat_key, (realpath, set) in other.items():
@@ -975,7 +975,7 @@
cmap = font.get_charmap()
glyph_ids = []
for c in chars:
- gind = cmap.get(ord(c)) or 0
+ gind = cmap.get(c) or 0
glyph_ids.append(gind)
# The ttf to ps (subsetting) support doesn't work for
# OpenType fonts that are Postscript inside (like the
Modified: trunk/matplotlib/lib/matplotlib/mathtext.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mathtext.py 2008-06-17 12:10:43 UTC (rev 5567)
+++ trunk/matplotlib/lib/matplotlib/mathtext.py 2008-06-17 13:02:56 UTC (rev 5568)
@@ -526,7 +526,7 @@
realpath, stat_key = get_realpath_and_stat(info.font.fname)
used_characters = self.used_characters.setdefault(
stat_key, (realpath, Set()))
- used_characters[1].update(unichr(info.num))
+ used_characters[1].add(info.num)
self.mathtext_backend.render_glyph(ox, oy, info)
def render_rect_filled(self, x1, y1, x2, y2):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-06-17 12:11:45
|
Revision: 5567
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5567&view=rev
Author: jswhit
Date: 2008-06-17 05:10:43 -0700 (Tue, 17 Jun 2008)
Log Message:
-----------
fixing up docstrings
Modified Paths:
--------------
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-06-16 21:11:57 UTC (rev 5566)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-06-17 12:10:43 UTC (rev 5567)
@@ -2164,16 +2164,14 @@
def drawgreatcircle(self,lon1,lat1,lon2,lat2,del_s=100.,**kwargs):
"""
- Draw a great circle on the map.
+ Draw a great circle on the map from the longitude-latitude
+ pair ``lon1,lat1`` to ``lon2,lat2``
.. tabularcolumns:: |l|L|
============== =======================================================
Keyword Description
============== =======================================================
- lon1,lat1 longitude,latitude of one endpoint of the great circle.
- lon2,lat2 longitude,latitude of the other endpoint of the great
- circle.
del_s points on great circle computed every del_s kilometers
(default 100).
\**kwargs other keyword arguments are passed on to :meth:`plot`
@@ -2210,7 +2208,7 @@
.. tabularcolumns:: |l|L|
============== ====================================================
- Keyword Description
+ Argument Description
============== ====================================================
datin input data on a lat/lon grid.
lons, lats rank-1 arrays containing longitudes and latitudes
@@ -2218,6 +2216,15 @@
For non-cylindrical projections (those other than
``cyl``, ``merc`` and ``mill``) lons must fit
within range -180 to 180.
+ nx, ny The size of the output regular grid in map
+ projection coordinates
+ ============== ====================================================
+
+ .. tabularcolumns:: |l|L|
+
+ ============== ====================================================
+ Keyword Description
+ ============== ====================================================
returnxy If True, the x and y values of the map
projection grid are also returned (Default False).
checkbounds If True, values of lons and lats are checked to see
@@ -2272,7 +2279,7 @@
.. tabularcolumns:: |l|L|
============== ====================================================
- Keyword Description
+ Arguments Description
============== ====================================================
uin, vin input vector field on a lat/lon grid.
lons, lats rank-1 arrays containing longitudes and latitudes
@@ -2280,6 +2287,15 @@
For non-cylindrical projections (those other than
``cyl``, ``merc`` and ``mill``) lons must fit
within range -180 to 180.
+ nx, ny The size of the output regular grid in map
+ projection coordinates
+ ============== ====================================================
+
+ .. tabularcolumns:: |l|L|
+
+ ============== ====================================================
+ Keyword Description
+ ============== ====================================================
returnxy If True, the x and y values of the map
projection grid are also returned (Default False).
checkbounds If True, values of lons and lats are checked to see
@@ -2335,7 +2351,7 @@
.. tabularcolumns:: |l|L|
============== ====================================================
- Keyword Description
+ Arguments Description
============== ====================================================
uin, vin input vector field on a lat/lon grid.
lons, lats Arrays containing longitudes and latitudes
@@ -2343,12 +2359,13 @@
For non-cylindrical projections (those other than
``cyl``, ``merc`` and ``mill``) lons must fit
within range -180 to 180.
- returnxy If True, the x and y values of the map
- projection grid are also returned (Default False).
============== ====================================================
Returns ``uout, vout`` (rotated vector field).
- If returnxy=True, returns ``uout,vout,x,y``.
+ If the optional keyword argument
+ ``returnxy`` is True (default is False),
+ returns ``uout,vout,x,y`` (where ``x,y`` are the map projection
+ coordinates of the grid defined by ``lons,lats``).
"""
if lons.ndim == 1 and lats.ndim == 1:
lons, lats = np.meshgrid(lons, lats)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-06-16 21:12:01
|
Revision: 5566
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5566&view=rev
Author: jswhit
Date: 2008-06-16 14:11:57 -0700 (Mon, 16 Jun 2008)
Log Message:
-----------
add tabularcolumns sphinx directive so tables look nice in pdf.
Modified Paths:
--------------
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-06-16 21:11:11 UTC (rev 5565)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-06-16 21:11:57 UTC (rev 5566)
@@ -129,6 +129,8 @@
For most map projections, the map projection region can either be
specified by setting these keywords:
+ .. tabularcolumns:: |l|L|
+
============== ====================================================
Keyword Description
============== ====================================================
@@ -144,6 +146,8 @@
or these
+ .. tabularcolumns:: |l|L|
+
============== ====================================================
Keyword Description
============== ====================================================
@@ -175,6 +179,8 @@
Other keyword arguments:
+ .. tabularcolumns:: |l|L|
+
============== ====================================================
Keyword Description
============== ====================================================
@@ -241,6 +247,8 @@
The module variable ``projection_params`` is a dictionary which
lists which parameters apply to which projections.
+ .. tabularcolumns:: |l|L|
+
================ ====================================================
Keyword Description
================ ====================================================
@@ -284,6 +292,8 @@
Useful instance variables:
+ .. tabularcolumns:: |l|L|
+
================ ====================================================
Variable Name Description
================ ====================================================
@@ -1125,6 +1135,8 @@
draw boundary around map projection region, optionally
filling interior of region.
+ .. tabularcolumns:: |l|L|
+
============== ====================================================
Keyword Description
============== ====================================================
@@ -1238,6 +1250,8 @@
"""
Fill continents.
+ .. tabularcolumns:: |l|L|
+
============== ====================================================
Keyword Description
============== ====================================================
@@ -1307,6 +1321,8 @@
"""
Draw coastlines.
+ .. tabularcolumns:: |l|L|
+
============== ====================================================
Keyword Description
============== ====================================================
@@ -1347,6 +1363,8 @@
"""
Draw country boundaries.
+ .. tabularcolumns:: |l|L|
+
============== ====================================================
Keyword Description
============== ====================================================
@@ -1392,6 +1410,8 @@
"""
Draw state boundaries in Americas.
+ .. tabularcolumns:: |l|L|
+
============== ====================================================
Keyword Description
============== ====================================================
@@ -1437,6 +1457,8 @@
"""
Draw major rivers.
+ .. tabularcolumns:: |l|L|
+
============== ====================================================
Keyword Description
============== ====================================================
@@ -1490,6 +1512,8 @@
Mandatory Arguments:
+ .. tabularcolumns:: |l|L|
+
============== ====================================================
Argument Description
============== ====================================================
@@ -1516,6 +1540,8 @@
and Polygon shape types, for Point and MultiPoint shapes they are
ignored.
+ .. tabularcolumns:: |l|L|
+
============== ====================================================
Keyword Description
============== ====================================================
@@ -1625,13 +1651,14 @@
dashes=[1,1],labels=[0,0,0,0],labelstyle=None, \
fmt='%g',xoffset=None,yoffset=None,ax=None,**kwargs):
"""
- Draw and label parallels (latitude lines).
+ Draw and label parallels (latitude lines) for values (in degrees)
+ given in the sequence ``circles``.
+ .. tabularcolumns:: |l|L|
+
============== ====================================================
Keyword Description
============== ====================================================
- circles sequence containing latitude values to draw (in
- degrees).
color color to draw parallels (default black).
linewidth line width for parallels (default 1.)
zorder sets the zorder for parallels (if not specified,
@@ -1880,13 +1907,14 @@
dashes=[1,1],labels=[0,0,0,0],labelstyle=None,\
fmt='%g',xoffset=None,yoffset=None,ax=None,**kwargs):
"""
- Draw and label meridians (longitude lines).
+ Draw and label meridians (longitude lines) for values (in degrees)
+ given in the sequence ``meridians``.
+ .. tabularcolumns:: |l|L|
+
============== ====================================================
Keyword Description
============== ====================================================
- meridians sequence containing longitude values to draw (in
- degrees).
color color to draw meridians (default black).
linewidth line width for meridians (default 1.)
zorder sets the zorder for meridians (if not specified,
@@ -2138,6 +2166,8 @@
"""
Draw a great circle on the map.
+ .. tabularcolumns:: |l|L|
+
============== =======================================================
Keyword Description
============== =======================================================
@@ -2177,6 +2207,8 @@
map projection coordinates for plotting on a map with
the :meth:`imshow`.
+ .. tabularcolumns:: |l|L|
+
============== ====================================================
Keyword Description
============== ====================================================
@@ -2237,6 +2269,8 @@
vector field is rotated to map projection coordinates (relative
to x and y). The magnitude of the vector is preserved.
+ .. tabularcolumns:: |l|L|
+
============== ====================================================
Keyword Description
============== ====================================================
@@ -2298,6 +2332,8 @@
vector field is rotated to map projection coordinates (relative
to x and y). The magnitude of the vector is preserved.
+ .. tabularcolumns:: |l|L|
+
============== ====================================================
Keyword Description
============== ====================================================
@@ -2801,6 +2837,8 @@
of other images, due to limitations in matplotlib image handling
(you can't specify the zorder of an image).
+ .. tabularcolumns:: |l|L|
+
============== ====================================================
Arguments Description
============== ====================================================
@@ -2815,6 +2853,8 @@
rgba_ocean = (0,0,255,0).
============== ====================================================
+ .. tabularcolumns:: |l|L|
+
============== ====================================================
Keywords Description
============== ====================================================
@@ -3028,6 +3068,8 @@
representing distance in the map
projection coordinates at ``lon0,lat0``.
+ .. tabularcolumns:: |l|L|
+
============== ====================================================
Keywords Description
============== ====================================================
@@ -3233,6 +3275,8 @@
Interpolate data (``datain``) on a rectilinear grid (with x = ``xin``
y = ``yin``) to a grid with x = ``xout``, y= ``yout``.
+ .. tabularcolumns:: |l|L|
+
============== ====================================================
Arguments Description
============== ====================================================
@@ -3244,6 +3288,8 @@
grid.
============== ====================================================
+ .. tabularcolumns:: |l|L|
+
============== ====================================================
Keywords Description
============== ====================================================
@@ -3361,6 +3407,8 @@
Shift global lat/lon grid east or west.
assumes wraparound (or cyclic point) is included.
+ .. tabularcolumns:: |l|L|
+
============== ====================================================
Arguments Description
============== ====================================================
@@ -3371,6 +3419,8 @@
lonsin original longitudes.
============== ====================================================
+ .. tabularcolumns:: |l|L|
+
============== ====================================================
Keywords Description
============== ====================================================
@@ -3468,12 +3518,16 @@
but the reference time and calendar can be changed via the
``units`` and ``calendar`` keywords.
+ .. tabularcolumns:: |l|L|
+
============== ====================================================
Arguments Description
============== ====================================================
times numeric time values. Maximum resolution is 1 second.
============== ====================================================
+ .. tabularcolumns:: |l|L|
+
============== ====================================================
Keywords Description
============== ====================================================
@@ -3521,6 +3575,8 @@
but the reference time and calendar can be changed via the
``units`` and ``calendar`` keywords.
+ .. tabularcolumns:: |l|L|
+
============== ====================================================
Arguments Description
============== ====================================================
@@ -3529,6 +3585,8 @@
time-zone offset.
============== ====================================================
+ .. tabularcolumns:: |l|L|
+
============== ====================================================
Keywords Description
============== ====================================================
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-06-16 21:11:33
|
Revision: 5565
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5565&view=rev
Author: jswhit
Date: 2008-06-16 14:11:11 -0700 (Mon, 16 Jun 2008)
Log Message:
-----------
delete extra line
Modified Paths:
--------------
trunk/toolkits/basemap/doc/index.rst
Modified: trunk/toolkits/basemap/doc/index.rst
===================================================================
--- trunk/toolkits/basemap/doc/index.rst 2008-06-16 17:38:08 UTC (rev 5564)
+++ trunk/toolkits/basemap/doc/index.rst 2008-06-16 21:11:11 UTC (rev 5565)
@@ -1,10 +1,6 @@
-.. basemap documentation master file
-
Welcome to the Matplotlib Basemap Toolkit documentation!
========================================================
-Contents:
-
.. toctree::
:maxdepth: 2
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-06-16 17:39:14
|
Revision: 5564
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5564&view=rev
Author: mdboom
Date: 2008-06-16 10:38:08 -0700 (Mon, 16 Jun 2008)
Log Message:
-----------
Support using STIX fonts in math expressions. Use this functionality
to generate a png that used to be static.
Modified Paths:
--------------
trunk/matplotlib/doc/sphinxext/mathpng.py
trunk/matplotlib/doc/users/mathtext.rst
Removed Paths:
-------------
trunk/matplotlib/doc/_static/stix_fonts.png
Deleted: trunk/matplotlib/doc/_static/stix_fonts.png
===================================================================
(Binary files differ)
Modified: trunk/matplotlib/doc/sphinxext/mathpng.py
===================================================================
--- trunk/matplotlib/doc/sphinxext/mathpng.py 2008-06-16 17:21:39 UTC (rev 5563)
+++ trunk/matplotlib/doc/sphinxext/mathpng.py 2008-06-16 17:38:08 UTC (rev 5564)
@@ -5,6 +5,7 @@
from md5 import md5
from docutils import nodes
+from docutils.parsers.rst import directives
from docutils.writers.html4css1 import HTMLTranslator
from sphinx.latexwriter import LaTeXTranslator
@@ -12,14 +13,27 @@
class latex_math(nodes.General, nodes.Element):
pass
+def fontset_choice(arg):
+ return directives.choice(arg, ['cm', 'stix', 'stixsans'])
+
+options_spec = {'fontset': fontset_choice}
+
def math_role(role, rawtext, text, lineno, inliner,
options={}, content=[]):
i = rawtext.find('`')
latex = rawtext[i+1:-1]
node = latex_math(rawtext)
node['latex'] = latex
+ node['fontset'] = options.get('fontset', 'cm')
return [node], []
+math_role.options = options_spec
+def math_directive_run(content, block_text, options):
+ latex = ''.join(content)
+ node = latex_math(block_text)
+ node['latex'] = latex
+ node['fontset'] = options.get('fontset', 'cm')
+ return [node]
try:
from docutils.parsers.rst import Directive
@@ -28,22 +42,19 @@
from docutils.parsers.rst.directives import _directives
def math_directive(name, arguments, options, content, lineno,
content_offset, block_text, state, state_machine):
- latex = ''.join(content)
- node = latex_math(block_text)
- node['latex'] = latex
- return [node]
+ return math_directive_run(content, block_text, options)
math_directive.arguments = None
- math_directive.options = {}
+ math_directive.options = options_spec
math_directive.content = 1
_directives['math'] = math_directive
else:
class math_directive(Directive):
has_content = True
+ option_spec = options_spec
+
def run(self):
- latex = ' '.join(self.content)
- node = latex_math(self.block_text)
- node['latex'] = latex
- return [node]
+ return math_directive_run(self.content, self.block_text,
+ self.options)
from docutils.parsers.rst import directives
directives.register_directive('math', math_directive)
@@ -100,12 +111,14 @@
# This uses mathtext to render the expression
-def latex2png(latex, filename):
+def latex2png(latex, filename, fontset='cm'):
if os.path.exists(filename):
return
+ orig_fontset = rcParams['mathtext.fontset']
+ rcParams['mathtext.fontset'] = fontset
mathtext_parser.to_png(filename, "$%s$" % latex, dpi=120)
+ rcParams['mathtext.fontset'] = orig_fontset
-
# LaTeX to HTML translation stuff:
def latex2html(node, source):
inline = isinstance(node.parent, nodes.TextElement)
@@ -114,7 +127,7 @@
name = 'math-%s' % md5(latex).hexdigest()[-10:]
dest = '_static/%s.png' % name
if not isfile(dest):
- latex2png(latex, dest)
+ latex2png(latex, dest, node['fontset'])
path = '_static'
count = source.split('/doc/')[-1].count('/')
Modified: trunk/matplotlib/doc/users/mathtext.rst
===================================================================
--- trunk/matplotlib/doc/users/mathtext.rst 2008-06-16 17:21:39 UTC (rev 5563)
+++ trunk/matplotlib/doc/users/mathtext.rst 2008-06-16 17:38:08 UTC (rev 5564)
@@ -147,22 +147,39 @@
The choices available with all fonts are:
- =============== =================================
- Command Result
- =============== =================================
- ``\mathrm`` :math:`\mathrm{Roman}`
- ``\mathit`` :math:`\mathit{Italic}`
- ``\mathtt`` :math:`\mathtt{Typewriter}`
- ``\mathcal`` :math:`\mathcal{CALLIGRAPHY}`
- =============== =================================
+ ============================ ==================================
+ Command Result
+ ============================ ==================================
+ ``\mathrm{Roman}`` :math:`\mathrm{Roman}`
+ ``\mathit{Italic}`` :math:`\mathit{Italic}`
+ ``\mathtt{Typewriter}`` :math:`\mathtt{Typewriter}`
+ ``\mathcal{CALLIGRAPHY}`` :math:`\mathcal{CALLIGRAPHY}`
+ ============================ ==================================
+.. role:: math-stix(math)
+ :fontset: stix
+
When using the STIX fonts, you also have the choice of:
-.. image:: ../_static/stix_fonts.png
+ ====================================== =========================================
+ Command Result
+ ====================================== =========================================
+ ``\mathbb{blackboard}`` :math-stix:`\mathbb{blackboard}`
+ ``\mathrm{\mathbb{blackboard}}`` :math-stix:`\mathrm{\mathbb{blackboard}}`
+ ``\mathfrak{Fraktur}`` :math-stix:`\mathfrak{Fraktur}`
+ ``\mathsf{sansserif}`` :math-stix:`\mathsf{sansserif}`
+ ``\mathrm{\mathsf{sansserif}}`` :math-stix:`\mathrm{\mathsf{sansserif}}`
+ ====================================== =========================================
+.. htmlonly::
+
+ ====================================== =========================================
+ ``\mathcircled{circled}`` :math-stix:`\mathcircled{circled}`
+ ====================================== =========================================
+
There are also three global "font sets" to choose from, which are
selected using the ``mathtext.fontset`` parameter in
-::ref:`matplotlibrc <matplotlibrc-sample>`.
+:ref:`matplotlibrc <matplotlibrc-sample>`.
``cm``: **Computer Modern (TeX)**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-06-16 17:22:27
|
Revision: 5563
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5563&view=rev
Author: jswhit
Date: 2008-06-16 10:21:39 -0700 (Mon, 16 Jun 2008)
Log Message:
-----------
no basemap.py anymore, include docs.
Modified Paths:
--------------
trunk/toolkits/basemap/MANIFEST.in
Modified: trunk/toolkits/basemap/MANIFEST.in
===================================================================
--- trunk/toolkits/basemap/MANIFEST.in 2008-06-16 16:42:49 UTC (rev 5562)
+++ trunk/toolkits/basemap/MANIFEST.in 2008-06-16 17:21:39 UTC (rev 5563)
@@ -71,7 +71,6 @@
include examples/README
include lib/mpl_toolkits/__init__.py
include lib/mpl_toolkits/basemap/__init__.py
-include lib/mpl_toolkits/basemap/basemap.py
include lib/mpl_toolkits/basemap/proj.py
include lib/mpl_toolkits/basemap/pyproj.py
include lib/mpl_toolkits/basemap/cm.py
@@ -82,6 +81,14 @@
include pyshapelib/*.shp pyshapelib/*.shx pyshapelib/*.dbf
include pyshapelib/shapelib/*.c pyshapelib/shapelib/*.h
include MANIFEST.in
+include doc/users/figures/*py
+include doc/users/figures/*png
+include doc/users/*rst
+include doc/api/*rst
+include doc/README.txt
+include doc/make.py
+include doc/conf.py
+include doc/index.rst
recursive-include geos-2.2.3 *
recursive-include lib/dap *
recursive-include lib/httplib2 *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-06-16 16:44:26
|
Revision: 5562
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5562&view=rev
Author: jswhit
Date: 2008-06-16 09:42:49 -0700 (Mon, 16 Jun 2008)
Log Message:
-----------
make figures.
Modified Paths:
--------------
trunk/toolkits/basemap/doc/make.py
Modified: trunk/toolkits/basemap/doc/make.py
===================================================================
--- trunk/toolkits/basemap/doc/make.py 2008-06-16 16:40:09 UTC (rev 5561)
+++ trunk/toolkits/basemap/doc/make.py 2008-06-16 16:42:49 UTC (rev 5562)
@@ -15,8 +15,7 @@
pass
def figs():
- #os.system('cd users/figures/ && python make.py')
- os.system('cd users/figures')
+ os.system('cd users/figures/ && python make.py')
def html():
check_build()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|