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: <md...@us...> - 2008-12-18 13:42:17
|
Revision: 6662
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6662&view=rev
Author: mdboom
Date: 2008-12-18 13:42:13 +0000 (Thu, 18 Dec 2008)
Log Message:
-----------
Fix docstring typo.
Modified Paths:
--------------
branches/v0_98_5_maint/doc/api/font_manager_api.rst
Modified: branches/v0_98_5_maint/doc/api/font_manager_api.rst
===================================================================
--- branches/v0_98_5_maint/doc/api/font_manager_api.rst 2008-12-18 13:41:35 UTC (rev 6661)
+++ branches/v0_98_5_maint/doc/api/font_manager_api.rst 2008-12-18 13:42:13 UTC (rev 6662)
@@ -11,7 +11,7 @@
:show-inheritance:
:mod:`matplotlib.fontconfig_pattern`
-========================================
+====================================
.. automodule:: matplotlib.fontconfig_pattern
:members:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-12-18 13:41:39
|
Revision: 6661
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6661&view=rev
Author: mdboom
Date: 2008-12-18 13:41:35 +0000 (Thu, 18 Dec 2008)
Log Message:
-----------
Fix bug where a line with NULL data limits prevents subsequent data limits from calculating correctly
Modified Paths:
--------------
branches/v0_98_5_maint/CHANGELOG
branches/v0_98_5_maint/src/_path.cpp
Modified: branches/v0_98_5_maint/CHANGELOG
===================================================================
--- branches/v0_98_5_maint/CHANGELOG 2008-12-18 12:10:51 UTC (rev 6660)
+++ branches/v0_98_5_maint/CHANGELOG 2008-12-18 13:41:35 UTC (rev 6661)
@@ -1,3 +1,8 @@
+2008-12-18 Fix bug where a line with NULL data limits prevents
+ subsequent data limits from calculating correctly - MGD
+
+2008-12-17 Major documentation generator changes - MGD
+
2008-12-17 Applied macosx backend patch with support for path
collections, quadmesh, etc... - JDH
@@ -3,4 +8,5 @@
2008-12-17 fix dpi-dependent behavior of text bbox and arrow in annotate
-JJL
+
2008-12-16 Another attempt to fix dpi-dependent behavior of Legend. -JJL
Modified: branches/v0_98_5_maint/src/_path.cpp
===================================================================
--- branches/v0_98_5_maint/src/_path.cpp 2008-12-18 12:10:51 UTC (rev 6660)
+++ branches/v0_98_5_maint/src/_path.cpp 2008-12-18 13:41:35 UTC (rev 6661)
@@ -403,10 +403,25 @@
}
else
{
- extents_data[0] = std::min(x0, x1);
- extents_data[1] = std::min(y0, y1);
- extents_data[2] = std::max(x0, x1);
- extents_data[3] = std::max(y0, y1);
+ if (x0 > x1)
+ {
+ extents_data[0] = std::numeric_limits<double>::infinity();
+ extents_data[2] = -std::numeric_limits<double>::infinity();
+ }
+ else
+ {
+ extents_data[0] = x0;
+ extents_data[2] = x1;
+ }
+ if (y0 > y1) {
+ extents_data[1] = std::numeric_limits<double>::infinity();
+ extents_data[3] = -std::numeric_limits<double>::infinity();
+ }
+ else
+ {
+ extents_data[1] = y0;
+ extents_data[3] = y1;
+ }
minpos_data[0] = xm;
minpos_data[1] = ym;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-12-18 12:23:14
|
Revision: 6660
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6660&view=rev
Author: jdh2358
Date: 2008-12-18 12:10:51 +0000 (Thu, 18 Dec 2008)
Log Message:
-----------
applied maxosx backend update
Modified Paths:
--------------
branches/v0_98_5_maint/CHANGELOG
branches/v0_98_5_maint/doc/_templates/index.html
branches/v0_98_5_maint/lib/matplotlib/__init__.py
branches/v0_98_5_maint/lib/matplotlib/backends/backend_macosx.py
branches/v0_98_5_maint/src/_macosx.m
Modified: branches/v0_98_5_maint/CHANGELOG
===================================================================
--- branches/v0_98_5_maint/CHANGELOG 2008-12-18 09:02:11 UTC (rev 6659)
+++ branches/v0_98_5_maint/CHANGELOG 2008-12-18 12:10:51 UTC (rev 6660)
@@ -1,6 +1,8 @@
+2008-12-17 Applied macosx backend patch with support for path
+ collections, quadmesh, etc... - JDH
+
2008-12-17 fix dpi-dependent behavior of text bbox and arrow in annotate
-JJL
-
2008-12-16 Another attempt to fix dpi-dependent behavior of Legend. -JJL
======================================================================
Modified: branches/v0_98_5_maint/doc/_templates/index.html
===================================================================
--- branches/v0_98_5_maint/doc/_templates/index.html 2008-12-18 09:02:11 UTC (rev 6659)
+++ branches/v0_98_5_maint/doc/_templates/index.html 2008-12-18 12:10:51 UTC (rev 6660)
@@ -1,5 +1,5 @@
{% extends "layout.html" %}
-{% set title = 'Overview' %}
+{% set title = 'matplotlib: python plotting' %}
{% block body %}
Modified: branches/v0_98_5_maint/lib/matplotlib/__init__.py
===================================================================
--- branches/v0_98_5_maint/lib/matplotlib/__init__.py 2008-12-18 09:02:11 UTC (rev 6659)
+++ branches/v0_98_5_maint/lib/matplotlib/__init__.py 2008-12-18 12:10:51 UTC (rev 6660)
@@ -89,7 +89,7 @@
"""
from __future__ import generators
-__version__ = '0.98.5.1'
+__version__ = '0.98.5.2'
__revision__ = '$Revision$'
__date__ = '$Date$'
Modified: branches/v0_98_5_maint/lib/matplotlib/backends/backend_macosx.py
===================================================================
--- branches/v0_98_5_maint/lib/matplotlib/backends/backend_macosx.py 2008-12-18 09:02:11 UTC (rev 6659)
+++ branches/v0_98_5_maint/lib/matplotlib/backends/backend_macosx.py 2008-12-18 12:10:51 UTC (rev 6660)
@@ -10,6 +10,7 @@
from matplotlib.figure import Figure
from matplotlib.path import Path
from matplotlib.mathtext import MathTextParser
+from matplotlib.colors import colorConverter
@@ -48,34 +49,47 @@
self.width, self.height = width, height
def draw_path(self, gc, path, transform, rgbFace=None):
- path = transform.transform_path(path)
- for points, code in path.iter_segments():
- if code == Path.MOVETO:
- gc.moveto(points)
- elif code == Path.LINETO:
- gc.lineto(points)
- elif code == Path.CURVE3:
- gc.curve3(points)
- elif code == Path.CURVE4:
- gc.curve4(points)
- elif code == Path.CLOSEPOLY:
- gc.closepoly()
if rgbFace is not None:
rgbFace = tuple(rgbFace)
- gc.stroke(rgbFace)
+ if gc!=self.gc:
+ n = self.gc.level() - gc.level()
+ for i in range(n): self.gc.restore()
+ self.gc = gc
+ gc.draw_path(path, transform, rgbFace)
+ def draw_markers(self, gc, marker_path, marker_trans, path, trans, rgbFace=None):
+ if rgbFace is not None:
+ rgbFace = tuple(rgbFace)
+ if gc!=self.gc:
+ n = self.gc.level() - gc.level()
+ for i in range(n): self.gc.restore()
+ self.gc = gc
+ gc.draw_markers(marker_path, marker_trans, path, trans, rgbFace)
+
+ def draw_path_collection(self, *args):
+ gc = self.gc
+ args = args[:13]
+ gc.draw_path_collection(*args)
+
+ def draw_quad_mesh(self, *args):
+ gc = self.gc
+ gc.draw_quad_mesh(*args)
+
def new_gc(self):
self.gc.reset()
return self.gc
def draw_image(self, x, y, im, bbox, clippath=None, clippath_trans=None):
- self.gc.set_clip_rectangle(bbox)
im.flipud_out()
nrows, ncols, data = im.as_rgba_str()
- self.gc.draw_image(x, y, nrows, ncols, data)
+ self.gc.draw_image(x, y, nrows, ncols, data, bbox, clippath, clippath_trans)
im.flipud_out()
def draw_tex(self, gc, x, y, s, prop, angle):
+ if gc!=self.gc:
+ n = self.gc.level() - gc.level()
+ for i in range(n): self.gc.restore()
+ self.gc = gc
# todo, handle props, angle, origins
size = prop.get_size_in_points()
texmanager = self.get_texmanager()
@@ -88,12 +102,20 @@
gc.draw_mathtext(x, y, angle, Z)
def _draw_mathtext(self, gc, x, y, s, prop, angle):
+ if gc!=self.gc:
+ n = self.gc.level() - gc.level()
+ for i in range(n): self.gc.restore()
+ self.gc = gc
size = prop.get_size_in_points()
ox, oy, width, height, descent, image, used_characters = \
self.mathtext_parser.parse(s, self.dpi, prop)
gc.draw_mathtext(x, y, angle, 255 - image.as_array())
def draw_text(self, gc, x, y, s, prop, angle, ismath=False):
+ if gc!=self.gc:
+ n = self.gc.level() - gc.level()
+ for i in range(n): self.gc.restore()
+ self.gc = gc
if ismath:
self._draw_mathtext(gc, x, y, s, prop, angle)
else:
@@ -143,6 +165,11 @@
GraphicsContextBase.__init__(self)
_macosx.GraphicsContext.__init__(self)
+ def set_foreground(self, fg, isRGB=False):
+ if not isRGB:
+ fg = colorConverter.to_rgb(fg)
+ _macosx.GraphicsContext.set_foreground(self, fg)
+
def set_clip_rectangle(self, box):
GraphicsContextBase.set_clip_rectangle(self, box)
if not box: return
@@ -152,20 +179,8 @@
GraphicsContextBase.set_clip_path(self, path)
if not path: return
path = path.get_fully_transformed_path()
- for points, code in path.iter_segments():
- if code == Path.MOVETO:
- self.moveto(points)
- elif code == Path.LINETO:
- self.lineto(points)
- elif code == Path.CURVE3:
- self.curve3(points)
- elif code == Path.CURVE4:
- self.curve4(points)
- elif code == Path.CLOSEPOLY:
- self.closepoly()
- self.clip_path()
+ _macosx.GraphicsContext.set_clip_path(self, path)
-
########################################################################
#
# The following functions and classes are for pylab and implement
Modified: branches/v0_98_5_maint/src/_macosx.m
===================================================================
--- branches/v0_98_5_maint/src/_macosx.m 2008-12-18 09:02:11 UTC (rev 6659)
+++ branches/v0_98_5_maint/src/_macosx.m 2008-12-18 12:10:51 UTC (rev 6660)
@@ -4,15 +4,33 @@
#include <Python.h>
#include "numpy/arrayobject.h"
-static int nwin = 0;
+static int nwin = 0; /* The number of open windows */
+static int ngc = 0; /* The number of graphics contexts in use */
-/* Varius NSApplicationDefined event subtypes */
+/* For drawing Unicode strings with ATSUI */
+static ATSUStyle style = NULL;
+static ATSUTextLayout layout = NULL;
+
+/* CGFloat was defined in Mac OS X 10.5 */
+#ifndef CGFloat
+#define CGFloat float
+#endif
+
+
+/* Various NSApplicationDefined event subtypes */
#define STDIN_READY 0
#define SIGINT_CALLED 1
#define STOP_EVENT_LOOP 2
#define WINDOW_CLOSING 3
+/* Path definitions */
+#define STOP 0
+#define MOVETO 1
+#define LINETO 2
+#define CURVE3 3
+#define CURVE4 4
+#define CLOSEPOLY 5
/* -------------------------- Helper function ---------------------------- */
static void stdin_ready(CFReadStreamRef readStream, CFStreamEventType eventType, void* context)
@@ -147,8 +165,44 @@
return 1;
}
-static char show__doc__[] = "Show all the figures and enter the main loop.\nThis function does not return until all Matplotlib windows are closed,\nand is normally not needed in interactive sessions.";
+static int _init_atsui(void)
+{
+ OSStatus status;
+ status = ATSUCreateStyle(&style);
+ if (status!=noErr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "ATSUCreateStyle failed");
+ return 0;
+ }
+
+ status = ATSUCreateTextLayout(&layout);
+ if (status!=noErr)
+ {
+ status = ATSUDisposeStyle(style);
+ if (status!=noErr)
+ PyErr_WarnEx(PyExc_RuntimeWarning, "ATSUDisposeStyle failed", 1);
+ PyErr_SetString(PyExc_RuntimeError, "ATSUCreateTextLayout failed");
+ return 0;
+ }
+
+
+ return 1;
+}
+
+static void _dealloc_atsui(void)
+{
+ OSStatus status;
+
+ status = ATSUDisposeStyle(style);
+ if (status!=noErr)
+ PyErr_WarnEx(PyExc_RuntimeWarning, "ATSUDisposeStyle failed", 1);
+
+ status = ATSUDisposeTextLayout(layout);
+ if (status!=noErr)
+ PyErr_WarnEx(PyExc_RuntimeWarning, "ATSUDisposeTextLayout failed", 1);
+}
+
/* ---------------------------- Cocoa classes ---------------------------- */
@@ -220,76 +274,38 @@
typedef struct {
PyObject_HEAD
CGContextRef cr;
- PyObject* converter; /* Convert color specifications to r,g,b triples */
CGPatternRef pattern; /* For drawing hatches */
- ATSUStyle style; /* For drawing Unicode strings with ATSUI */
- ATSUTextLayout layout; /* For drawing Unicode strings with ATSUI */
} GraphicsContext;
static PyObject*
GraphicsContext_new(PyTypeObject* type, PyObject *args, PyObject *kwds)
{
- OSStatus status;
-
GraphicsContext* self = (GraphicsContext*)type->tp_alloc(type, 0);
if (!self) return NULL;
self->cr = NULL;
- PyObject* module = PyImport_AddModule("matplotlib.colors");
- if (!module) return NULL;
- PyObject* dict = PyObject_GetAttrString(module, "__dict__");
- if (!dict) return NULL;
- PyObject* colorConverter = PyDict_GetItemString(dict, "colorConverter");
- Py_DECREF(dict);
- if (!colorConverter)
- {
- PyErr_SetString(PyExc_KeyError,
- "failed to find colorConverter in matplotlib.colors");
- return NULL;
- }
- self->converter = PyObject_GetAttrString(colorConverter, "to_rgb");
- if (!self->converter) return NULL;
-
self->pattern = NULL;
- status = ATSUCreateStyle(&self->style);
- if (status!=noErr)
+ if (ngc==0)
{
- Py_DECREF(self->converter);
- PyErr_SetString(PyExc_RuntimeError, "ATSUCreateStyle failed");
- return NULL;
+ int ok = _init_atsui();
+ if (!ok)
+ {
+ return NULL;
+ }
}
+ ngc++;
- status = ATSUCreateTextLayout(&self->layout);
- if (status!=noErr)
- {
- Py_DECREF(self->converter);
- status = ATSUDisposeStyle(self->style);
- if (status!=noErr)
- PyErr_WarnEx(PyExc_RuntimeWarning, "ATSUDisposeStyle failed", 1);
- PyErr_SetString(PyExc_RuntimeError, "ATSUCreateTextLayout failed");
- return NULL;
- }
-
return (PyObject*) self;
}
static void
GraphicsContext_dealloc(GraphicsContext *self)
{
- Py_DECREF(self->converter);
+ CGPatternRelease(self->pattern);
- if (self->pattern) CGPatternRelease(self->pattern);
+ ngc--;
+ if (ngc==0) _dealloc_atsui();
- OSStatus status;
-
- status = ATSUDisposeStyle(self->style);
- if (status!=noErr)
- PyErr_WarnEx(PyExc_RuntimeWarning, "ATSUDisposeStyle failed", 1);
-
- status = ATSUDisposeTextLayout(self->layout);
- if (status!=noErr)
- PyErr_WarnEx(PyExc_RuntimeWarning, "ATSUDisposeTextLayout failed", 1);
-
self->ob_type->tp_free((PyObject*)self);
}
@@ -308,6 +324,13 @@
PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
return NULL;
}
+
+ if (self->pattern)
+ {
+ CGPatternRelease(self->pattern);
+ self->pattern = NULL;
+ }
+
CGContextRestoreGState(cr);
CGContextSaveGState(cr);
Py_INCREF(Py_None);
@@ -400,7 +423,7 @@
}
static PyObject*
-GraphicsContext_clip_path (GraphicsContext* self)
+GraphicsContext_set_clip_path (GraphicsContext* self, PyObject* args)
{
CGContextRef cr = self->cr;
if (!cr)
@@ -408,29 +431,216 @@
PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
return NULL;
}
- CGContextRestoreGState(cr);
- CGContextSaveGState(cr);
- CGContextClip(cr);
- Py_INCREF(Py_None);
- return Py_None;
-}
+#ifdef BUH
+ CGContextRestoreGState(cr); /* FIXME */
+ CGContextSaveGState(cr); /* FIXME */
+#endif
-static PyObject*
-GraphicsContext_set_dashes (GraphicsContext* self, PyObject* args)
-{
- float phase = 0.0;
- PyObject* offset;
- PyObject* dashes;
+ PyObject* path;
- if (!PyArg_ParseTuple(args, "OO", &offset, &dashes)) return NULL;
+ if(!PyArg_ParseTuple(args, "O", &path)) return NULL;
- CGContextRef cr = self->cr;
- if (!cr)
+ PyObject* vertices = PyObject_GetAttrString(path, "vertices");
+ if (vertices==NULL)
{
- PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
+ PyErr_SetString(PyExc_AttributeError, "path has no vertices");
return NULL;
}
+ Py_DECREF(vertices); /* Don't keep a reference here */
+ PyObject* codes = PyObject_GetAttrString(path, "codes");
+ if (codes==NULL)
+ {
+ PyErr_SetString(PyExc_AttributeError, "path has no codes");
+ return NULL;
+ }
+ Py_DECREF(codes); /* Don't keep a reference here */
+
+ PyArrayObject* coordinates;
+ coordinates = (PyArrayObject*)PyArray_FromObject(vertices,
+ NPY_DOUBLE, 2, 2);
+ if (!coordinates)
+ {
+ PyErr_SetString(PyExc_ValueError, "failed to convert vertices array");
+ return NULL;
+ }
+
+ if (PyArray_NDIM(coordinates) != 2 || PyArray_DIM(coordinates, 1) != 2)
+ {
+ Py_DECREF(coordinates);
+ PyErr_SetString(PyExc_ValueError, "invalid vertices array");
+ return NULL;
+ }
+
+ npy_intp n = PyArray_DIM(coordinates, 0);
+
+ if (n==0) /* Nothing to do here */
+ {
+ Py_DECREF(coordinates);
+ return NULL;
+ }
+
+ PyArrayObject* codelist = NULL;
+ if (codes != Py_None)
+ {
+ codelist = (PyArrayObject*)PyArray_FromObject(codes,
+ NPY_UINT8, 1, 1);
+ if (!codelist)
+ {
+ Py_DECREF(coordinates);
+ PyErr_SetString(PyExc_ValueError, "invalid codes array");
+ return NULL;
+ }
+ }
+
+ CGFloat x, y;
+
+ if (codelist==NULL)
+ {
+ npy_intp i;
+ npy_uint8 code = MOVETO;
+ for (i = 0; i < n; i++)
+ {
+ x = (CGFloat)(*(double*)PyArray_GETPTR2(coordinates, i, 0));
+ y = (CGFloat)(*(double*)PyArray_GETPTR2(coordinates, i, 1));
+ if (isnan(x) || isnan(y))
+ {
+ code = MOVETO;
+ }
+ else
+ {
+ switch (code)
+ {
+ case MOVETO:
+ CGContextMoveToPoint(cr, x, y);
+ break;
+ case LINETO:
+ CGContextAddLineToPoint(cr, x, y);
+ break;
+ }
+ code = LINETO;
+ }
+ }
+ }
+ else
+ {
+ npy_intp i = 0;
+ BOOL was_nan = false;
+ npy_uint8 code;
+ CGFloat x1, y1, x2, y2, x3, y3;
+ while (i < n)
+ {
+ code = *(npy_uint8*)PyArray_GETPTR1(codelist, i);
+ if (code == CLOSEPOLY)
+ {
+ CGContextClosePath(cr);
+ i++;
+ }
+ else if (code == STOP)
+ {
+ break;
+ }
+ else if (was_nan)
+ {
+ if (code==CURVE3) i++;
+ else if (code==CURVE4) i+=2;
+ x1 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 0));
+ y1 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 1));
+ i++;
+ if (isnan(x1) || isnan(y1))
+ {
+ was_nan = true;
+ }
+ else
+ {
+ CGContextMoveToPoint(cr, x1, y1);
+ was_nan = false;
+ }
+ }
+ else if (code==MOVETO)
+ {
+ x1 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 0));
+ y1 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 1));
+ i++;
+ if (isnan(x1) || isnan(y1))
+ {
+ was_nan = true;
+ }
+ else
+ {
+ CGContextMoveToPoint(cr, x1, y1);
+ was_nan = false;
+ }
+ }
+ else if (code==LINETO)
+ {
+ x1 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 0));
+ y1 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 1));
+ i++;
+ if (isnan(x1) || isnan(y1))
+ {
+ was_nan = true;
+ }
+ else
+ {
+ CGContextAddLineToPoint(cr, x1, y1);
+ was_nan = false;
+ }
+ }
+ else if (code==CURVE3)
+ {
+ x1 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 0));
+ y1 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 1));
+ i++;
+ x2 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 0));
+ y2 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 1));
+ i++;
+ if (isnan(x1) || isnan(y1) || isnan(x2) || isnan(y2))
+ {
+ was_nan = true;
+ }
+ else
+ {
+ CGContextAddQuadCurveToPoint(cr, x1, y1, x2, y2);
+ was_nan = false;
+ }
+ }
+ else if (code==CURVE4)
+ {
+ x1 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 0));
+ y1 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 1));
+ i++;
+ x2 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 0));
+ y2 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 1));
+ i++;
+ x3 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 0));
+ y3 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 1));
+ i++;
+ if (isnan(x1) || isnan(y1) || isnan(x2) || isnan(y2) || isnan(x3) || isnan(y3))
+ {
+ was_nan = true;
+ }
+ else
+ {
+ CGContextAddCurveToPoint(cr, x1, y1, x2, y2, x3, y3);
+ was_nan = false;
+ }
+ }
+ }
+ Py_DECREF(codelist);
+ }
+
+ Py_DECREF(coordinates);
+
+ CGContextClip(cr);
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static BOOL
+_set_dashes(CGContextRef cr, PyObject* offset, PyObject* dashes)
+{
+ float phase = 0.0;
if (offset!=Py_None)
{
if (PyFloat_Check(offset)) phase = PyFloat_AsDouble(offset);
@@ -439,7 +649,7 @@
{
PyErr_SetString(PyExc_TypeError,
"offset should be a floating point value");
- return NULL;
+ return false;
}
}
@@ -451,7 +661,7 @@
{
PyErr_SetString(PyExc_TypeError,
"dashes should be a tuple or a list");
- return NULL;
+ return false;
}
int n = PyTuple_GET_SIZE(dashes);
int i;
@@ -460,7 +670,7 @@
{
PyErr_SetString(PyExc_MemoryError, "Failed to store dashes");
Py_DECREF(dashes);
- return NULL;
+ return false;
}
for (i = 0; i < n; i++)
{
@@ -476,7 +686,7 @@
{
free(lengths);
PyErr_SetString(PyExc_TypeError, "Failed to read dashes");
- return NULL;
+ return false;
}
CGContextSetLineDash(cr, phase, lengths, n);
free(lengths);
@@ -484,29 +694,40 @@
else
CGContextSetLineDash(cr, phase, NULL, 0);
- Py_INCREF(Py_None);
- return Py_None;
+ return true;
}
static PyObject*
-GraphicsContext_set_foreground(GraphicsContext* self, PyObject* args, PyObject* keywords)
-{ float r, g, b;
- PyObject* fg;
- int isRGB = 0;
- static char* kwlist[] = {"fg", "isRGB", NULL};
- if(!PyArg_ParseTupleAndKeywords(args, keywords, "O|i", kwlist,
- &fg, &isRGB)) return NULL;
- if (isRGB)
+GraphicsContext_set_dashes (GraphicsContext* self, PyObject* args)
+{
+ PyObject* offset;
+ PyObject* dashes;
+
+ if (!PyArg_ParseTuple(args, "OO", &offset, &dashes)) return NULL;
+
+ CGContextRef cr = self->cr;
+ if (!cr)
{
- if(!PyArg_ParseTuple(fg, "fff", &r, &g, &b)) return NULL;
+ PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
+ return NULL;
}
+
+ BOOL ok = _set_dashes(cr, offset, dashes);
+ if (ok)
+ {
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
else
- { fg = PyObject_CallFunctionObjArgs(self->converter, fg, NULL);
- if(!fg) return NULL;
- if(!PyArg_ParseTuple(fg, "fff", &r, &g, &b)) return NULL;
- Py_DECREF(fg);
- }
+ return NULL;
+}
+static PyObject*
+GraphicsContext_set_foreground(GraphicsContext* self, PyObject* args)
+{
+ float r, g, b;
+ if(!PyArg_ParseTuple(args, "(fff)", &r, &g, &b)) return NULL;
+
CGContextRef cr = self->cr;
if (!cr)
{
@@ -538,7 +759,7 @@
return Py_None;
}
-static void drawHatch (void *info, CGContextRef cr)
+static void _draw_hatch (void *info, CGContextRef cr)
{
int i;
@@ -603,12 +824,20 @@
Py_DECREF(string);
}
+static void _release_hatch(void* info)
+{
+ PyObject* hatches = info;
+ Py_DECREF(hatches);
+}
+
static PyObject*
GraphicsContext_set_hatch(GraphicsContext* self, PyObject* args)
{ PyObject* hatches;
const float size = 12.0;
- static const CGPatternCallbacks callbacks = {0, &drawHatch, NULL};
+ static const CGPatternCallbacks callbacks = {0,
+ &_draw_hatch,
+ &_release_hatch};
CGContextRef cr = self->cr;
if (!cr)
@@ -687,122 +916,828 @@
return Py_None;
}
-static PyObject*
-GraphicsContext_moveto(GraphicsContext* self, PyObject* args)
-{
- float x;
- float y;
-
- if(!PyArg_ParseTuple(args, "(ff)", &x, &y)) return NULL;
-
- CGContextRef cr = self->cr;
- if (!cr)
+static int
+_convert_affine_transform(PyObject* object, CGAffineTransform* transform)
+/* Reads a Numpy affine transformation matrix and returns
+ * a CGAffineTransform.
+ */
+{
+ PyArrayObject* matrix = NULL;
+ if (object==Py_None)
{
- PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
- return NULL;
+ PyErr_SetString(PyExc_ValueError,
+ "Found affine transformation matrix equal to None");
+ return 0;
}
- CGContextMoveToPoint(cr, x, y);
+ matrix = (PyArrayObject*) PyArray_FromObject(object, NPY_DOUBLE, 2, 2);
+ if (!matrix)
+ {
+ PyErr_SetString(PyExc_ValueError,
+ "Invalid affine transformation matrix");
+ return 0;
+ }
+ if (PyArray_NDIM(matrix) != 2 || PyArray_DIM(matrix, 0) != 3 || PyArray_DIM(matrix, 1) != 3)
+ {
+ Py_DECREF(matrix);
+ PyErr_SetString(PyExc_ValueError,
+ "Affine transformation matrix has invalid dimensions");
+ return 0;
+ }
- Py_INCREF(Py_None);
- return Py_None;
+ size_t stride0 = (size_t)PyArray_STRIDE(matrix, 0);
+ size_t stride1 = (size_t)PyArray_STRIDE(matrix, 1);
+ char* row0 = PyArray_BYTES(matrix);
+ char* row1 = row0 + stride0;
+
+ double a = *(double*)(row0);
+ row0 += stride1;
+ double c = *(double*)(row0);
+ row0 += stride1;
+ double e = *(double*)(row0);
+ double b = *(double*)(row1);
+ row1 += stride1;
+ double d = *(double*)(row1);
+ row1 += stride1;
+ double f = *(double*)(row1);
+ *transform = CGAffineTransformMake(a, b, c, d, e, f);
+
+ Py_DECREF(matrix);
+ return 1;
}
-static PyObject*
-GraphicsContext_lineto(GraphicsContext* self, PyObject* args)
+static int
+_draw_path(CGContextRef cr, PyObject* path, CGAffineTransform affine)
{
- float x;
- float y;
+ CGPoint point;
- if(!PyArg_ParseTuple(args, "(ff)", &x, &y)) return NULL;
+ PyObject* vertices = PyObject_GetAttrString(path, "vertices");
+ if (vertices==NULL)
+ {
+ PyErr_SetString(PyExc_AttributeError, "path has no vertices");
+ return -1;
+ }
+ Py_DECREF(vertices); /* Don't keep a reference here */
- CGContextRef cr = self->cr;
- if (!cr)
+ PyObject* codes = PyObject_GetAttrString(path, "codes");
+ if (codes==NULL)
{
- PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
- return NULL;
+ PyErr_SetString(PyExc_AttributeError, "path has no codes");
+ return -1;
}
- CGContextAddLineToPoint(cr, x, y);
+ Py_DECREF(codes); /* Don't keep a reference here */
- Py_INCREF(Py_None);
- return Py_None;
+ PyArrayObject* coordinates;
+ coordinates = (PyArrayObject*)PyArray_FromObject(vertices,
+ NPY_DOUBLE, 2, 2);
+ if (!coordinates)
+ {
+ PyErr_SetString(PyExc_ValueError, "failed to convert vertices array");
+ return -1;
+ }
+
+ if (PyArray_NDIM(coordinates) != 2 || PyArray_DIM(coordinates, 1) != 2)
+ {
+ Py_DECREF(coordinates);
+ PyErr_SetString(PyExc_ValueError, "invalid vertices array");
+ return -1;
+ }
+
+ npy_intp n = PyArray_DIM(coordinates, 0);
+
+ if (n==0) /* Nothing to do here */
+ {
+ Py_DECREF(coordinates);
+ return 0;
+ }
+
+ PyArrayObject* codelist = NULL;
+ if (codes != Py_None)
+ {
+ codelist = (PyArrayObject*)PyArray_FromObject(codes,
+ NPY_UINT8, 1, 1);
+ if (!codelist)
+ {
+ Py_DECREF(coordinates);
+ PyErr_SetString(PyExc_ValueError, "invalid codes array");
+ return -1;
+ }
+ }
+
+ if (codelist==NULL)
+ {
+ npy_intp i;
+ npy_uint8 code = MOVETO;
+ for (i = 0; i < n; i++)
+ {
+ point.x = (CGFloat)(*(double*)PyArray_GETPTR2(coordinates, i, 0));
+ point.y = (CGFloat)(*(double*)PyArray_GETPTR2(coordinates, i, 1));
+ if (isnan(point.x) || isnan(point.y))
+ {
+ code = MOVETO;
+ }
+ else
+ {
+ point = CGPointApplyAffineTransform(point, affine);
+ switch (code)
+ {
+ case MOVETO:
+ CGContextMoveToPoint(cr, point.x, point.y);
+ break;
+ case LINETO:
+ CGContextAddLineToPoint(cr, point.x, point.y);
+ break;
+ }
+ code = LINETO;
+ }
+ }
+ }
+ else
+ {
+ npy_intp i = 0;
+ BOOL was_nan = false;
+ npy_uint8 code;
+ CGFloat x1, y1, x2, y2, x3, y3;
+ while (i < n)
+ {
+ code = *(npy_uint8*)PyArray_GETPTR1(codelist, i);
+ if (code == CLOSEPOLY)
+ {
+ CGContextClosePath(cr);
+ i++;
+ }
+ else if (code == STOP)
+ {
+ break;
+ }
+ else if (was_nan)
+ {
+ if (code==CURVE3) i++;
+ else if (code==CURVE4) i+=2;
+ x1 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 0));
+ y1 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 1));
+ i++;
+ if (isnan(x1) || isnan(y1))
+ {
+ was_nan = true;
+ }
+ else
+ {
+ point.x = x1;
+ point.y = y1;
+ point = CGPointApplyAffineTransform(point, affine);
+ CGContextMoveToPoint(cr, point.x, point.y);
+ was_nan = false;
+ }
+ }
+ else if (code==MOVETO)
+ {
+ x1 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 0));
+ y1 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 1));
+ i++;
+ if (isnan(x1) || isnan(y1))
+ {
+ was_nan = true;
+ }
+ else
+ {
+ point.x = x1;
+ point.y = y1;
+ point = CGPointApplyAffineTransform(point, affine);
+ CGContextMoveToPoint(cr, point.x, point.y);
+ was_nan = false;
+ }
+ }
+ else if (code==LINETO)
+ {
+ x1 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 0));
+ y1 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 1));
+ i++;
+ if (isnan(x1) || isnan(y1))
+ {
+ was_nan = true;
+ }
+ else
+ {
+ point.x = x1;
+ point.y = y1;
+ point = CGPointApplyAffineTransform(point, affine);
+ CGContextAddLineToPoint(cr, point.x, point.y);
+ was_nan = false;
+ }
+ }
+ else if (code==CURVE3)
+ {
+ x1 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 0));
+ y1 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 1));
+ i++;
+ x2 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 0));
+ y2 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 1));
+ i++;
+ if (isnan(x1) || isnan(y1) || isnan(x2) || isnan(y2))
+ {
+ was_nan = true;
+ }
+ else
+ {
+ point.x = x1;
+ point.y = y1;
+ point = CGPointApplyAffineTransform(point, affine);
+ x1 = point.x;
+ y1 = point.y;
+ point.x = x2;
+ point.y = y2;
+ point = CGPointApplyAffineTransform(point, affine);
+ x2 = point.x;
+ y2 = point.y;
+ CGContextAddQuadCurveToPoint(cr, x1, y1, x2, y2);
+ was_nan = false;
+ }
+ }
+ else if (code==CURVE4)
+ {
+ x1 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 0));
+ y1 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 1));
+ i++;
+ x2 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 0));
+ y2 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 1));
+ i++;
+ x3 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 0));
+ y3 = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 1));
+ i++;
+ if (isnan(x1) || isnan(y1) || isnan(x2) || isnan(y2) || isnan(x3) || isnan(y3))
+ {
+ was_nan = true;
+ }
+ else
+ {
+ point.x = x1;
+ point.y = y1;
+ point = CGPointApplyAffineTransform(point, affine);
+ x1 = point.x;
+ y1 = point.y;
+ point.x = x2;
+ point.y = y2;
+ point = CGPointApplyAffineTransform(point, affine);
+ x2 = point.x;
+ y2 = point.y;
+ point.x = x3;
+ point.y = y3;
+ point = CGPointApplyAffineTransform(point, affine);
+ x3 = point.x;
+ y3 = point.y;
+ CGContextAddCurveToPoint(cr, x1, y1, x2, y2, x3, y3);
+ was_nan = false;
+ }
+ }
+ }
+ }
+
+ Py_DECREF(coordinates);
+ Py_XDECREF(codelist);
+ return n;
}
static PyObject*
-GraphicsContext_curve3(GraphicsContext* self, PyObject* args)
-{
- float cpx;
- float cpy;
- float x;
- float y;
+GraphicsContext_draw_path (GraphicsContext* self, PyObject* args)
+{
+ PyObject* path;
+ PyObject* transform;
+ PyObject* rgbFace;
+ int ok;
+
CGContextRef cr = self->cr;
+
if (!cr)
{
PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
return NULL;
}
- if(!PyArg_ParseTuple(args, "(ffff)", &cpx,
- &cpy,
- &x,
- &y)) return NULL;
+ if(!PyArg_ParseTuple(args, "OO|O",
+ &path,
+ &transform,
+ &rgbFace)) return NULL;
- CGContextAddQuadCurveToPoint(cr, cpx, cpy, x, y);
+ if(rgbFace==Py_None) rgbFace = NULL;
+ CGAffineTransform affine;
+ ok = _convert_affine_transform(transform, &affine);
+ if (!ok) return NULL;
+
+ int n = _draw_path(cr, path, affine);
+ if (n==-1) return NULL;
+
+ if (n > 0)
+ {
+ if(rgbFace)
+ {
+ float r, g, b;
+ ok = PyArg_ParseTuple(rgbFace, "fff", &r, &g, &b);
+ if (!ok)
+ {
+ return NULL;
+ }
+ CGContextSaveGState(cr);
+ if(self->pattern)
+ {
+ float components[4];
+ components[0] = r;
+ components[1] = g;
+ components[2] = b;
+ components[3] = 1.0;
+ CGContextSetFillPattern(cr, self->pattern, components);
+ CGPatternRelease(self->pattern);
+ self->pattern = nil;
+ }
+ else CGContextSetRGBFillColor(cr, r, g, b, 1.0);
+ CGContextDrawPath(cr, kCGPathFillStroke);
+ CGContextRestoreGState(cr);
+ }
+ else CGContextStrokePath(cr);
+ }
+
Py_INCREF(Py_None);
return Py_None;
}
static PyObject*
-GraphicsContext_curve4 (GraphicsContext* self, PyObject* args)
+GraphicsContext_draw_markers (GraphicsContext* self, PyObject* args)
{
- float cp1x;
- float cp1y;
- float cp2x;
- float cp2y;
- float x;
- float y;
+ PyObject* marker_path;
+ PyObject* marker_transform;
+ PyObject* path;
+ PyObject* transform;
+ PyObject* rgbFace;
+ int ok;
+ float r, g, b;
+
CGContextRef cr = self->cr;
+
if (!cr)
{
PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
return NULL;
}
- if(!PyArg_ParseTuple(args, "(ffffff)", &cp1x,
- &cp1y,
- &cp2x,
- &cp2y,
- &x,
- &y)) return NULL;
+ if(!PyArg_ParseTuple(args, "OOOO|O",
+ &marker_path,
+ &marker_transform,
+ &path,
+ &transform,
+ &rgbFace)) return NULL;
- CGContextAddCurveToPoint(cr, cp1x, cp1y, cp2x, cp2y, x, y);
+ if(rgbFace==Py_None) rgbFace = NULL;
+ if (rgbFace)
+ {
+ ok = PyArg_ParseTuple(rgbFace, "fff", &r, &g, &b);
+ if (!ok)
+ {
+ return NULL;
+ }
+ if(self->pattern)
+ {
+ float components[4];
+ components[0] = r;
+ components[1] = g;
+ components[2] = b;
+ components[3] = 1.0;
+ CGContextSetFillPattern(cr, self->pattern, components);
+ CGPatternRelease(self->pattern);
+ self->pattern = nil;
+ }
+ else CGContextSetRGBFillColor(cr, r, g, b, 1.0);
+ }
+
+ CGAffineTransform affine;
+ ok = _convert_affine_transform(transform, &affine);
+ if (!ok) return NULL;
+
+ CGAffineTransform marker_affine;
+ ok = _convert_affine_transform(marker_transform, &marker_affine);
+ if (!ok) return NULL;
+
+ PyObject* vertices = PyObject_GetAttrString(path, "vertices");
+ if (vertices==NULL)
+ {
+ PyErr_SetString(PyExc_AttributeError, "path has no vertices");
+ return NULL;
+ }
+ Py_DECREF(vertices); /* Don't keep a reference here */
+
+ PyArrayObject* coordinates;
+ coordinates = (PyArrayObject*)PyArray_FromObject(vertices,
+ NPY_DOUBLE, 2, 2);
+ if (!coordinates)
+ {
+ PyErr_SetString(PyExc_ValueError, "failed to convert vertices array");
+ return NULL;
+ }
+
+ if (PyArray_NDIM(coordinates) != 2 || PyArray_DIM(coordinates, 1) != 2)
+ {
+ Py_DECREF(coordinates);
+ PyErr_SetString(PyExc_ValueError, "invalid vertices array");
+ return NULL;
+ }
+
+ npy_intp i;
+ npy_intp n = PyArray_DIM(coordinates, 0);
+ CGPoint point;
+ CGAffineTransform t;
+ int m = 0;
+ for (i = 0; i < n; i++)
+ {
+ point.x = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 0));
+ point.y = (CGFloat) (*(double*)PyArray_GETPTR2(coordinates, i, 1));
+ point = CGPointApplyAffineTransform(point, affine);
+ t = marker_affine;
+ t.tx += point.x;
+ t.ty += point.y;
+ m = _draw_path(cr, marker_path, t);
+
+ if (m > 0)
+ {
+ if(rgbFace) CGContextDrawPath(cr, kCGPathFillStroke);
+ else CGContextStrokePath(cr);
+ }
+ }
+
+ Py_DECREF(coordinates);
+
Py_INCREF(Py_None);
return Py_None;
}
+static BOOL _clip(CGContextRef cr, PyObject* object)
+{
+ if (object == Py_None) return true;
+
+ PyArrayObject* array = NULL;
+ array = (PyArrayObject*) PyArray_FromObject(object, PyArray_DOUBLE, 2, 2);
+ if (!array)
+ {
+ PyErr_SetString(PyExc_ValueError, "failed to read clipping bounding box");
+ return false;
+ }
+
+ if (PyArray_NDIM(array)!=2 || PyArray_DIM(array, 0)!=2 || PyArray_DIM(array, 1)!=2)
+ {
+ Py_DECREF(array);
+ PyErr_SetString(PyExc_ValueError, "clipping bounding box should be a 2x2 array");
+ return false;
+ }
+
+ const double l = *(double*)PyArray_GETPTR2(array, 0, 0);
+ const double b = *(double*)PyArray_GETPTR2(array, 0, 1);
+ const double r = *(double*)PyArray_GETPTR2(array, 1, 0);
+ const double t = *(double*)PyArray_GETPTR2(array, 1, 1);
+
+ Py_DECREF(array);
+
+ CGRect rect;
+ rect.origin.x = (CGFloat) l;
+ rect.origin.y = (CGFloat) b;
+ rect.size.width = (CGFloat) (r-l);
+ rect.size.height = (CGFloat) (t-b);
+
+ CGContextClipToRect(cr, rect);
+
+ return true;
+}
+
+
static PyObject*
-GraphicsContext_closepoly (GraphicsContext* self)
+GraphicsContext_draw_path_collection (GraphicsContext* self, PyObject* args)
{
+ PyObject* master_transform_obj;
+ PyObject* cliprect;
+ PyObject* clippath;
+ PyObject* clippath_transform;
+ PyObject* paths;
+ PyObject* transforms_obj;
+ PyObject* offsets_obj;
+ PyObject* offset_transform_obj;
+ PyObject* facecolors_obj;
+ PyObject* edgecolors_obj;
+ PyObject* linewidths;
+ PyObject* linestyles;
+ PyObject* antialiaseds;
+
CGContextRef cr = self->cr;
+
if (!cr)
{
PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
return NULL;
}
- CGContextClosePath(cr);
+ if(!PyArg_ParseTuple(args, "OOOOOOOOOOOOO", &master_transform_obj,
+ &cliprect,
+ &clippath,
+ &clippath_transform,
+ &paths,
+ &transforms_obj,
+ &offsets_obj,
+ &offset_transform_obj,
+ &facecolors_obj,
+ &edgecolors_obj,
+ &linewidths,
+ &linestyles,
+ &antialiaseds))
+ return NULL;
+ CGContextSaveGState(cr);
+
+ CGAffineTransform transform;
+ CGAffineTransform master_transform;
+ CGAffineTransform offset_transform;
+ CGAffineTransform* transforms = NULL;
+
+ if (!_convert_affine_transform(master_transform_obj, &master_transform)) return NULL;
+ if (!_convert_affine_transform(offset_transform_obj, &offset_transform)) return NULL;
+
+ if (!_clip(cr, cliprect)) return NULL;
+ if (clippath!=Py_None)
+ {
+ if (!_convert_affine_transform(clippath_transform, &transform)) return NULL;
+ int n = _draw_path(cr, clippath, transform);
+ if (n==-1) return NULL;
+ else if (n > 0) CGContextClip(cr);
+ }
+
+ PyArrayObject* offsets = NULL;
+ PyArrayObject* facecolors = NULL;
+ PyArrayObject* edgecolors = NULL;
+
+ /* ------------------- Check offsets array ---------------------------- */
+
+ offsets = (PyArrayObject*)PyArray_FromObject(offsets_obj, NPY_DOUBLE, 0, 2);
+ if (!offsets ||
+ (PyArray_NDIM(offsets)==2 && PyArray_DIM(offsets, 1)!=2) ||
+ (PyArray_NDIM(offsets)==1 && PyArray_DIM(offsets, 0)!=0))
+ {
+ PyErr_SetString(PyExc_ValueError, "Offsets array must be Nx2");
+ goto error;
+ }
+
+ /* ------------------- Check facecolors array ------------------------- */
+
+ facecolors = (PyArrayObject*)PyArray_FromObject(facecolors_obj,
+ NPY_DOUBLE, 1, 2);
+ if (!facecolors ||
+ (PyArray_NDIM(facecolors)==1 && PyArray_DIM(facecolors, 0)!=0) ||
+ (PyArray_NDIM(facecolors)==2 && PyArray_DIM(facecolors, 1)!=4))
+ {
+ PyErr_SetString(PyExc_ValueError, "Facecolors must by a Nx4 numpy array or empty");
+ goto error;
+ }
+
+ /* ------------------- Check edgecolors array ------------------------- */
+
+ edgecolors = (PyArrayObject*)PyArray_FromObject(edgecolors_obj,
+ NPY_DOUBLE, 1, 2);
+ if (!edgecolors ||
+ (PyArray_NDIM(edgecolors)==1 && PyArray_DIM(edgecolors, 0)!=0) ||
+ (PyArray_NDIM(edgecolors)==2 && PyArray_DIM(edgecolors, 1)!=4))
+ {
+ PyErr_SetString(PyExc_ValueError, "Edgecolors must by a Nx4 numpy array or empty");
+ goto error;
+ }
+
+ /* ------------------- Check the other arguments ---------------------- */
+
+ if (!PySequence_Check(paths))
+ {
+ PyErr_SetString(PyExc_ValueError, "paths must be a sequence object");
+ goto error;
+ }
+ if (!PySequence_Check(transforms_obj))
+ {
+ PyErr_SetString(PyExc_ValueError, "transforms must be a sequence object");
+ goto error;
+ }
+ if (!PySequence_Check(linewidths))
+ {
+ PyErr_SetString(PyExc_ValueError, "linewidths must be a sequence object");
+ goto error;
+ }
+ if (!PySequence_Check(linestyles))
+ {
+ PyErr_SetString(PyExc_ValueError, "linestyles must be a sequence object");
+ goto error;
+ }
+ if (!PySequence_Check(antialiaseds))
+ {
+ PyErr_SetString(PyExc_ValueError, "antialiaseds must be a sequence object");
+ goto error;
+ }
+
+ size_t Npaths = (size_t) PySequence_Size(paths);
+ size_t Noffsets = (size_t) PyArray_DIM(offsets, 0);
+ size_t N = Npaths > Noffsets ? Npaths : Noffsets;
+ size_t Ntransforms = (size_t) PySequence_Size(transforms_obj);
+ size_t Nfacecolors = (size_t) PyArray_DIM(facecolors, 0);
+ size_t Nedgecolors = (size_t) PyArray_DIM(edgecolors, 0);
+ size_t Nlinewidths = (size_t) PySequence_Size(linewidths);
+ size_t Nlinestyles = (size_t) PySequence_Size(linestyles);
+ size_t Naa = (size_t) PySequence_Size(antialiaseds);
+ if (N < Ntransforms) Ntransforms = N;
+ if (N < Nlinestyles) Nlinestyles = N;
+ if ((Nfacecolors == 0 && Nedgecolors == 0) || Npaths == 0)
+ {
+ goto success;
+ }
+
+ size_t i = 0;
+
+ /* Convert all of the transforms up front */
+ if (Ntransforms > 0)
+ {
+ transforms = malloc(Ntransforms*sizeof(CGAffineTransform));
+ if (!transforms) goto error;
+ for (i = 0; i < Ntransforms; i++)
+ {
+ PyObject* transform_obj = PySequence_ITEM(transforms_obj, i);
+ if(!_convert_affine_transform(transform_obj, &transforms[i])) goto error;
+ transforms[i] = CGAffineTransformConcat(transforms[i], master_transform);
+ }
+ }
+
+ CGPoint offset;
+ PyObject* path;
+
+ /* Preset graphics context properties if possible */
+ if (Naa==1)
+ {
+ switch(PyObject_IsTrue(PySequence_ITEM(antialiaseds, 0)))
+ {
+ case 1: CGContextSetShouldAntialias(cr, true); break;
+ case 0: CGContextSetShouldAntialias(cr, false); break;
+ case -1:
+ {
+ PyErr_SetString(PyExc_ValueError,
+ "Failed to read antialiaseds array");
+ goto error;
+ }
+ }
+ }
+
+ if (Nlinewidths==1)
+ {
+ double linewidth = PyFloat_AsDouble(PySequence_ITEM(linewidths, 0));
+ CGContextSetLineWidth(cr, (CGFloat)linewidth);
+ }
+ else if (Nlinewidths==0)
+ CGContextSetLineWidth(cr, 0.0);
+
+ if (Nlinestyles==1)
+ {
+ PyObject* offset;
+ PyObject* dashes;
+ PyObject* linestyle = PySequence_ITEM(linestyles, 0);
+ if (!PyArg_ParseTuple(linestyle, "OO", &offset, &dashes)) goto error;
+ if (!_set_dashes(cr, offset, dashes)) goto error;
+ }
+
+ if (Nedgecolors==1)
+ {
+ const double r = *(double*)PyArray_GETPTR2(edgecolors, 0, 0);
+ const double g = *(double*)PyArray_GETPTR2(edgecolors, 0, 1);
+ const double b = *(double*)PyArray_GETPTR2(edgecolors, 0, 2);
+ const double a = *(double*)PyArray_GETPTR2(edgecolors, 0, 3);
+ CGContextSetRGBStrokeColor(cr, r, g, b, a);
+ }
+
+ if (Nfacecolors==1)
+ {
+ const double r = *(double*)PyArray_GETPTR2(facecolors, 0, 0);
+ const double g = *(double*)PyArray_GETPTR2(facecolors, 0, 1);
+ const double b = *(double*)PyArray_GETPTR2(facecolors, 0, 2);
+ const double a = *(double*)PyArray_GETPTR2(facecolors, 0, 3);
+ CGContextSetRGBFillColor(cr, r, g, b, a);
+ }
+
+ for (i = 0; i < N; i++)
+ {
+
+ if (Ntransforms)
+ {
+ transform = transforms[i % Ntransforms];
+ }
+ else
+ {
+ transform = master_transform;
+ }
+
+ if (Noffsets)
+ {
+ offset.x = (CGFloat) (*(double*)PyArray_GETPTR2(offsets, i % Noffsets, 0));
+ offset.y = (CGFloat) (*(double*)PyArray_GETPTR2(offsets, i % Noffsets, 1));
+ offset = CGPointApplyAffineTransform(offset, offset_transform);
+ transform.tx += offset.x;
+ transform.ty += offset.y;
+ }
+
+ if (Naa > 1)
+ {
+ switch(PyObject_IsTrue(PySequence_ITEM(antialiaseds, i % Naa)))
+ {
+ case 1: CGContextSetShouldAntialias(cr, true); break;
+ case 0: CGContextSetShouldAntialias(cr, false); break;
+ case -1:
+ {
+ PyErr_SetString(PyExc_ValueError,
+ "Failed to read antialiaseds array");
+ goto error;
+ }
+ }
+ }
+
+ path = PySequence_ITEM(paths, i % Npaths);
+ int n = _draw_path(cr, path, transform);
+ if (n==-1) goto error;
+ else if (n==0) continue;
+
+ if (Nlinewidths > 1)
+ {
+ double linewidth = PyFloat_AsDouble(PySequence_ITEM(linewidths, i % Nlinewidths));
+ CGContextSetLineWidth(cr, (CGFloat)linewidth);
+ }
+
+ if (Nlinestyles > 1)
+ {
+ PyObject* offset;
+ PyObject* dashes;
+ PyObject* linestyle = PySequence_ITEM(linestyles, i % Nlinestyles);
+ if (!PyArg_ParseTuple(linestyle, "OO", &offset, &dashes)) goto error;
+ if (!_set_dashes(cr, offset, dashes)) goto error;
+ }
+
+ if (Nedgecolors > 1)
+ {
+ npy_intp fi = i % Nedgecolors;
+ const double r = *(double*)PyArray_GETPTR2(edgecolors, fi, 0);
+ const double g = *(double*)PyArray_GETPTR2(edgecolors, fi, 1);
+ const double b = *(double*)PyArray_GETPTR2(edgecolors, fi, 2);
+ const double a = *(double*)PyArray_GETPTR2(edgecolors, fi, 3);
+ CGContextSetRGBStrokeColor(cr, r, g, b, a);
+ }
+
+ if (Nfacecolors > 1)
+ {
+ npy_intp fi = i % Nfacecolors;
+ const double r = *(double*)PyArray_GETPTR2(facecolors, fi, 0);
+ const double g = *(double*)PyArray_GETPTR2(facecolors, fi, 1);
+ const double b = *(double*)PyArray_GETPTR2(facecolors, fi, 2);
+ const double a = *(double*)PyArray_GETPTR2(facecolors, fi, 3);
+ CGContextSetRGBFillColor(cr, r, g, b, a);
+ CGContextDrawPath(cr, kCGPathFillStroke);
+ }
+ else if (Nfacecolors==1)
+ CGContextDrawPath(cr, kCGPathFillStroke);
+ else
+ CGContextStrokePath(cr);
+ }
+
+success:
+ CGContextRestoreGState(cr);
+ if (transforms) free(transforms);
+ Py_DECREF(offsets);
+ Py_DECREF(facecolors);
+ Py_DECREF(edgecolors);
+
Py_INCREF(Py_None);
return Py_None;
+
+error:
+ CGContextRestoreGState(cr);
+ if (transforms) free(transforms);
+ Py_XDECREF(offsets);
+ Py_XDECREF(facecolors);
+ Py_XDECREF(edgecolors);
+
+ return NULL;
}
static PyObject*
-GraphicsContext_stroke (GraphicsContext* self, PyObject* args)
+GraphicsContext_draw_quad_mesh (GraphicsContext* self, PyObject* args)
{
- PyObject* color;
+ PyObject* master_transform_obj;
+ PyObject* cliprect;
+ PyObject* clippath;
+ PyObject* clippath_transform;
+ int meshWidth;
+ int meshHeight;
+ PyObject* vertices;
+ PyObject* offsets_obj;
+ PyObject* offset_transform_obj;
+ PyObject* facecolors_obj;
+ int antialiased;
+ int showedges;
+
CGContextRef cr = self->cr;
if (!cr)
@@ -811,35 +1746,219 @@
return NULL;
}
- if(!PyArg_ParseTuple(args, "O", &color)) return NULL;
+ if(!PyArg_ParseTuple(args, "OOOOiiOOOOii",
+ &master_transform_obj,
+ &cliprect,
+ &clippath,
+ &clippath_transform,
+ &meshWidth,
+ &meshHeight,
+ &vertices,
+ &offsets_obj,
+ &offset_transform_obj,
+ &facecolors_obj,
+ &antialiased,
+ &showedges)) return NULL;
- if(color!=Py_None)
+ PyArrayObject* offsets = NULL;
+ PyArrayObject* facecolors = NULL;
+
+ CGAffineTransform transform;
+ CGAffineTransform master_transform;
+ CGAffineTransform offset_transform;
+
+ if (!_convert_affine_transform(master_transform_obj, &master_transform))
+ return NULL;
+ if (!_convert_affine_transform(offset_transform_obj, &offset_transform))
+ return NULL;
+
+ /* clipping */
+
+ if (!_clip(cr, cliprect)) return NULL;
+ if (clippath!=Py_None)
{
- float r, g, b;
- if(!PyArg_ParseTuple(color, "fff", &r, &g, &b)) return NULL;
- if(self->pattern)
+ if (!_convert_affine_transform(clippath_transform, &transform))
+ return NULL;
+ int n = _draw_path(cr, clippath, transform);
+ if (n==-1) return NULL;
+ else if (n > 0) CGContextClip(cr);
+ }
+
+ PyArrayObject* coordinates;
+ coordinates = (PyArrayObject*)PyArray_FromObject(vertices,
+ NPY_DOUBLE, 3, 3);
+ if (!coordinates ||
+ PyArray_NDIM(coordinates) != 3 || PyArray_DIM(coordinates, 2) != 2)
+ {
+ PyErr_SetString(PyExc_ValueError, "Invalid coordinates array");
+ goto error;
+ }
+
+ /* ------------------- Check offsets array ---------------------------- */
+
+ offsets = (PyArrayObject*)PyArray_FromObject(offsets_obj, NPY_DOUBLE, 0, 2);
+ if (!offsets ||
+ (PyArray_NDIM(offsets)==2 && PyArray_DIM(offsets, 1)!=2) ||
+ (PyArray_NDIM(offsets)==1 && PyArray_DIM(offsets, 0)!=0))
+ {
+ PyErr_SetString(PyExc_ValueError, "Offsets array must be Nx2");
+ goto error;
+ }
+
+ /* ------------------- Check facecolors array ------------------------- */
+
+ facecolors = (PyArrayObject*)PyArray_FromObject(facecolors_obj,
+ NPY_DOUBLE, 1, 2);
+ if (!facecolors ||
+ (PyArray_NDIM(facecolors)==1 && PyArray_DIM(facecolors, 0)!=0) ||
+ (PyArray_NDIM(facecolors)==2 && PyArray_DIM(facecolors, 1)!=4))
+ {
+ PyErr_SetString(PyExc_ValueError, "Facecolors must by a Nx4 numpy array or empty");
+ goto error;
+ }
+
+ /* ------------------- Check the other arguments ---------------------- */
+
+ size_t Noffsets = (size_t) PyArray_DIM(offsets, 0);
+ size_t Npaths = meshWidth * meshHeight;
+ size_t Nfacecolors = (size_t) PyArray_DIM(facecolors, 0);
+ if ((Nfacecolors == 0 && !showedges) || Npaths == 0)
+ {
+ /* Nothing to do here */
+ goto success;
+ }
+
+ size_t i = 0;
+ size_t iw = 0;
+ size_t ih = 0;
+
+ CGPoint offset;
+
+ /* Preset graphics context properties if possible */
+ if (antialiased) CGContextSetShouldAntialias(cr, true);
+ else CGContextSetShouldAntialias(cr, false);
+
+ CGContextSetLineWidth(cr, 0.0);
+
+ if (Nfacecolors==1)
+ {
+ const double r = *(double*)PyArray_GETPTR2(facecolors, 0, 0);
+ const double g = *(double*)PyArray_GETPTR2(facecolors, 0, 1);
+ const double b = *(double*)PyArray_GETPTR2(facecolors, 0, 2);
+ const double a = *(double*)PyArray_GETPTR2(facecolors, 0, 3);
+ CGContextSetRGBFillColor(cr, r, g, b, a);
+ if (antialiased && !showedges)
{
- float components[4];
- components[0] = r;
- components[1] = g;
- components[2] = b;
- components[3] = 1.0;
- CGContextSetFillPattern(cr, self->pattern, components);
- CGPatternRelease (self->pattern);
- self->pattern = nil;
+ CGContextSetRGBStrokeColor(cr, r, g, b, a);
}
- else CGContextSetRGBFillColor(cr, r, g, b, 1.0);
- CGContextDrawPath(cr, kCGPathFillStroke);
}
- else CGContextStrokePath(cr);
+ if (showedges)
+ {
+ CGContextSetRGBStrokeColor(cr, 0, 0, 0, 1);
+ }
+
+ for (ih = 0; ih < meshHeight; ih++)
+ {
+ for (iw = 0; iw < meshWidth; iw++, i++)
+ {
+
+ transform = master_transform;
+
+ if (Noffsets)
+ {
+ offset.x = (CGFloat) (*(double*)PyArray_GETPTR2(offsets, i % Noffsets, 0));
+ offset.y = (CGFloat) (*(double*)PyArray_GETPTR2(offsets, i % Noffsets, 1));
+ offset = CGPointApplyAffineTransform(offset, offset_transform);
+ transform.tx += offset.x;
+ transform.ty += offset.y;
+ }
+
+ CGPoint p;
+ CGPoint points[4];
+
+ p.x = (CGFloat)(*(double*)PyArray_GETPTR3(coordinates, ih, iw, 0));
+ p.y = (CGFloat)(*(double*)PyArray_GETPTR3(coordinates, ih, iw, 1));
+ if (isnan(p.x) || isnan(p.y)) continue;
+ points[0] = CGPointApplyAffineTransform(p, transform);
+
+ p.x = (CGFloat)(*(double*)PyArray_GETPTR3(coordinates, ih, iw+1, 0));
+ p.y = (CGFloat)(*(double*)PyArray_GETPTR3(coordinates, ih, iw+1, 1));
+ if (isnan(p.x) || isnan(p.y)) continue;
+ points[1] = CGPointApplyAffineTransform(p, transform);
+
+ p.x = (CGFloat)(*(double*)PyArray_GETPTR3(coordinates, ih+1, iw+1, 0));
+ p.y = (CGFloat)(*(double*)PyArray_GETPTR3(coordinates, ih+1, iw+1, 1));
+ if (isnan(p.x) || isnan(p.y)) continue;
+ points[2] = CGPointApplyAffineTransform(p, transform);
+
+ p.x = (CGFloat)(*(double*)PyArray_GETPTR3(coordinates, ih+1, iw, 0));
+ p.y = (CGFloat)(*(double*)PyArray_GETPTR3(coordinates, ih+1, iw, 1));
+ if (isnan(p.x) || isnan(p.y)) continue;
+ points[3] = CGPointApplyAffineTransform(p, transform);
+
+ CGContextMoveToPoint(cr, points[3].x, points[3].y);
+ CGContextAddLines(cr, points, 4);
+
+ if (Nfacecolors > 1)
+ {
+ npy_intp fi = i % Nfacecolors;
+ const double r = *(double*)PyArray_GETPTR2(facecolors, fi, 0);
+ const double g = *(double*)PyArray_GETPTR2(facecolors, fi, 1);
+ const double b = *(double*)PyArray_GETPTR2(facecolors, fi, 2);
+ const double a = *(double*)PyArray_GETPTR2(facecolors, fi, 3);
+ CGContextSetRGBFillColor(cr, r, g, b, a);
+ if (showedges)
+ {
+ CGContextDrawPath(cr, kCGPathFillStroke);
+ }
+ else if (antialiased)
+ {
+ CGContextSetRGBStrokeColor(cr, r, g, b, a);
+ CGContextDrawPath(cr, kCGPathFillStroke);
+ }
+ else
+ {
+ CGContextFillPath(cr);
+ }
+ }
+ else if (Nfacecolors==1)
+ {
+ if (showedges || antialiased)
+ {
+ CGContextDrawPath(cr, kCGPathFillStroke);
+ }
+ else
+ {
+ CGContextFillPath(cr);
+ }
+ }
+ else if (showedges)
+ {
+ CGContextStrokePath(cr);
+ }
+ }
+ }
+
+success:
+ Py_DECREF(offsets);
+ Py_DECREF(facecolors);
+ Py_DECREF(coordinates);
+
Py_INCREF(Py_None);
return Py_None;
+
+error:
+ Py_XDECREF(offsets);
+ Py_XDECREF(facecolors);
+ Py_XDECREF(coordinates);
+ return NULL;
}
+
static ATSFontRef
setfont(CGContextRef cr, PyObject* family, float size, const char weight[],
- const char style[])
+ const ch...
[truncated message content] |
|
From: <lee...@us...> - 2008-12-18 09:02:15
|
Revision: 6659
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6659&view=rev
Author: leejjoon
Date: 2008-12-18 09:02:11 +0000 (Thu, 18 Dec 2008)
Log Message:
-----------
Merged revisions 6658 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_98_5_maint
........
r6658 | leejjoon | 2008-12-18 03:55:50 -0500 (Thu, 18 Dec 2008) | 1 line
fix dpi-dependent behavior of text bbox & annotate arrow
........
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/text.py
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Modified: svnmerge-integrated
- /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6653
+ /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6658
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-12-18 08:55:50 UTC (rev 6658)
+++ trunk/matplotlib/CHANGELOG 2008-12-18 09:02:11 UTC (rev 6659)
@@ -1,3 +1,6 @@
+2008-12-17 fix dpi-dependent behavior of text bbox and arrow in annotate
+ -JJL
+
2008-12-17 Add group id support in artist. Two examples which
demostrate svg filter are added. -JJL
Modified: trunk/matplotlib/lib/matplotlib/text.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/text.py 2008-12-18 08:55:50 UTC (rev 6658)
+++ trunk/matplotlib/lib/matplotlib/text.py 2008-12-18 09:02:11 UTC (rev 6659)
@@ -367,7 +367,8 @@
def update_bbox_position_size(self, renderer):
- """ Update the location and the size of the bbox. This method
+ """
+ Update the location and the size of the bbox. This method
should be used when the position and size of the bbox needs to
be updated before actually drawing the bbox.
"""
@@ -395,8 +396,8 @@
tr = mtransforms.Affine2D().rotate(theta)
tr = tr.translate(posx+x_box, posy+y_box)
self._bbox_patch.set_transform(tr)
- fontsize = renderer.points_to_pixels(self.get_size())
- self._bbox_patch.set_mutation_scale(fontsize)
+ fontsize_in_pixel = renderer.points_to_pixels(self.get_size())
+ self._bbox_patch.set_mutation_scale(fontsize_in_pixel)
#self._bbox_patch.draw(renderer)
else:
@@ -434,7 +435,8 @@
tr = mtransforms.Affine2D().rotate(theta)
tr = tr.translate(posx+x_box, posy+y_box)
self._bbox_patch.set_transform(tr)
- self._bbox_patch.set_mutation_scale(self.get_size())
+ fontsize_in_pixel = renderer.points_to_pixels(self.get_size())
+ self._bbox_patch.set_mutation_scale(fontsize_in_pixel)
self._bbox_patch.draw(renderer)
@@ -1563,6 +1565,7 @@
self.arrow_patch.set_positions((ox0, oy0), (ox1,oy1))
mutation_scale = d.pop("mutation_scale", self.get_size())
+ mutation_scale = renderer.points_to_pixels(mutation_scale)
self.arrow_patch.set_mutation_scale(mutation_scale)
if self._bbox_patch:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2008-12-18 08:55:53
|
Revision: 6658
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6658&view=rev
Author: leejjoon
Date: 2008-12-18 08:55:50 +0000 (Thu, 18 Dec 2008)
Log Message:
-----------
fix dpi-dependent behavior of text bbox & annotate arrow
Modified Paths:
--------------
branches/v0_98_5_maint/CHANGELOG
branches/v0_98_5_maint/lib/matplotlib/text.py
Modified: branches/v0_98_5_maint/CHANGELOG
===================================================================
--- branches/v0_98_5_maint/CHANGELOG 2008-12-17 23:37:18 UTC (rev 6657)
+++ branches/v0_98_5_maint/CHANGELOG 2008-12-18 08:55:50 UTC (rev 6658)
@@ -1,3 +1,6 @@
+2008-12-17 fix dpi-dependent behavior of text bbox and arrow in annotate
+ -JJL
+
2008-12-16 Another attempt to fix dpi-dependent behavior of Legend. -JJL
======================================================================
Modified: branches/v0_98_5_maint/lib/matplotlib/text.py
===================================================================
--- branches/v0_98_5_maint/lib/matplotlib/text.py 2008-12-17 23:37:18 UTC (rev 6657)
+++ branches/v0_98_5_maint/lib/matplotlib/text.py 2008-12-18 08:55:50 UTC (rev 6658)
@@ -367,7 +367,8 @@
def update_bbox_position_size(self, renderer):
- """ Update the location and the size of the bbox. This method
+ """
+ Update the location and the size of the bbox. This method
should be used when the position and size of the bbox needs to
be updated before actually drawing the bbox.
"""
@@ -395,8 +396,8 @@
tr = mtransforms.Affine2D().rotate(theta)
tr = tr.translate(posx+x_box, posy+y_box)
self._bbox_patch.set_transform(tr)
- fontsize = renderer.points_to_pixels(self.get_size())
- self._bbox_patch.set_mutation_scale(fontsize)
+ fontsize_in_pixel = renderer.points_to_pixels(self.get_size())
+ self._bbox_patch.set_mutation_scale(fontsize_in_pixel)
#self._bbox_patch.draw(renderer)
else:
@@ -434,7 +435,8 @@
tr = mtransforms.Affine2D().rotate(theta)
tr = tr.translate(posx+x_box, posy+y_box)
self._bbox_patch.set_transform(tr)
- self._bbox_patch.set_mutation_scale(self.get_size())
+ fontsize_in_pixel = renderer.points_to_pixels(self.get_size())
+ self._bbox_patch.set_mutation_scale(fontsize_in_pixel)
self._bbox_patch.draw(renderer)
@@ -1557,6 +1559,7 @@
self.arrow_patch.set_positions((ox0, oy0), (ox1,oy1))
mutation_scale = d.pop("mutation_scale", self.get_size())
+ mutation_scale = renderer.points_to_pixels(mutation_scale)
self.arrow_patch.set_mutation_scale(mutation_scale)
if self._bbox_patch:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-12-17 23:37:27
|
Revision: 6657
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6657&view=rev
Author: jswhit
Date: 2008-12-17 23:37:18 +0000 (Wed, 17 Dec 2008)
Log Message:
-----------
fix docstring typo
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-12-17 23:00:03 UTC (rev 6656)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-12-17 23:37:18 UTC (rev 6657)
@@ -322,11 +322,11 @@
(size of y dimension / size of x dimension).
llcrnrlon longitude of lower left hand corner of the
selected map domain.
- llcrnrlon latitude of lower left hand corner of the
+ llcrnrlat latitude of lower left hand corner of the
selected map domain.
urcrnrlon longitude of upper right hand corner of the
selected map domain.
- urcrnrlon latitude of upper right hand corner of the
+ urcrnrlat latitude of upper right hand corner of the
selected map domain.
llcrnrx x value of lower left hand corner of the
selected map domain in map projection coordinates.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-12-17 23:00:07
|
Revision: 6656
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6656&view=rev
Author: jswhit
Date: 2008-12-17 23:00:03 +0000 (Wed, 17 Dec 2008)
Log Message:
-----------
regenerate with Cython 0.10.3
Modified Paths:
--------------
trunk/toolkits/basemap/src/_geod.c
trunk/toolkits/basemap/src/_geoslib.c
trunk/toolkits/basemap/src/_proj.c
Modified: trunk/toolkits/basemap/src/_geod.c
===================================================================
--- trunk/toolkits/basemap/src/_geod.c 2008-12-17 21:48:26 UTC (rev 6655)
+++ trunk/toolkits/basemap/src/_geod.c 2008-12-17 23:00:03 UTC (rev 6656)
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.9.8 on Fri Jun 13 14:28:31 2008 */
+/* Generated by Cython 0.10.3 on Wed Dec 17 15:57:33 2008 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
@@ -24,20 +24,22 @@
#if PY_VERSION_HEX < 0x02060000
#define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
- #define Py_SIZE(ob) ((PyVarObject*)(ob))->ob_size)
+ #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size)
#define PyVarObject_HEAD_INIT(type, size) \
PyObject_HEAD_INIT(type) size,
+ #define PyType_Modified(t)
typedef struct {
void *buf;
+ PyObject *obj;
Py_ssize_t len;
+ Py_ssize_t itemsize;
int readonly;
- const char *format;
int ndim;
+ char *format;
Py_ssize_t *shape;
Py_ssize_t *strides;
Py_ssize_t *suboffsets;
- Py_ssize_t itemsize;
void *internal;
} Py_buffer;
@@ -51,6 +53,7 @@
#define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
#define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
#define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
+
#endif
#if PY_MAJOR_VERSION < 3
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
@@ -61,6 +64,9 @@
#define Py_TPFLAGS_CHECKTYPES 0
#define Py_TPFLAGS_HAVE_INDEX 0
#endif
+#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
+ #define Py_TPFLAGS_HAVE_NEWBUFFER 0
+#endif
#if PY_MAJOR_VERSION >= 3
#define PyBaseString_Type PyUnicode_Type
#define PyString_Type PyBytes_Type
@@ -77,19 +83,24 @@
#define PyInt_AsSsize_t PyLong_AsSsize_t
#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
- #define PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
#else
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
#define PyBytes_Type PyString_Type
#endif
#if PY_MAJOR_VERSION >= 3
#define PyMethod_New(func, self, klass) PyInstanceMethod_New(func)
#endif
-#ifndef __stdcall
- #define __stdcall
+#if !defined(WIN32) && !defined(MS_WINDOWS)
+ #ifndef __stdcall
+ #define __stdcall
+ #endif
+ #ifndef __cdecl
+ #define __cdecl
+ #endif
+#else
+ #define _USE_MATH_DEFINES
#endif
-#ifndef __cdecl
- #define __cdecl
-#endif
#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
@@ -171,18 +182,27 @@
static const char *__pyx_filename;
static const char **__pyx_f;
-static INLINE void __Pyx_RaiseArgtupleTooLong(Py_ssize_t num_expected, Py_ssize_t num_found); /*proto*/
+static void __Pyx_RaiseDoubleKeywordsError(
+ const char* func_name, PyObject* kw_name); /*proto*/
+static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
+ Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
+
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/
+
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
+static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
+static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
static void __Pyx_AddTraceback(const char *funcname); /*proto*/
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
+
/* Type declarations */
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":5
@@ -203,40 +223,83 @@
/* Module declarations from _geod */
static PyTypeObject *__pyx_ptype_5_geod_Geod = 0;
+static PyObject *__pyx_k_12;
+static PyObject *__pyx_k_13;
+static PyObject *__pyx_k_14;
/* Implementation of _geod */
-
-static char __pyx_k_3[] = "1.8.6";
-
+static char __pyx_k_11[] = "1.8.6";
static char __pyx_k___cinit__[] = "__cinit__";
+static PyObject *__pyx_kp___cinit__;
static char __pyx_k___reduce__[] = "__reduce__";
+static PyObject *__pyx_kp___reduce__;
static char __pyx_k__fwd[] = "_fwd";
+static PyObject *__pyx_kp__fwd;
static char __pyx_k__inv[] = "_inv";
+static PyObject *__pyx_kp__inv;
static char __pyx_k__npts[] = "_npts";
-static char __pyx_k_math[] = "math";
+static PyObject *__pyx_kp__npts;
+static char __pyx_k_geodstring[] = "geodstring";
+static PyObject *__pyx_kp_geodstring;
+static char __pyx_k_lons[] = "lons";
+static PyObject *__pyx_kp_lons;
+static char __pyx_k_lats[] = "lats";
+static PyObject *__pyx_kp_lats;
+static char __pyx_k_az[] = "az";
+static PyObject *__pyx_kp_az;
+static char __pyx_k_dist[] = "dist";
+static PyObject *__pyx_kp_dist;
static char __pyx_k_radians[] = "radians";
-static char __pyx_k_1[] = "_dg2rad";
-static char __pyx_k_degrees[] = "degrees";
-static char __pyx_k_2[] = "_rad2dg";
-static char __pyx_k__doublesize[] = "_doublesize";
-static char __pyx_k___version__[] = "__version__";
-
-static PyObject *__pyx_kp___cinit__;
-static PyObject *__pyx_kp___reduce__;
-static PyObject *__pyx_kp__fwd;
-static PyObject *__pyx_kp__inv;
-static PyObject *__pyx_kp__npts;
-static PyObject *__pyx_kp_math;
static PyObject *__pyx_kp_radians;
+static char __pyx_k_1[] = "lons1";
static PyObject *__pyx_kp_1;
+static char __pyx_k_2[] = "lats1";
+static PyObject *__pyx_kp_2;
+static char __pyx_k_3[] = "lons2";
+static PyObject *__pyx_kp_3;
+static char __pyx_k_4[] = "lats2";
+static PyObject *__pyx_kp_4;
+static char __pyx_k_5[] = "lon1";
+static PyObject *__pyx_kp_5;
+static char __pyx_k_6[] = "lat1";
+static PyObject *__pyx_kp_6;
+static char __pyx_k_7[] = "lon2";
+static PyObject *__pyx_kp_7;
+static char __pyx_k_8[] = "lat2";
+static PyObject *__pyx_kp_8;
+static char __pyx_k_npts[] = "npts";
+static PyObject *__pyx_kp_npts;
+static char __pyx_k_math[] = "math";
+static PyObject *__pyx_kp_math;
+static char __pyx_k_9[] = "_dg2rad";
+static PyObject *__pyx_kp_9;
+static char __pyx_k_degrees[] = "degrees";
static PyObject *__pyx_kp_degrees;
-static PyObject *__pyx_kp_2;
+static char __pyx_k_10[] = "_rad2dg";
+static PyObject *__pyx_kp_10;
+static char __pyx_k__doublesize[] = "_doublesize";
static PyObject *__pyx_kp__doublesize;
+static char __pyx_k___version__[] = "__version__";
static PyObject *__pyx_kp___version__;
+static char __pyx_k_RuntimeError[] = "RuntimeError";
+static PyObject *__pyx_kp_RuntimeError;
+static char __pyx_k___class__[] = "__class__";
+static PyObject *__pyx_kp___class__;
+static char __pyx_k_ValueError[] = "ValueError";
+static PyObject *__pyx_kp_ValueError;
+static PyObject *__pyx_kp_11;
+static PyObject *__pyx_builtin_RuntimeError;
+static PyObject *__pyx_builtin_ValueError;
+static PyObject *__pyx_kp_15;
+static PyObject *__pyx_kp_16;
+static char __pyx_k_15[] = "Buffer lengths not the same";
+static char __pyx_k_16[] = "undefined forward geodesic (may be an equatorial arc)";
+static PyObject *__pyx_kp_17;
+static PyObject *__pyx_kp_18;
+static char __pyx_k_17[] = "Buffer lengths not the same";
+static char __pyx_k_18[] = "undefined inverse geodesic (may be an antipodal point)";
-static PyObject *__pyx_kp_3;
-
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":11
* cdef char *geodinitstring
*
@@ -245,12 +308,6 @@
* # setup geod initialization string.
*/
-static char __pyx_k_RuntimeError[] = "RuntimeError";
-
-static PyObject *__pyx_kp_RuntimeError;
-
-static PyObject *__pyx_builtin_RuntimeError;
-
static int __pyx_pf_5_geod_4Geod___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_5_geod_4Geod___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_geodstring = 0;
@@ -259,18 +316,37 @@
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
- static char *__pyx_argnames[] = {"geodstring",0};
- if (likely(!__pyx_kwds) && likely(PyTuple_GET_SIZE(__pyx_args) == 1)) {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_kp_geodstring,0};
+ if (unlikely(__pyx_kwds)) {
+ PyObject* values[1] = {0};
+ Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 0:
+ values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_geodstring);
+ if (likely(values[0])) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__new__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ __pyx_v_geodstring = values[0];
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+ goto __pyx_L5_argtuple_error;
+ } else {
__pyx_v_geodstring = PyTuple_GET_ITEM(__pyx_args, 0);
}
- else {
- if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_geodstring))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__new__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
__Pyx_AddTraceback("_geod.Geod.__cinit__");
return -1;
- __pyx_L3:;
+ __pyx_L4_argument_unpacking_done:;
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":14
* cdef GEODESIC_T GEOD_T
@@ -318,18 +394,18 @@
* self.proj_version = PJ_VERSION/100.
*
*/
- __pyx_2 = __Pyx_PyBytes_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = __Pyx_PyBytes_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
__pyx_2 = 0;
- __pyx_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L4;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L6;
}
- __pyx_L4:;
+ __pyx_L6:;
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":20
* if pj_errno != 0:
@@ -338,14 +414,14 @@
*
* def __reduce__(self):
*/
- __pyx_3 = PyFloat_FromDouble((PJ_VERSION / 100.)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyFloat_FromDouble((PJ_VERSION / 100.)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->proj_version);
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->proj_version = __pyx_3;
__pyx_3 = 0;
__pyx_r = 0;
goto __pyx_L0;
- __pyx_L1:;
+ __pyx_L1_error:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("_geod.Geod.__cinit__");
@@ -362,10 +438,6 @@
* return (self.__class__,(self.geodstring,))
*/
-static char __pyx_k___class__[] = "__class__";
-
-static PyObject *__pyx_kp___class__;
-
static PyObject *__pyx_pf_5_geod_4Geod___reduce__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_5_geod_4Geod___reduce__[] = "special method that allows pyproj.Geod instance to be pickled";
static PyObject *__pyx_pf_5_geod_4Geod___reduce__(PyObject *__pyx_v_self, PyObject *unused) {
@@ -381,11 +453,11 @@
*
* def _fwd(self, object lons, object lats, object az, object dist, radians=False):
*/
- __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp___class__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp___class__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_INCREF(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodstring);
PyTuple_SET_ITEM(__pyx_2, 0, ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodstring);
- __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
PyTuple_SET_ITEM(__pyx_3, 1, ((PyObject *)__pyx_2));
__pyx_1 = 0;
@@ -396,7 +468,7 @@
__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
- __pyx_L1:;
+ __pyx_L1_error:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
@@ -414,18 +486,6 @@
* forward transformation - determine longitude, latitude and back azimuth
*/
-static char __pyx_k_ValueError[] = "ValueError";
-
-static PyObject *__pyx_kp_ValueError;
-
-static PyObject *__pyx_kp_4;
-static PyObject *__pyx_kp_5;
-
-static PyObject *__pyx_builtin_ValueError;
-
-static char __pyx_k_4[] = "Buffer lengths not the same";
-static char __pyx_k_5[] = "undefined forward geodesic (may be an equatorial arc)";
-
static PyObject *__pyx_pf_5_geod_4Geod__fwd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5_geod_4Geod__fwd[] = "\n forward transformation - determine longitude, latitude and back azimuth \n of a terminus point given an initial point longitude and latitude, plus\n forward azimuth and distance.\n if radians=True, lons/lats are radians instead of degrees.\n ";
static PyObject *__pyx_pf_5_geod_4Geod__fwd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
@@ -453,29 +513,78 @@
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
- PyObject *__pyx_5 = 0;
- Py_ssize_t __pyx_6 = 0;
- double __pyx_7;
- int __pyx_8;
- static char *__pyx_argnames[] = {"lons","lats","az","dist","radians",0};
- __pyx_v_radians = Py_False;
- if (likely(!__pyx_kwds) && likely(4 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 5)) {
- __pyx_v_lons = PyTuple_GET_ITEM(__pyx_args, 0);
- __pyx_v_lats = PyTuple_GET_ITEM(__pyx_args, 1);
- __pyx_v_az = PyTuple_GET_ITEM(__pyx_args, 2);
- __pyx_v_dist = PyTuple_GET_ITEM(__pyx_args, 3);
- if (PyTuple_GET_SIZE(__pyx_args) > 4) {
+ Py_ssize_t __pyx_5 = 0;
+ double __pyx_6;
+ int __pyx_7;
+ PyObject *__pyx_t_1 = NULL;
+ static PyObject **__pyx_pyargnames[] = {&__pyx_kp_lons,&__pyx_kp_lats,&__pyx_kp_az,&__pyx_kp_dist,&__pyx_kp_radians,0};
+ __pyx_v_radians = __pyx_k_12;
+ if (unlikely(__pyx_kwds)) {
+ PyObject* values[5] = {0,0,0,0,0};
+ Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 0:
+ values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_lons);
+ if (likely(values[0])) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_lats);
+ if (likely(values[1])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("_fwd", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 2:
+ values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_az);
+ if (likely(values[2])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("_fwd", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 3:
+ values[3] = PyDict_GetItem(__pyx_kwds, __pyx_kp_dist);
+ if (likely(values[3])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("_fwd", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_fwd") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ __pyx_v_lons = values[0];
+ __pyx_v_lats = values[1];
+ __pyx_v_az = values[2];
+ __pyx_v_dist = values[3];
+ if (values[4]) {
+ __pyx_v_radians = values[4];
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 5:
__pyx_v_radians = PyTuple_GET_ITEM(__pyx_args, 4);
+ case 4:
+ __pyx_v_dist = PyTuple_GET_ITEM(__pyx_args, 3);
+ __pyx_v_az = PyTuple_GET_ITEM(__pyx_args, 2);
+ __pyx_v_lats = PyTuple_GET_ITEM(__pyx_args, 1);
+ __pyx_v_lons = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
}
}
- else {
- if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOO|O", __pyx_argnames, &__pyx_v_lons, &__pyx_v_lats, &__pyx_v_az, &__pyx_v_dist, &__pyx_v_radians))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("_fwd", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
__Pyx_AddTraceback("_geod.Geod._fwd");
return NULL;
- __pyx_L3:;
+ __pyx_L4_argument_unpacking_done:;
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":37
* cdef void *londata, *latdata, *azdat, *distdat
@@ -495,10 +604,10 @@
* raise RuntimeError
*/
__Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L4;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L6;
}
- __pyx_L4:;
+ __pyx_L6:;
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":39
* if PyObject_AsWriteBuffer(lons, &londata, &buflenlons) <> 0:
@@ -518,10 +627,10 @@
* raise RuntimeError
*/
__Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L7;
}
- __pyx_L5:;
+ __pyx_L7:;
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":41
* if PyObject_AsWriteBuffer(lats, &latdata, &buflenlats) <> 0:
@@ -541,10 +650,10 @@
* raise RuntimeError
*/
__Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L8;
}
- __pyx_L6:;
+ __pyx_L8:;
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":43
* if PyObject_AsWriteBuffer(az, &azdat, &buflenaz) <> 0:
@@ -564,10 +673,10 @@
* if not buflenlons == buflenlats == buflenaz == buflend:
*/
__Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L7;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L9;
}
- __pyx_L7:;
+ __pyx_L9:;
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":46
* raise RuntimeError
@@ -593,17 +702,17 @@
* ndim = buflenlons/_doublesize
* lonsdata = <double *>londata
*/
- __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_kp_4);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_4);
- __pyx_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_INCREF(__pyx_kp_15);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_15);
+ __pyx_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L8;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L10;
}
- __pyx_L8:;
+ __pyx_L10:;
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":48
* if not buflenlons == buflenlats == buflenaz == buflend:
@@ -612,14 +721,14 @@
* lonsdata = <double *>londata
* latsdata = <double *>latdata
*/
- __pyx_3 = PyInt_FromSsize_t(__pyx_v_buflenlons); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp__doublesize); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyNumber_Divide(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyInt_FromSsize_t(__pyx_v_buflenlons); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp__doublesize); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_3, __pyx_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_6 = __pyx_PyIndex_AsSsize_t(__pyx_5); if (unlikely((__pyx_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_v_ndim = __pyx_6;
+ __pyx_5 = __pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v_ndim = __pyx_5;
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":49
* raise RuntimeError("Buffer lengths not the same")
@@ -673,7 +782,7 @@
* self.geodesic_t.p1.v = lonsdata[i]
* self.geodesic_t.p1.u = latsdata[i]
*/
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_1) {
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":55
@@ -711,7 +820,7 @@
* self.geodesic_t.p1.v = _dg2rad*lonsdata[i]
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.DIST = (__pyx_v_distdata[__pyx_v_i]);
- goto __pyx_L11;
+ goto __pyx_L13;
}
/*else*/ {
@@ -722,14 +831,14 @@
* self.geodesic_t.p1.u = _dg2rad*latsdata[i]
* self.geodesic_t.ALPHA12 = _dg2rad*azdata[i]
*/
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyFloat_FromDouble((__pyx_v_lonsdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_9); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_4 = PyFloat_FromDouble((__pyx_v_lonsdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_7 = __pyx_PyFloat_AsDouble(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.v = __pyx_7;
+ __pyx_6 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.v = __pyx_6;
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":61
* else:
@@ -738,14 +847,14 @@
* self.geodesic_t.ALPHA12 = _dg2rad*azdata[i]
* self.geodesic_t.DIST = distdata[i]
*/
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyFloat_FromDouble((__pyx_v_latsdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_9); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_4 = PyFloat_FromDouble((__pyx_v_latsdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_7 = __pyx_PyFloat_AsDouble(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.u = __pyx_7;
+ __pyx_6 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.u = __pyx_6;
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":62
* self.geodesic_t.p1.v = _dg2rad*lonsdata[i]
@@ -754,14 +863,14 @@
* self.geodesic_t.DIST = distdata[i]
* geod_pre(&self.geodesic_t)
*/
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyFloat_FromDouble((__pyx_v_azdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_9); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_4 = PyFloat_FromDouble((__pyx_v_azdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_7 = __pyx_PyFloat_AsDouble(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA12 = __pyx_7;
+ __pyx_6 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA12 = __pyx_6;
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":63
* self.geodesic_t.p1.u = _dg2rad*latsdata[i]
@@ -772,7 +881,7 @@
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.DIST = (__pyx_v_distdata[__pyx_v_i]);
}
- __pyx_L11:;
+ __pyx_L13:;
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":64
* self.geodesic_t.ALPHA12 = _dg2rad*azdata[i]
@@ -800,18 +909,18 @@
* geod_for(&self.geodesic_t)
* if pj_errno != 0:
*/
- __pyx_3 = __Pyx_PyBytes_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = __Pyx_PyBytes_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
__pyx_3 = 0;
- __pyx_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
- __Pyx_Raise(__pyx_5, 0, 0);
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L12;
+ __Pyx_Raise(__pyx_3, 0, 0);
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L14;
}
- __pyx_L12:;
+ __pyx_L14:;
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":67
* if pj_errno != 0:
@@ -839,18 +948,18 @@
* if isnan(self.geodesic_t.ALPHA21):
* raise ValueError('undefined forward geodesic (may be an equatorial arc)')
*/
- __pyx_3 = __Pyx_PyBytes_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
- __pyx_3 = 0;
- __pyx_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
- __Pyx_Raise(__pyx_5, 0, 0);
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L13;
+ __pyx_4 = __Pyx_PyBytes_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4);
+ __pyx_4 = 0;
+ __pyx_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
+ __Pyx_Raise(__pyx_4, 0, 0);
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L15;
}
- __pyx_L13:;
+ __pyx_L15:;
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":70
* if pj_errno != 0:
@@ -859,8 +968,8 @@
* raise ValueError('undefined forward geodesic (may be an equatorial arc)')
* if radians:
*/
- __pyx_8 = isnan(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA21);
- if (__pyx_8) {
+ __pyx_7 = isnan(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA21);
+ if (__pyx_7) {
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":71
* raise RuntimeError(pj_strerrno(pj_errno))
@@ -869,17 +978,17 @@
* if radians:
* lonsdata[i] = self.geodesic_t.p2.v
*/
- __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_kp_5);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_5);
- __pyx_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_INCREF(__pyx_kp_16);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_16);
+ __pyx_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L14;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L16;
}
- __pyx_L14:;
+ __pyx_L16:;
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":72
* if isnan(self.geodesic_t.ALPHA21):
@@ -888,7 +997,7 @@
* lonsdata[i] = self.geodesic_t.p2.v
* latsdata[i] = self.geodesic_t.p2.u
*/
- __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_2) {
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":73
@@ -917,7 +1026,7 @@
* lonsdata[i] = _rad2dg*self.geodesic_t.p2.v
*/
(__pyx_v_azdata[__pyx_v_i]) = ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA21;
- goto __pyx_L15;
+ goto __pyx_L17;
}
/*else*/ {
@@ -928,14 +1037,14 @@
* latsdata[i] = _rad2dg*self.geodesic_t.p2.u
* azdata[i] = _rad2dg*self.geodesic_t.ALPHA21
*/
- __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.v); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyNumber_Multiply(__pyx_5, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_10); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_4 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.v); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_7 = __pyx_PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- (__pyx_v_lonsdata[__pyx_v_i]) = __pyx_7;
+ __pyx_6 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ (__pyx_v_lonsdata[__pyx_v_i]) = __pyx_6;
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":78
* else:
@@ -944,14 +1053,14 @@
* azdata[i] = _rad2dg*self.geodesic_t.ALPHA21
*
*/
- __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.u); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyNumber_Multiply(__pyx_5, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_10); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_4 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.u); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_7 = __pyx_PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- (__pyx_v_latsdata[__pyx_v_i]) = __pyx_7;
+ __pyx_6 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ (__pyx_v_latsdata[__pyx_v_i]) = __pyx_6;
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":79
* lonsdata[i] = _rad2dg*self.geodesic_t.p2.v
@@ -960,24 +1069,23 @@
*
* def _inv(self, object lons1, object lats1, object lons2, object lats2, radians=False):
*/
- __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA21); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyNumber_Multiply(__pyx_5, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_10); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_4 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA21); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- __pyx_7 = __pyx_PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- (__pyx_v_azdata[__pyx_v_i]) = __pyx_7;
+ __pyx_6 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ (__pyx_v_azdata[__pyx_v_i]) = __pyx_6;
}
- __pyx_L15:;
+ __pyx_L17:;
}
__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
- __pyx_L1:;
+ __pyx_L1_error:;
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
- Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("_geod.Geod._fwd");
__pyx_r = NULL;
__pyx_L0:;
@@ -992,12 +1100,6 @@
* inverse transformation - return forward and back azimuths, plus distance
*/
-static PyObject *__pyx_kp_6;
-static PyObject *__pyx_kp_7;
-
-static char __pyx_k_6[] = "Buffer lengths not the same";
-static char __pyx_k_7[] = "undefined inverse geodesic (may be an antipodal point)";
-
static PyObject *__pyx_pf_5_geod_4Geod__inv(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5_geod_4Geod__inv[] = "\n inverse transformation - return forward and back azimuths, plus distance\n between an initial and terminus lat/lon pair.\n if radians=True, lons/lats are radians instead of degrees.\n ";
static PyObject *__pyx_pf_5_geod_4Geod__inv(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
@@ -1025,29 +1127,78 @@
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
- PyObject *__pyx_5 = 0;
- Py_ssize_t __pyx_6 = 0;
- double __pyx_7;
- int __pyx_8;
- static char *__pyx_argnames[] = {"lons1","lats1","lons2","lats2","radians",0};
- __pyx_v_radians = Py_False;
- if (likely(!__pyx_kwds) && likely(4 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 5)) {
- __pyx_v_lons1 = PyTuple_GET_ITEM(__pyx_args, 0);
- __pyx_v_lats1 = PyTuple_GET_ITEM(__pyx_args, 1);
- __pyx_v_lons2 = PyTuple_GET_ITEM(__pyx_args, 2);
- __pyx_v_lats2 = PyTuple_GET_ITEM(__pyx_args, 3);
- if (PyTuple_GET_SIZE(__pyx_args) > 4) {
+ Py_ssize_t __pyx_5 = 0;
+ double __pyx_6;
+ int __pyx_7;
+ PyObject *__pyx_t_1 = NULL;
+ static PyObject **__pyx_pyargnames[] = {&__pyx_kp_1,&__pyx_kp_2,&__pyx_kp_3,&__pyx_kp_4,&__pyx_kp_radians,0};
+ __pyx_v_radians = __pyx_k_13;
+ if (unlikely(__pyx_kwds)) {
+ PyObject* values[5] = {0,0,0,0,0};
+ Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 0:
+ values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_1);
+ if (likely(values[0])) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_2);
+ if (likely(values[1])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("_inv", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 2:
+ values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_3);
+ if (likely(values[2])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("_inv", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 3:
+ values[3] = PyDict_GetItem(__pyx_kwds, __pyx_kp_4);
+ if (likely(values[3])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("_inv", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_inv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ __pyx_v_lons1 = values[0];
+ __pyx_v_lats1 = values[1];
+ __pyx_v_lons2 = values[2];
+ __pyx_v_lats2 = values[3];
+ if (values[4]) {
+ __pyx_v_radians = values[4];
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 5:
__pyx_v_radians = PyTuple_GET_ITEM(__pyx_args, 4);
+ case 4:
+ __pyx_v_lats2 = PyTuple_GET_ITEM(__pyx_args, 3);
+ __pyx_v_lons2 = PyTuple_GET_ITEM(__pyx_args, 2);
+ __pyx_v_lats1 = PyTuple_GET_ITEM(__pyx_args, 1);
+ __pyx_v_lons1 = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
}
}
- else {
- if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOO|O", __pyx_argnames, &__pyx_v_lons1, &__pyx_v_lats1, &__pyx_v_lons2, &__pyx_v_lats2, &__pyx_v_radians))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L2;}
- }
- goto __pyx_L3;
- __pyx_L2:;
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("_inv", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
__Pyx_AddTraceback("_geod.Geod._inv");
return NULL;
- __pyx_L3:;
+ __pyx_L4_argument_unpacking_done:;
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":91
* cdef void *londata, *latdata, *azdat, *distdat
@@ -1067,10 +1218,10 @@
* raise RuntimeError
*/
__Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L4;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L6;
}
- __pyx_L4:;
+ __pyx_L6:;
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":93
* if PyObject_AsWriteBuffer(lons1, &londata, &buflenlons) <> 0:
@@ -1090,10 +1241,10 @@
* raise RuntimeError
*/
__Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L7;
}
- __pyx_L5:;
+ __pyx_L7:;
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":95
* if PyObject_AsWriteBuffer(lats1, &latdata, &buflenlats) <> 0:
@@ -1113,10 +1264,10 @@
* raise RuntimeError
*/
__Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L6;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L8;
}
- __pyx_L6:;
+ __pyx_L8:;
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":97
* if PyObject_AsWriteBuffer(lons2, &azdat, &buflenaz) <> 0:
@@ -1136,10 +1287,10 @@
* if not buflenlons == buflenlats == buflenaz == buflend:
*/
__Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L7;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L9;
}
- __pyx_L7:;
+ __pyx_L9:;
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":100
* raise RuntimeError
@@ -1165,17 +1316,17 @@
* ndim = buflenlons/_doublesize
* lonsdata = <double *>londata
*/
- __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_kp_6);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_6);
- __pyx_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_INCREF(__pyx_kp_17);
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_17);
+ __pyx_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1;}
- goto __pyx_L8;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L10;
}
- __pyx_L8:;
+ __pyx_L10:;
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":102
* if not buflenlons == buflenlats == buflenaz == buflend:
@@ -1184,14 +1335,14 @@
* lonsdata = <double *>londata
* latsdata = <double *>latdata
*/
- __pyx_3 = PyInt_FromSsize_t(__pyx_v_buflenlons); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp__doublesize); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyNumber_Divide(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyInt_FromSsize_t(__pyx_v_buflenlons); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp__doublesize); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_3, __pyx_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_6 = __pyx_PyIndex_AsSsize_t(__pyx_5); if (unlikely((__pyx_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_v_ndim = __pyx_6;
+ __pyx_5 = __pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v_ndim = __pyx_5;
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":103
* raise RuntimeError("Buffer lengths not the same")
@@ -1245,7 +1396,7 @@
* self.geodesic_t.p1.v = lonsdata[i]
* self.geodesic_t.p1.u = latsdata[i]
*/
- __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_1) {
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":109
@@ -1283,7 +1434,7 @@
* self.geodesic_t.p1.v = _dg2rad*lonsdata[i]
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.u = (__pyx_v_distdata[__pyx_v_i]);
- goto __pyx_L11;
+ goto __pyx_L13;
}
/*else*/ {
@@ -1294,14 +1445,14 @@
* self.geodesic_t.p1.u = _dg2rad*latsdata[i]
* self.geodesic_t.p2.v = _dg2rad*azdata[i]
*/
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyFloat_FromDouble((__pyx_v_lonsdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_9); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_4 = PyFloat_FromDouble((__pyx_v_lonsdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
- __pyx_7 = __pyx_PyFloat_AsDouble(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.v = __pyx_7;
+ __pyx_6 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.v = __pyx_6;
/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":115
* else:
@@ -1310,14 +1461,14 @@
* self.geodesic_t.p2.v = _dg2rad*azdata[i]
* self.geodesic_t.p2.u = _dg2rad*distdata[i]
*/
- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_4 = PyFloat_FromDouble((__pyx_v_latsdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_5 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_9); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_4 = PyFloat_FromDouble((__pyx_v_latsdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_...
[truncated message content] |
|
From: <ds...@us...> - 2008-12-17 21:49:33
|
Revision: 6655
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6655&view=rev
Author: dsdale
Date: 2008-12-17 21:48:26 +0000 (Wed, 17 Dec 2008)
Log Message:
-----------
fixed a bug in doc/make.py, small_docs was not defined when make.py was
run without options
Modified Paths:
--------------
trunk/matplotlib/doc/make.py
Modified: trunk/matplotlib/doc/make.py
===================================================================
--- trunk/matplotlib/doc/make.py 2008-12-17 21:15:30 UTC (rev 6654)
+++ trunk/matplotlib/doc/make.py 2008-12-17 21:48:26 UTC (rev 6655)
@@ -95,12 +95,12 @@
}
+small_docs = False
+
if len(sys.argv)>1:
if '--small' in sys.argv[1:]:
small_docs = True
sys.argv.remove('--small')
- else:
- small_docs = False
for arg in sys.argv[1:]:
func = funcd.get(arg)
if func is None:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-12-17 21:15:37
|
Revision: 6654
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6654&view=rev
Author: mdboom
Date: 2008-12-17 21:15:30 +0000 (Wed, 17 Dec 2008)
Log Message:
-----------
Merged revisions 6652 via svnmerge from
https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_98_5_maint
........
r6652 | mdboom | 2008-12-17 11:52:39 -0500 (Wed, 17 Dec 2008) | 2 lines
Massive documentation build improvements. See e-mail on matplotlib-devel.
........
Modified Paths:
--------------
trunk/matplotlib/doc/README.txt
trunk/matplotlib/doc/conf.py
trunk/matplotlib/doc/make.py
trunk/matplotlib/doc/sphinxext/inheritance_diagram.py
trunk/matplotlib/doc/sphinxext/mathmpl.py
trunk/matplotlib/doc/sphinxext/only_directives.py
trunk/matplotlib/doc/sphinxext/plot_directive.py
Added Paths:
-----------
trunk/matplotlib/doc/sphinxext/gen_gallery.py
Removed Paths:
-------------
trunk/matplotlib/doc/_templates/gallery.html
trunk/matplotlib/doc/_templates/gen_gallery.py
Property Changed:
----------------
trunk/matplotlib/
trunk/matplotlib/doc/pyplots/README
Property changes on: trunk/matplotlib
___________________________________________________________________
Modified: svnmerge-integrated
- /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6650
+ /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6653
Modified: svn:mergeinfo
- /branches/v0_91_maint:5753-5771
/branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625
+ /branches/v0_91_maint:5753-5771
/branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625,6652
Modified: trunk/matplotlib/doc/README.txt
===================================================================
--- trunk/matplotlib/doc/README.txt 2008-12-17 19:06:30 UTC (rev 6653)
+++ trunk/matplotlib/doc/README.txt 2008-12-17 21:15:30 UTC (rev 6654)
@@ -35,3 +35,7 @@
for the initial run (which builds the example gallery) to be done,
then run "python make.py html" again. The top file of the results will
be ./build/html/index.html
+
+To build a smaller version of the documentation (without
+high-resolution PNGs and PDF examples), type "python make.py --small
+html".
Deleted: trunk/matplotlib/doc/_templates/gallery.html
===================================================================
--- trunk/matplotlib/doc/_templates/gallery.html 2008-12-17 19:06:30 UTC (rev 6653)
+++ trunk/matplotlib/doc/_templates/gallery.html 2008-12-17 21:15:30 UTC (rev 6654)
@@ -1,526 +0,0 @@
-{% extends "layout.html" %}
-{% set title = "Thumbnail gallery" %}
-
-
-{% block body %}
-
-<h3>Click on any image to see full size image and source code</h3>
-<br/>
-
-<a href="examples/api/barchart_demo.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/barchart_demo.png" border="0" alt="barchart_demo"/></a>
-
-<a href="examples/api/bbox_intersect.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/bbox_intersect.png" border="0" alt="bbox_intersect"/></a>
-
-<a href="examples/api/collections_demo.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/collections_demo.png" border="0" alt="collections_demo"/></a>
-
-<a href="examples/api/color_cycle.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/color_cycle.png" border="0" alt="color_cycle"/></a>
-
-<a href="examples/api/colorbar_only.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/colorbar_only.png" border="0" alt="colorbar_only"/></a>
-
-<a href="examples/api/custom_projection_example.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/custom_projection_example.png" border="0" alt="custom_projection_example"/></a>
-
-<a href="examples/api/custom_scale_example.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/custom_scale_example.png" border="0" alt="custom_scale_example"/></a>
-
-<a href="examples/api/date_demo.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/date_demo.png" border="0" alt="date_demo"/></a>
-
-<a href="examples/api/date_index_formatter.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/date_index_formatter_00.png" border="0" alt="date_index_formatter"/></a>
-
-<a href="examples/api/date_index_formatter.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/date_index_formatter_01.png" border="0" alt="date_index_formatter"/></a>
-
-<a href="examples/api/donut_demo.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/donut_demo.png" border="0" alt="donut_demo"/></a>
-
-<a href="examples/api/histogram_demo.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/histogram_demo.png" border="0" alt="histogram_demo"/></a>
-
-<a href="examples/api/image_zcoord.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/image_zcoord.png" border="0" alt="image_zcoord"/></a>
-
-<a href="examples/api/legend_demo.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/legend_demo.png" border="0" alt="legend_demo"/></a>
-
-<a href="examples/api/line_with_text.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/line_with_text.png" border="0" alt="line_with_text"/></a>
-
-<a href="examples/api/logo2.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/logo2.png" border="0" alt="logo2"/></a>
-
-<a href="examples/api/mathtext_asarray.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/mathtext_asarray.png" border="0" alt="mathtext_asarray"/></a>
-
-<a href="examples/api/patch_collection.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/patch_collection.png" border="0" alt="patch_collection"/></a>
-
-<a href="examples/api/path_patch_demo.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/path_patch_demo.png" border="0" alt="path_patch_demo"/></a>
-
-<a href="examples/api/quad_bezier.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/quad_bezier.png" border="0" alt="quad_bezier"/></a>
-
-<a href="examples/api/scatter_piecharts.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/scatter_piecharts.png" border="0" alt="scatter_piecharts"/></a>
-
-<a href="examples/api/span_regions.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/span_regions.png" border="0" alt="span_regions"/></a>
-
-<a href="examples/api/two_scales.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/two_scales.png" border="0" alt="two_scales"/></a>
-
-<a href="examples/api/unicode_minus.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/unicode_minus.png" border="0" alt="unicode_minus"/></a>
-
-<a href="examples/api/watermark_image.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/watermark_image.png" border="0" alt="watermark_image"/></a>
-
-<a href="examples/api/watermark_text.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/watermark_text.png" border="0" alt="watermark_text"/></a>
-
-<a href="examples/pylab_examples/accented_text.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/accented_text.png" border="0" alt="accented_text"/></a>
-
-<a href="examples/pylab_examples/agg_buffer_to_array.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/agg_buffer_to_array_00.png" border="0" alt="agg_buffer_to_array"/></a>
-
-<a href="examples/pylab_examples/agg_buffer_to_array.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/agg_buffer_to_array_01.png" border="0" alt="agg_buffer_to_array"/></a>
-
-<a href="examples/pylab_examples/alignment_test.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/alignment_test.png" border="0" alt="alignment_test"/></a>
-
-<a href="examples/pylab_examples/annotation_demo2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/annotation_demo2_00.png" border="0" alt="annotation_demo2"/></a>
-
-<a href="examples/pylab_examples/annotation_demo2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/annotation_demo2_01.png" border="0" alt="annotation_demo2"/></a>
-
-<a href="examples/pylab_examples/annotation_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/annotation_demo_00.png" border="0" alt="annotation_demo"/></a>
-
-<a href="examples/pylab_examples/annotation_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/annotation_demo_01.png" border="0" alt="annotation_demo"/></a>
-
-<a href="examples/pylab_examples/annotation_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/annotation_demo_02.png" border="0" alt="annotation_demo"/></a>
-
-<a href="examples/pylab_examples/anscombe.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/anscombe.png" border="0" alt="anscombe"/></a>
-
-<a href="examples/pylab_examples/arctest.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/arctest.png" border="0" alt="arctest"/></a>
-
-<a href="examples/pylab_examples/arrow_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/arrow_demo.png" border="0" alt="arrow_demo"/></a>
-
-<a href="examples/pylab_examples/axes_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/axes_demo.png" border="0" alt="axes_demo"/></a>
-
-<a href="examples/pylab_examples/axes_props.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/axes_props.png" border="0" alt="axes_props"/></a>
-
-<a href="examples/pylab_examples/axhspan_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/axhspan_demo.png" border="0" alt="axhspan_demo"/></a>
-
-<a href="examples/pylab_examples/axis_equal_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/axis_equal_demo.png" border="0" alt="axis_equal_demo"/></a>
-
-<a href="examples/pylab_examples/bar_stacked.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/bar_stacked.png" border="0" alt="bar_stacked"/></a>
-
-<a href="examples/pylab_examples/barb_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/barb_demo.png" border="0" alt="barb_demo"/></a>
-
-<a href="examples/pylab_examples/barchart_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/barchart_demo.png" border="0" alt="barchart_demo"/></a>
-
-<a href="examples/pylab_examples/barcode_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/barcode_demo.png" border="0" alt="barcode_demo"/></a>
-
-<a href="examples/pylab_examples/barh_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/barh_demo_00.png" border="0" alt="barh_demo"/></a>
-
-<a href="examples/pylab_examples/barh_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/barh_demo_01.png" border="0" alt="barh_demo"/></a>
-
-<a href="examples/pylab_examples/boxplot_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/boxplot_demo_00.png" border="0" alt="boxplot_demo"/></a>
-
-<a href="examples/pylab_examples/boxplot_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/boxplot_demo_01.png" border="0" alt="boxplot_demo"/></a>
-
-<a href="examples/pylab_examples/boxplot_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/boxplot_demo_02.png" border="0" alt="boxplot_demo"/></a>
-
-<a href="examples/pylab_examples/boxplot_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/boxplot_demo_03.png" border="0" alt="boxplot_demo"/></a>
-
-<a href="examples/pylab_examples/boxplot_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/boxplot_demo_04.png" border="0" alt="boxplot_demo"/></a>
-
-<a href="examples/pylab_examples/boxplot_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/boxplot_demo_05.png" border="0" alt="boxplot_demo"/></a>
-
-<a href="examples/pylab_examples/boxplot_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/boxplot_demo_06.png" border="0" alt="boxplot_demo"/></a>
-
-<a href="examples/pylab_examples/break.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/break.png" border="0" alt="break"/></a>
-
-<a href="examples/pylab_examples/broken_barh.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/broken_barh.png" border="0" alt="broken_barh"/></a>
-
-<a href="examples/pylab_examples/clippedline.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/clippedline.png" border="0" alt="clippedline"/></a>
-
-<a href="examples/pylab_examples/cohere_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/cohere_demo.png" border="0" alt="cohere_demo"/></a>
-
-<a href="examples/pylab_examples/color_by_yvalue.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/color_by_yvalue.png" border="0" alt="color_by_yvalue"/></a>
-
-<a href="examples/pylab_examples/color_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/color_demo.png" border="0" alt="color_demo"/></a>
-
-<a href="examples/pylab_examples/colorbar_tick_labelling_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/colorbar_tick_labelling_demo_00.png" border="0" alt="colorbar_tick_labelling_demo"/></a>
-
-<a href="examples/pylab_examples/colorbar_tick_labelling_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/colorbar_tick_labelling_demo_01.png" border="0" alt="colorbar_tick_labelling_demo"/></a>
-
-<a href="examples/pylab_examples/contour_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/contour_demo_00.png" border="0" alt="contour_demo"/></a>
-
-<a href="examples/pylab_examples/contour_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/contour_demo_01.png" border="0" alt="contour_demo"/></a>
-
-<a href="examples/pylab_examples/contour_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/contour_demo_02.png" border="0" alt="contour_demo"/></a>
-
-<a href="examples/pylab_examples/contour_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/contour_demo_03.png" border="0" alt="contour_demo"/></a>
-
-<a href="examples/pylab_examples/contour_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/contour_demo_04.png" border="0" alt="contour_demo"/></a>
-
-<a href="examples/pylab_examples/contour_image.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/contour_image.png" border="0" alt="contour_image"/></a>
-
-<a href="examples/pylab_examples/contour_label_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/contour_label_demo_00.png" border="0" alt="contour_label_demo"/></a>
-
-<a href="examples/pylab_examples/contour_label_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/contour_label_demo_01.png" border="0" alt="contour_label_demo"/></a>
-
-<a href="examples/pylab_examples/contourf_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/contourf_demo_00.png" border="0" alt="contourf_demo"/></a>
-
-<a href="examples/pylab_examples/contourf_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/contourf_demo_01.png" border="0" alt="contourf_demo"/></a>
-
-<a href="examples/pylab_examples/contourf_log.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/contourf_log.png" border="0" alt="contourf_log"/></a>
-
-<a href="examples/pylab_examples/coords_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/coords_demo.png" border="0" alt="coords_demo"/></a>
-
-<a href="examples/pylab_examples/coords_report.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/coords_report.png" border="0" alt="coords_report"/></a>
-
-<a href="examples/pylab_examples/csd_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/csd_demo.png" border="0" alt="csd_demo"/></a>
-
-<a href="examples/pylab_examples/custom_cmap.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/custom_cmap.png" border="0" alt="custom_cmap"/></a>
-
-<a href="examples/pylab_examples/custom_figure_class.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/custom_figure_class.png" border="0" alt="custom_figure_class"/></a>
-
-<a href="examples/pylab_examples/custom_ticker1.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/custom_ticker1.png" border="0" alt="custom_ticker1"/></a>
-
-<a href="examples/pylab_examples/customize_rc.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/customize_rc.png" border="0" alt="customize_rc"/></a>
-
-<a href="examples/pylab_examples/dannys_example.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/dannys_example.png" border="0" alt="dannys_example"/></a>
-
-<a href="examples/pylab_examples/dash_control.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/dash_control.png" border="0" alt="dash_control"/></a>
-
-<a href="examples/pylab_examples/dashpointlabel.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/dashpointlabel.png" border="0" alt="dashpointlabel"/></a>
-
-<a href="examples/pylab_examples/date_demo1.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/date_demo1.png" border="0" alt="date_demo1"/></a>
-
-<a href="examples/pylab_examples/date_demo2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/date_demo2.png" border="0" alt="date_demo2"/></a>
-
-<a href="examples/pylab_examples/date_demo_convert.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/date_demo_convert.png" border="0" alt="date_demo_convert"/></a>
-
-<a href="examples/pylab_examples/date_demo_rrule.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/date_demo_rrule.png" border="0" alt="date_demo_rrule"/></a>
-
-<a href="examples/pylab_examples/date_index_formatter.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/date_index_formatter.png" border="0" alt="date_index_formatter"/></a>
-
-<a href="examples/pylab_examples/dolphin.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/dolphin.png" border="0" alt="dolphin"/></a>
-
-<a href="examples/pylab_examples/ellipse_collection.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/ellipse_collection.png" border="0" alt="ellipse_collection"/></a>
-
-<a href="examples/pylab_examples/ellipse_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/ellipse_demo.png" border="0" alt="ellipse_demo"/></a>
-
-<a href="examples/pylab_examples/ellipse_rotated.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/ellipse_rotated.png" border="0" alt="ellipse_rotated"/></a>
-
-<a href="examples/pylab_examples/equal_aspect_ratio.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/equal_aspect_ratio.png" border="0" alt="equal_aspect_ratio"/></a>
-
-<a href="examples/pylab_examples/errorbar_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/errorbar_demo_00.png" border="0" alt="errorbar_demo"/></a>
-
-<a href="examples/pylab_examples/errorbar_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/errorbar_demo_01.png" border="0" alt="errorbar_demo"/></a>
-
-<a href="examples/pylab_examples/errorbar_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/errorbar_demo_02.png" border="0" alt="errorbar_demo"/></a>
-
-<a href="examples/pylab_examples/errorbar_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/errorbar_demo_03.png" border="0" alt="errorbar_demo"/></a>
-
-<a href="examples/pylab_examples/errorbar_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/errorbar_demo_04.png" border="0" alt="errorbar_demo"/></a>
-
-<a href="examples/pylab_examples/errorbar_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/errorbar_demo_05.png" border="0" alt="errorbar_demo"/></a>
-
-<a href="examples/pylab_examples/errorbar_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/errorbar_demo_06.png" border="0" alt="errorbar_demo"/></a>
-
-<a href="examples/pylab_examples/errorbar_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/errorbar_demo_07.png" border="0" alt="errorbar_demo"/></a>
-
-<a href="examples/pylab_examples/errorbar_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/errorbar_demo_08.png" border="0" alt="errorbar_demo"/></a>
-
-<a href="examples/pylab_examples/errorbar_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/errorbar_demo_09.png" border="0" alt="errorbar_demo"/></a>
-
-<a href="examples/pylab_examples/errorbar_limits.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/errorbar_limits_00.png" border="0" alt="errorbar_limits"/></a>
-
-<a href="examples/pylab_examples/errorbar_limits.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/errorbar_limits_01.png" border="0" alt="errorbar_limits"/></a>
-
-<a href="examples/pylab_examples/fancyarrow_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fancyarrow_demo.png" border="0" alt="fancyarrow_demo"/></a>
-
-<a href="examples/pylab_examples/fancybox_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fancybox_demo.png" border="0" alt="fancybox_demo"/></a>
-
-<a href="examples/pylab_examples/fancybox_demo2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fancybox_demo2.png" border="0" alt="fancybox_demo2"/></a>
-
-<a href="examples/pylab_examples/fancytextbox_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fancytextbox_demo.png" border="0" alt="fancytextbox_demo"/></a>
-
-<a href="examples/pylab_examples/figimage_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/figimage_demo.png" border="0" alt="figimage_demo"/></a>
-
-<a href="examples/pylab_examples/figlegend_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/figlegend_demo.png" border="0" alt="figlegend_demo"/></a>
-
-<a href="examples/pylab_examples/figure_title.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/figure_title.png" border="0" alt="figure_title"/></a>
-
-<a href="examples/pylab_examples/fill_between.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fill_between_00.png" border="0" alt="fill_between"/></a>
-
-<a href="examples/pylab_examples/fill_between.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fill_between_01.png" border="0" alt="fill_between"/></a>
-
-<a href="examples/pylab_examples/fill_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fill_demo.png" border="0" alt="fill_demo"/></a>
-
-<a href="examples/pylab_examples/fill_demo2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fill_demo2.png" border="0" alt="fill_demo2"/></a>
-
-<a href="examples/pylab_examples/fill_spiral.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fill_spiral.png" border="0" alt="fill_spiral"/></a>
-
-<a href="examples/pylab_examples/finance_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/finance_demo.png" border="0" alt="finance_demo"/></a>
-
-<a href="examples/pylab_examples/finance_work2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/finance_work2.png" border="0" alt="finance_work2"/></a>
-
-<a href="examples/pylab_examples/findobj_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/findobj_demo.png" border="0" alt="findobj_demo"/></a>
-
-<a href="examples/pylab_examples/fonts_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fonts_demo.png" border="0" alt="fonts_demo"/></a>
-
-<a href="examples/pylab_examples/fonts_demo_kw.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fonts_demo_kw.png" border="0" alt="fonts_demo_kw"/></a>
-
-<a href="examples/pylab_examples/ganged_plots.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/ganged_plots.png" border="0" alt="ganged_plots"/></a>
-
-<a href="examples/pylab_examples/geo_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/geo_demo.png" border="0" alt="geo_demo"/></a>
-
-<a href="examples/pylab_examples/gradient_bar.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/gradient_bar.png" border="0" alt="gradient_bar"/></a>
-
-<a href="examples/pylab_examples/griddata_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/griddata_demo.png" border="0" alt="griddata_demo"/></a>
-
-<a href="examples/pylab_examples/hatch_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/hatch_demo.png" border="0" alt="hatch_demo"/></a>
-
-<a href="examples/pylab_examples/hexbin_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/hexbin_demo.png" border="0" alt="hexbin_demo"/></a>
-
-<a href="examples/pylab_examples/hexbin_demo2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/hexbin_demo2.png" border="0" alt="hexbin_demo2"/></a>
-
-<a href="examples/pylab_examples/hist_colormapped.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/hist_colormapped.png" border="0" alt="hist_colormapped"/></a>
-
-<a href="examples/pylab_examples/histogram_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/histogram_demo.png" border="0" alt="histogram_demo"/></a>
-
-<a href="examples/pylab_examples/histogram_demo_extended.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/histogram_demo_extended_00.png" border="0" alt="histogram_demo_extended"/></a>
-
-<a href="examples/pylab_examples/histogram_demo_extended.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/histogram_demo_extended_01.png" border="0" alt="histogram_demo_extended"/></a>
-
-<a href="examples/pylab_examples/histogram_demo_extended.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/histogram_demo_extended_02.png" border="0" alt="histogram_demo_extended"/></a>
-
-<a href="examples/pylab_examples/histogram_demo_extended.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/histogram_demo_extended_03.png" border="0" alt="histogram_demo_extended"/></a>
-
-<a href="examples/pylab_examples/histogram_demo_extended.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/histogram_demo_extended_04.png" border="0" alt="histogram_demo_extended"/></a>
-
-<a href="examples/pylab_examples/histogram_demo_extended.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/histogram_demo_extended_05.png" border="0" alt="histogram_demo_extended"/></a>
-
-<a href="examples/pylab_examples/hline_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/hline_demo.png" border="0" alt="hline_demo"/></a>
-
-<a href="examples/pylab_examples/image_clip_path.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/image_clip_path.png" border="0" alt="image_clip_path"/></a>
-
-<a href="examples/pylab_examples/image_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/image_demo.png" border="0" alt="image_demo"/></a>
-
-<a href="examples/pylab_examples/image_demo2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/image_demo2.png" border="0" alt="image_demo2"/></a>
-
-<a href="examples/pylab_examples/image_demo3.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/image_demo3.png" border="0" alt="image_demo3"/></a>
-
-<a href="examples/pylab_examples/image_interp.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/image_interp_00.png" border="0" alt="image_interp"/></a>
-
-<a href="examples/pylab_examples/image_interp.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/image_interp_01.png" border="0" alt="image_interp"/></a>
-
-<a href="examples/pylab_examples/image_interp.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/image_interp_02.png" border="0" alt="image_interp"/></a>
-
-<a href="examples/pylab_examples/image_masked.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/image_masked.png" border="0" alt="image_masked"/></a>
-
-<a href="examples/pylab_examples/image_nonuniform.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/image_nonuniform.png" border="0" alt="image_nonuniform"/></a>
-
-<a href="examples/pylab_examples/image_origin.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/image_origin.png" border="0" alt="image_origin"/></a>
-
-<a href="examples/pylab_examples/image_slices_viewer.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/image_slices_viewer.png" border="0" alt="image_slices_viewer"/></a>
-
-<a href="examples/pylab_examples/integral_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/integral_demo.png" border="0" alt="integral_demo"/></a>
-
-<a href="examples/pylab_examples/interp_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/interp_demo.png" border="0" alt="interp_demo"/></a>
-
-<a href="examples/pylab_examples/invert_axes.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/invert_axes.png" border="0" alt="invert_axes"/></a>
-
-<a href="examples/pylab_examples/layer_images.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/layer_images.png" border="0" alt="layer_images"/></a>
-
-<a href="examples/pylab_examples/legend_auto.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_auto_00.png" border="0" alt="legend_auto"/></a>
-
-<a href="examples/pylab_examples/legend_auto.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_auto_01.png" border="0" alt="legend_auto"/></a>
-
-<a href="examples/pylab_examples/legend_auto.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_auto_02.png" border="0" alt="legend_auto"/></a>
-
-<a href="examples/pylab_examples/legend_auto.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_auto_03.png" border="0" alt="legend_auto"/></a>
-
-<a href="examples/pylab_examples/legend_auto.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_auto_04.png" border="0" alt="legend_auto"/></a>
-
-<a href="examples/pylab_examples/legend_auto.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_auto_05.png" border="0" alt="legend_auto"/></a>
-
-<a href="examples/pylab_examples/legend_auto.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_auto_06.png" border="0" alt="legend_auto"/></a>
-
-<a href="examples/pylab_examples/legend_auto.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_auto_07.png" border="0" alt="legend_auto"/></a>
-
-<a href="examples/pylab_examples/legend_auto.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_auto_08.png" border="0" alt="legend_auto"/></a>
-
-<a href="examples/pylab_examples/legend_auto.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_auto_09.png" border="0" alt="legend_auto"/></a>
-
-<a href="examples/pylab_examples/legend_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_demo.png" border="0" alt="legend_demo"/></a>
-
-<a href="examples/pylab_examples/legend_demo2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_demo2.png" border="0" alt="legend_demo2"/></a>
-
-<a href="examples/pylab_examples/legend_demo3.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_demo3.png" border="0" alt="legend_demo3"/></a>
-
-<a href="examples/pylab_examples/legend_scatter.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_scatter.png" border="0" alt="legend_scatter"/></a>
-
-<a href="examples/pylab_examples/line_collection.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/line_collection.png" border="0" alt="line_collection"/></a>
-
-<a href="examples/pylab_examples/line_collection2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/line_collection2.png" border="0" alt="line_collection2"/></a>
-
-<a href="examples/pylab_examples/line_styles.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/line_styles.png" border="0" alt="line_styles"/></a>
-
-<a href="examples/pylab_examples/load_converter.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/load_converter.png" border="0" alt="load_converter"/></a>
-
-<a href="examples/pylab_examples/loadrec.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/loadrec.png" border="0" alt="loadrec"/></a>
-
-<a href="examples/pylab_examples/log_bar.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/log_bar.png" border="0" alt="log_bar"/></a>
-
-<a href="examples/pylab_examples/log_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/log_demo.png" border="0" alt="log_demo"/></a>
-
-<a href="examples/pylab_examples/log_test.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/log_test.png" border="0" alt="log_test"/></a>
-
-<a href="examples/pylab_examples/logo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/logo.png" border="0" alt="logo"/></a>
-
-<a href="examples/pylab_examples/major_minor_demo1.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/major_minor_demo1.png" border="0" alt="major_minor_demo1"/></a>
-
-<a href="examples/pylab_examples/major_minor_demo2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/major_minor_demo2.png" border="0" alt="major_minor_demo2"/></a>
-
-<a href="examples/pylab_examples/manual_axis.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/manual_axis.png" border="0" alt="manual_axis"/></a>
-
-<a href="examples/pylab_examples/masked_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/masked_demo.png" border="0" alt="masked_demo"/></a>
-
-<a href="examples/pylab_examples/mathtext_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/mathtext_demo.png" border="0" alt="mathtext_demo"/></a>
-
-<a href="examples/pylab_examples/matshow.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/matshow_00.png" border="0" alt="matshow"/></a>
-
-<a href="examples/pylab_examples/matshow.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/matshow_01.png" border="0" alt="matshow"/></a>
-
-<a href="examples/pylab_examples/matshow.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/matshow_04.png" border="0" alt="matshow"/></a>
-
-<a href="examples/pylab_examples/mri_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/mri_demo.png" border="0" alt="mri_demo"/></a>
-
-<a href="examples/pylab_examples/mri_with_eeg.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/mri_with_eeg.png" border="0" alt="mri_with_eeg"/></a>
-
-<a href="examples/pylab_examples/multi_image.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/multi_image.png" border="0" alt="multi_image"/></a>
-
-<a href="examples/pylab_examples/multiline.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/multiline.png" border="0" alt="multiline"/></a>
-
-<a href="examples/pylab_examples/multiple_figs_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/multiple_figs_demo_00.png" border="0" alt="multiple_figs_demo"/></a>
-
-<a href="examples/pylab_examples/multiple_figs_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/multiple_figs_demo_01.png" border="0" alt="multiple_figs_demo"/></a>
-
-<a href="examples/pylab_examples/nan_test.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/nan_test.png" border="0" alt="nan_test"/></a>
-
-<a href="examples/pylab_examples/newscalarformatter_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/newscalarformatter_demo_00.png" border="0" alt="newscalarformatter_demo"/></a>
-
-<a href="examples/pylab_examples/newscalarformatter_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/newscalarformatter_demo_01.png" border="0" alt="newscalarformatter_demo"/></a>
-
-<a href="examples/pylab_examples/newscalarformatter_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/newscalarformatter_demo_02.png" border="0" alt="newscalarformatter_demo"/></a>
-
-<a href="examples/pylab_examples/newscalarformatter_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/newscalarformatter_demo_03.png" border="0" alt="newscalarformatter_demo"/></a>
-
-<a href="examples/pylab_examples/pcolor_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/pcolor_demo.png" border="0" alt="pcolor_demo"/></a>
-
-<a href="examples/pylab_examples/pcolor_demo2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/pcolor_demo2.png" border="0" alt="pcolor_demo2"/></a>
-
-<a href="examples/pylab_examples/pcolor_log.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/pcolor_log.png" border="0" alt="pcolor_log"/></a>
-
-<a href="examples/pylab_examples/pcolor_small.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/pcolor_small.png" border="0" alt="pcolor_small"/></a>
-
-<a href="examples/pylab_examples/pie_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/pie_demo.png" border="0" alt="pie_demo"/></a>
-
-<a href="examples/pylab_examples/plotfile_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/plotfile_demo_00.png" border="0" alt="plotfile_demo"/></a>
-
-<a href="examples/pylab_examples/plotfile_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/plotfile_demo_01.png" border="0" alt="plotfile_demo"/></a>
-
-<a href="examples/pylab_examples/plotfile_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/plotfile_demo_02.png" border="0" alt="plotfile_demo"/></a>
-
-<a href="examples/pylab_examples/plotfile_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/plotfile_demo_03.png" border="0" alt="plotfile_demo"/></a>
-
-<a href="examples/pylab_examples/plotfile_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/plotfile_demo_04.png" border="0" alt="plotfile_demo"/></a>
-
-<a href="examples/pylab_examples/polar_bar.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/polar_bar.png" border="0" alt="polar_bar"/></a>
-
-<a href="examples/pylab_examples/polar_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/polar_demo.png" border="0" alt="polar_demo"/></a>
-
-<a href="examples/pylab_examples/polar_legend.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/polar_legend.png" border="0" alt="polar_legend"/></a>
-
-<a href="examples/pylab_examples/polar_scatter.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/polar_scatter.png" border="0" alt="polar_scatter"/></a>
-
-<a href="examples/pylab_examples/poormans_contour.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/poormans_contour.png" border="0" alt="poormans_contour"/></a>
-
-<a href="examples/pylab_examples/psd_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/psd_demo.png" border="0" alt="psd_demo"/></a>
-
-<a href="examples/pylab_examples/psd_demo2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/psd_demo2.png" border="0" alt="psd_demo2"/></a>
-
-<a href="examples/pylab_examples/psd_demo3.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/psd_demo3.png" border="0" alt="psd_demo3"/></a>
-
-<a href="examples/pylab_examples/pythonic_matplotlib.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/pythonic_matplotlib.png" border="0" alt="pythonic_matplotlib"/></a>
-
-<a href="examples/pylab_examples/quadmesh_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/quadmesh_demo.png" border="0" alt="quadmesh_demo"/></a>
-
-<a href="examples/pylab_examples/quiver_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/quiver_demo_00.png" border="0" alt="quiver_demo"/></a>
-
-<a href="examples/pylab_examples/quiver_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/quiver_demo_01.png" border="0" alt="quiver_demo"/></a>
-
-<a href="examples/pylab_examples/quiver_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/quiver_demo_02.png" border="0" alt="quiver_demo"/></a>
-
-<a href="examples/pylab_examples/quiver_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/quiver_demo_03.png" border="0" alt="quiver_demo"/></a>
-
-<a href="examples/pylab_examples/quiver_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/quiver_demo_04.png" border="0" alt="quiver_demo"/></a>
-
-<a href="examples/pylab_examples/quiver_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/quiver_demo_05.png" border="0" alt="quiver_demo"/></a>
-
-<a href="examples/pylab_examples/scatter_custom_symbol.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/scatter_custom_symbol.png" border="0" alt="scatter_custom_symbol"/></a>
-
-<a href="examples/pylab_examples/scatter_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/scatter_demo.png" border="0" alt="scatter_demo"/></a>
-
-<a href="examples/pylab_examples/scatter_demo2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/scatter_demo2.png" border="0" alt="scatter_demo2"/></a>
-
-<a href="examples/pylab_examples/scatter_masked.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/scatter_masked.png" border="0" alt="scatter_masked"/></a>
-
-<a href="examples/pylab_examples/scatter_star_poly.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/scatter_star_poly.png" border="0" alt="scatter_star_poly"/></a>
-
-<a href="examples/pylab_examples/set_and_get.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/set_and_get.png" border="0" alt="set_and_get"/></a>
-
-<a href="examples/pylab_examples/shared_axis_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/shared_axis_demo.png" border="0" alt="shared_axis_demo"/></a>
-
-<a href="examples/pylab_examples/simple_plot.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/simple_plot.png" border="0" alt="simple_plot"/></a>
-
-<a href="examples/pylab_examples/simplification_clipping_test.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/simplification_clipping_test.png" border="0" alt="simplification_clipping_test"/></a>
-
-<a href="examples/pylab_examples/specgram_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/specgram_demo.png" border="0" alt="specgram_demo"/></a>
-
-<a href="examples/pylab_examples/spy_demos.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/spy_demos.png" border="0" alt="spy_demos"/></a>
-
-<a href="examples/pylab_examples/stem_plot.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/stem_plot.png" border="0" alt="stem_plot"/></a>
-
-<a href="examples/pylab_examples/step_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/step_demo.png" border="0" alt="step_demo"/></a>
-
-<a href="examples/pylab_examples/stix_fonts_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/stix_fonts_demo.png" border="0" alt="stix_fonts_demo"/></a>
-
-<a href="examples/pylab_examples/subplot_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/subplot_demo.png" border="0" alt="subplot_demo"/></a>
-
-<a href="examples/pylab_examples/subplot_toolbar.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/subplot_toolbar_00.png" border="0" alt="subplot_toolbar"/></a>
-
-<a href="examples/pylab_examples/subplot_toolbar.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/subplot_toolbar_01.png" border="0" alt="subplot_toolbar"/></a>
-
-<a href="examples/pylab_examples/subplots_adjust.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/subplots_adjust.png" border="0" alt="subplots_adjust"/></a>
-
-<a href="examples/pylab_examples/symlog_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/symlog_demo.png" border="0" alt="symlog_demo"/></a>
-
-<a href="examples/pylab_examples/table_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/table_demo.png" border="0" alt="table_demo"/></a>
-
-<a href="examples/pylab_examples/tex_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/tex_demo.png" border="0" alt="tex_demo"/></a>
-
-<a href="examples/pylab_examples/text_handles.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/text_handles.png" border="0" alt="text_handles"/></a>
-
-<a href="examples/pylab_examples/text_rotation.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/text_rotation.png" border="0" alt="text_rotation"/></a>
-
-<a href="examples/pylab_examples/text_rotation_relative_to_line.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/text_rotation_relative_to_line.png" border="0" alt="text_rotation_relative_to_line"/></a>
-
-<a href="examples/pylab_examples/text_themes.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/text_themes.png" border="0" alt="text_themes"/></a>
-
-<a href="examples/pylab_examples/to_numeric.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/to_numeric.png" border="0" alt="to_numeric"/></a>
-
-<a href="examples/pylab_examples/toggle_images.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/toggle_images.png" border="0" alt="toggle_images"/></a>
-
-<a href="examples/pylab_examples/transoffset.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/transoffset.png" border="0" alt="transoffset"/></a>
-
-<a href="examples/pylab_examples/unicode_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/unicode_demo.png" border="0" alt="unicode_demo"/></a>
-
-<a href="examples/pylab_examples/usetex_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/usetex_demo.png" border="0" alt="usetex_demo"/></a>
-
-<a href="examples/pylab_examples/vertical_ticklabels.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/vertical_ticklabels.png" border="0" alt="vertical_ticklabels"/></a>
-
-<a href="examples/pylab_examples/vline_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/vline_demo.png" border="0" alt="vline_demo"/></a>
-
-<a href="examples/pylab_examples/xcorr_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/xcorr_demo.png" border="0" alt="xcorr_demo"/></a>
-
-<a href="examples/pylab_examples/zorder_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/zorder_demo_00.png" border="0" alt="zorder_demo"/></a>
-
-<a href="examples/pylab_examples/zorder_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/zorder_demo_01.png" border="0" alt="zorder_demo"/></a>
-
-<a href="examples/widgets/slider_demo.html"><img src="_static/plot_directive/mpl_examples/widgets/thumbnails/slider_demo.png" border="0" alt="slider_demo"/></a>
-
-{% endblock %}
Deleted: trunk/matplotlib/doc/_templates/gen_gallery.py
===================================================================
--- trunk/matplotlib/doc/_templates/gen_gallery.py 2008-12-17 19:06:30 UTC (rev 6653)
+++ trunk/matplotlib/doc/_templates/gen_gallery.py 2008-12-17 21:15:30 UTC (rev 6654)
@@ -1,91 +0,0 @@
-# generate a thumbnail gallery of examples
-template = """\
-{%% extends "layout.html" %%}
-{%% set title = "Thumbnail gallery" %%}
-
-
-{%% block body %%}
-
-<h3>Click on any image to see full size image and source code</h3>
-<br/>
-
-%s
-{%% endblock %%}
-"""
-
-import os, glob, re
-
-multiimage = re.compile('(.*)_\d\d')
-
-pwd = os.getcwd()
-os.chdir('..')
-
-rootdir = '_static/plot_directive/mpl_examples'
-
-# images we want to skip for the gallery because they are an unusual
-# size that doesn't layout well in a table, or because they may be
-# redundant with other images or uninteresting
-skips = set([
- 'mathtext_examples',
- 'matshow_02',
- 'matshow_03',
- 'matplotlib_icon',
- ])
-data = []
-for subdir in ('api', 'pylab_examples', 'widgets'):
- thisdir = os.path.join(rootdir,subdir)
- if not os.path.exists(thisdir):
- raise RuntimeError('Cannot find %s'%thisdir)
- thumbdir = os.path.join(thisdir, 'thumbnails')
- if not os.path.exists(thumbdir):
- raise RuntimeError('Cannot find thumbnail dir %s'%thumbdir)
- #print thumbdir
-
- # we search for pdfs here because there is one pdf for each
- # successful image build (2 pngs since one is high res) and the
- # mapping between py files and images is 1->many
- for pdffile in sorted(glob.glob(os.path.join(thisdir, '*.pdf'))):
- basepath, filename = os.path.split(pdffile)
- basename, ext = os.path.splitext(filename)
- print 'generating', subdir, basename
-
- if basename in skips:
- print ' skipping', basename
- continue
- pngfile = os.path.join(thisdir, '%s.png'%basename)
- thumbfile = os.path.join(thumbdir, '%s.png'%basename)
- if not os.path.exists(pngfile):
- pngfile = None
- if not os.path.exists(thumbfile):
- thumbfile = None
-
- m = multiimage.match(basename)
- if m is None:
- pyfile = '%s.py'%basename
- else:
- basename = m.group(1)
- pyfile = '%s.py'%basename
-
- print ' ', pyfile, filename, basename, ext
-
- print ' ', pyfile, pngfile, thumbfile
- data.append((subdir, thisdir, pyfile, basename, pngfile, thumbfile))
-
-link_template = """\
-<a href="%s"><img src="%s" border="0" alt="%s"/></a>
-"""
-
-
-rows = []
-for (subdir, thisdir, pyfile, basename, pngfile, thumbfile) in data:
- if thumbfile is not None:
- link = 'examples/%s/%s.html'%(subdir, basename)
- rows.append(link_template%(link, thumbfile, basename))
-
-
-
-os.chdir(pwd)
-fh = file('gallery.html', 'w')
-fh.write(template%'\n'.join(rows))
-fh.close()
-
Modified: trunk/matplotlib/doc/conf.py
===================================================================
--- trunk/matplotlib/doc/conf.py 2008-12-17 19:06:30 UTC (rev 6653)
+++ trunk/matplotlib/doc/conf.py 2008-12-17 21:15:30 UTC (rev 6654)
@@ -28,7 +28,8 @@
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['mathmpl', 'math_symbol_table', 'sphinx.ext.autodoc',
- 'only_directives', 'plot_directive', 'inheritance_diagram']
+ 'only_directives', 'plot_directive', 'inheritance_diagram',
+ 'gen_gallery']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
@@ -75,7 +76,11 @@
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
+# Plot directive configuration
+# ----------------------------
+plot_formats = ['png', 'hires.png', 'pdf']
+
# Options for HTML output
# -----------------------
Modified: trunk/matplotlib/doc/make.py
===================================================================
--- trunk/matplotlib/doc/make.py 2008-12-17 19:06:30 UTC (rev 6653)
+++ trunk/matplotlib/doc/make.py 2008-12-17 21:15:30 UTC (rev 6654)
@@ -32,18 +32,17 @@
os.system('cd examples; svn-clean; python gen_rst.py')
#pass
-def gallery():
- 'make the thumbnail gallery'
- os.system('cd _templates; python gen_gallery.py')
-
-
def html():
check_build()
if not os.path.exists('examples/index.rst'):
examples()
shutil.copy('../lib/matplotlib/mpl-data/matplotlibrc', '_static/matplotlibrc')
#figs()
- if os.system('sphinx-build -b html -d build/doctrees . build/html'):
+ if small_docs:
+ options = "-D plot_formats=\"['png']\""
+ else:
+ options = ''
+ if os.system('sphinx-build %s -b html -d build/doctrees . build/html' % options):
raise SystemExit("Building HTML failed.")
figures_dest_path = 'build/html/pyplots'
@@ -51,10 +50,6 @@
shutil.rmtree(figures_dest_path)
shutil.copytree('pyplots', figures_dest_path)
- # rebuild the gallery
- gallery()
- print 'Just rebuilt gallery, you may need to make html again'
-
def latex():
check_build()
#figs()
@@ -96,12 +91,16 @@
'sf' : sf,
'sfpdf' : sfpdf,
'examples' : examples,
- 'gallery' : gallery,
'all' : all,
}
if len(sys.argv)>1:
+ if '--small' in sys.argv[1:]:
+ small_docs = True
+ sys.argv.remove('--small')
+ else:
+ small_docs = False
for arg in sys.argv[1:]:
func = funcd.get(arg)
if func is None:
Property changes on: trunk/matplotlib/doc/pyplots/README
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_98_5_maint/doc/pyplots/README:6581,6585,6587,6589-6609,6614,6616,6625
+ /branches/v0_98_5_maint/doc/pyplots/README:6581,6585,6587,6589-6609,6614,6616,6625,6652
Copied: trunk/matplotlib/doc/sphinxext/gen_gallery.py (from rev 6652, branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py)
===================================================================
--- trunk/matplotlib/doc/sphinxext/gen_gallery.py (rev 0)
+++ trunk/matplotlib/doc/sphinxext/gen_gallery.py 2008-12-17 21:15:30 UTC (rev 6654)
@@ -0,0 +1,99 @@
+# generate a thumbnail gallery of examples
+template = """\
+{%% extends "layout.html" %%}
+{%% set title = "Thumbnail gallery" %%}
+
+
+{%% block body %%}
+
+<h3>Click on any image to see full size image and source code</h3>
+<br/>
+
+%s
+{%% endblock %%}
+"""
+
+import os, glob, re, sys, warnings
+import matplotlib.image as image
+
+multiimage = re.compile('(.*)_\d\d')
+
+def gen_gallery(app, doctree):
+ if app.builder.name != 'html':
+ return
+
+ outdir = app.builder.outdir
+ rootdir = 'plot_directive/mpl_examples'
+
+ # images we want to skip for the gallery because they are an unusual
+ # size that doesn't layout well in a table, or because they may be
+ # redundant with other images or uninteresting
+ skips = set([
+ 'mathtext_examples',
+ 'matshow_02',
+ 'matshow_03',
+ 'matplotlib_icon',
+ ])
+
+ print
+ print "generating gallery: ",
+ data = []
+ for subdir in ('api', 'pylab_examples', 'widgets'):
+ origdir = os.path.join('build', rootdir, subdir)
+ thumbdir = os.path.join(outdir, rootdir, subdir, 'thumbnails')
+ if not os.path.exists(thumbdir):
+ os.makedirs(thumbdir)
+ print subdir,
+
+ for filename in sorted(glob.glob(os.path.join(origdir, '*.png'))):
+ if filename.endswith("hires.png"):
+ continue
+
+ path, filename = os.path.split(filename)
+ basename, ext = os.path.splitext(filename)
+ if basename in skips:
+ sys.stdout.write('[skipping %s]' % basename)
+ sys.stdout.flush()
+ continue
+
+ # Create thumbnails based on images in tmpdir, and place
+ # them within the build tree
+ image.thumbnail(
+ str(os.path.join(origdir, filename)),
+ str(os.path.join(thumbdir, filename)),
+ scale=0.3)
+
+ m = multiimage.match(basename)
+ if m is None:
+ pyfile = '%s.py'%basename
+ else:
+ basename = m.group(1)
+ pyfile = '%s.py'%basename
+
+ data.append((subdir, basename,
+ os.path.join(rootdir, subdir, 'thumbnails', filename)))
+
+ sys.stdout.write(".")
+ sys.stdout.flush()
+ print
+
+ link_template = """\
+ <a href="%s"><img src="%s" border="0" alt="%s"/></a>
+ """
+
+ if len(data) == 0:
+ warnings.warn("No thumbnails were found")
+
+ rows = []
+ for (subdir, basename, thumbfile) in data:
+ if thumbfile is not None:
+ link = 'examples/%s/%s.html'%(subdir, basename)
+ rows.append(link_template%(link, thumbfile, basename))
+
+ fh = file(os.path.join(app.builder.srcdir, '_templates', 'gallery.html'),
+ 'w')
+ fh.write(template%'\n'.join(rows))
+ fh.close()
+
+def setup(app):
+ app.connect('env-updated', gen_gallery)
Modified: trunk/matplotlib/doc/sphinxext/inheritance_diagram.py
===================================================================
--- trunk/matplotlib/doc/sphinxext/inheritance_diagram.py 2008-12-17 19:06:30 UTC (rev 6653)
+++ trunk/matplotlib/doc/sphinxext/inheritance_diagram.py 2008-12-17 21:15:30 UTC (rev 6654)
@@ -272,12 +272,16 @@
"""
pass
-def inheritance_diagram_directive_run(class_names, options, state):
+def inheritance_diagram_directive(name, arguments, options, content, lineno,
+ content_offset, block_text, state,
+ state_machine):
"""
Run when the inheritance_diagram directive is first encountered.
"""
node = inheritance_diagram()
+ class_names = arguments
+
# Create a graph starting with the list of classes
graph = InheritanceGraph(class_names)
@@ -310,16 +314,13 @@
graph_hash = get_graph_hash(node)
name = "inheritance%s" % graph_hash
- png_path = os.path.join('_static', name + ".png")
+ path = '_images'
+ dest_path = os.path.join(setup.app.builder.outdir, path)
+ if not os.path.exists(dest_path):
+ os.makedirs(dest_path)
+ png_path = os.path.join(dest_path, name + ".png")
+ path = setup.app.builder.imgpath
- path = '_static'
- source = self.document.attributes['source']
- count = source.split('/doc/')[-1].count('/'...
[truncated message content] |
|
From: <js...@us...> - 2008-12-17 19:06:42
|
Revision: 6653
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6653&view=rev
Author: jswhit
Date: 2008-12-17 19:06:30 +0000 (Wed, 17 Dec 2008)
Log Message:
-----------
updated install instructions
Modified Paths:
--------------
trunk/toolkits/basemap/README
Modified: trunk/toolkits/basemap/README
===================================================================
--- trunk/toolkits/basemap/README 2008-12-17 16:52:39 UTC (rev 6652)
+++ trunk/toolkits/basemap/README 2008-12-17 19:06:30 UTC (rev 6653)
@@ -71,7 +71,16 @@
1) Then download basemap-X.Y.Z.tar.gz (approx 100 mb) from
the sourceforge download site, unpack and cd to basemap-X.Y.Z.
+Note that most of that size consists of coastline data, which
+does not change with every release. When it does change, it is
+noted in the Changelog. If you already have the latest data installed,
+you can download basemap-nodata-X.Y.Z.tar.gz instead, which is
+*much* smaller.
+By default the data is installed in the same directory as the toolkit.
+You may move it if you wish, and set the environment variable
+BASEMAPDATA to point to the new location.
+
2) Install the GEOS library. If you already have it on your
system, just set the environment variable GEOS_DIR to point to the location
of libgeos_c and geos_c.h (if libgeos_c is in /usr/local/lib and
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-12-17 16:52:49
|
Revision: 6652
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6652&view=rev
Author: mdboom
Date: 2008-12-17 16:52:39 +0000 (Wed, 17 Dec 2008)
Log Message:
-----------
Massive documentation build improvements. See e-mail on matplotlib-devel.
Modified Paths:
--------------
branches/v0_98_5_maint/doc/README.txt
branches/v0_98_5_maint/doc/conf.py
branches/v0_98_5_maint/doc/make.py
branches/v0_98_5_maint/doc/sphinxext/inheritance_diagram.py
branches/v0_98_5_maint/doc/sphinxext/mathmpl.py
branches/v0_98_5_maint/doc/sphinxext/only_directives.py
branches/v0_98_5_maint/doc/sphinxext/plot_directive.py
Added Paths:
-----------
branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py
Removed Paths:
-------------
branches/v0_98_5_maint/doc/_templates/gallery.html
branches/v0_98_5_maint/doc/_templates/gen_gallery.py
Modified: branches/v0_98_5_maint/doc/README.txt
===================================================================
--- branches/v0_98_5_maint/doc/README.txt 2008-12-17 16:00:44 UTC (rev 6651)
+++ branches/v0_98_5_maint/doc/README.txt 2008-12-17 16:52:39 UTC (rev 6652)
@@ -35,3 +35,7 @@
for the initial run (which builds the example gallery) to be done,
then run "python make.py html" again. The top file of the results will
be ./build/html/index.html
+
+To build a smaller version of the documentation (without
+high-resolution PNGs and PDF examples), type "python make.py --small
+html".
Deleted: branches/v0_98_5_maint/doc/_templates/gallery.html
===================================================================
--- branches/v0_98_5_maint/doc/_templates/gallery.html 2008-12-17 16:00:44 UTC (rev 6651)
+++ branches/v0_98_5_maint/doc/_templates/gallery.html 2008-12-17 16:52:39 UTC (rev 6652)
@@ -1,526 +0,0 @@
-{% extends "layout.html" %}
-{% set title = "Thumbnail gallery" %}
-
-
-{% block body %}
-
-<h3>Click on any image to see full size image and source code</h3>
-<br/>
-
-<a href="examples/api/barchart_demo.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/barchart_demo.png" border="0" alt="barchart_demo"/></a>
-
-<a href="examples/api/bbox_intersect.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/bbox_intersect.png" border="0" alt="bbox_intersect"/></a>
-
-<a href="examples/api/collections_demo.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/collections_demo.png" border="0" alt="collections_demo"/></a>
-
-<a href="examples/api/color_cycle.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/color_cycle.png" border="0" alt="color_cycle"/></a>
-
-<a href="examples/api/colorbar_only.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/colorbar_only.png" border="0" alt="colorbar_only"/></a>
-
-<a href="examples/api/custom_projection_example.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/custom_projection_example.png" border="0" alt="custom_projection_example"/></a>
-
-<a href="examples/api/custom_scale_example.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/custom_scale_example.png" border="0" alt="custom_scale_example"/></a>
-
-<a href="examples/api/date_demo.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/date_demo.png" border="0" alt="date_demo"/></a>
-
-<a href="examples/api/date_index_formatter.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/date_index_formatter_00.png" border="0" alt="date_index_formatter"/></a>
-
-<a href="examples/api/date_index_formatter.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/date_index_formatter_01.png" border="0" alt="date_index_formatter"/></a>
-
-<a href="examples/api/donut_demo.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/donut_demo.png" border="0" alt="donut_demo"/></a>
-
-<a href="examples/api/histogram_demo.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/histogram_demo.png" border="0" alt="histogram_demo"/></a>
-
-<a href="examples/api/image_zcoord.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/image_zcoord.png" border="0" alt="image_zcoord"/></a>
-
-<a href="examples/api/legend_demo.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/legend_demo.png" border="0" alt="legend_demo"/></a>
-
-<a href="examples/api/line_with_text.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/line_with_text.png" border="0" alt="line_with_text"/></a>
-
-<a href="examples/api/logo2.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/logo2.png" border="0" alt="logo2"/></a>
-
-<a href="examples/api/mathtext_asarray.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/mathtext_asarray.png" border="0" alt="mathtext_asarray"/></a>
-
-<a href="examples/api/patch_collection.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/patch_collection.png" border="0" alt="patch_collection"/></a>
-
-<a href="examples/api/path_patch_demo.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/path_patch_demo.png" border="0" alt="path_patch_demo"/></a>
-
-<a href="examples/api/quad_bezier.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/quad_bezier.png" border="0" alt="quad_bezier"/></a>
-
-<a href="examples/api/scatter_piecharts.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/scatter_piecharts.png" border="0" alt="scatter_piecharts"/></a>
-
-<a href="examples/api/span_regions.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/span_regions.png" border="0" alt="span_regions"/></a>
-
-<a href="examples/api/two_scales.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/two_scales.png" border="0" alt="two_scales"/></a>
-
-<a href="examples/api/unicode_minus.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/unicode_minus.png" border="0" alt="unicode_minus"/></a>
-
-<a href="examples/api/watermark_image.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/watermark_image.png" border="0" alt="watermark_image"/></a>
-
-<a href="examples/api/watermark_text.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/watermark_text.png" border="0" alt="watermark_text"/></a>
-
-<a href="examples/pylab_examples/accented_text.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/accented_text.png" border="0" alt="accented_text"/></a>
-
-<a href="examples/pylab_examples/agg_buffer_to_array.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/agg_buffer_to_array_00.png" border="0" alt="agg_buffer_to_array"/></a>
-
-<a href="examples/pylab_examples/agg_buffer_to_array.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/agg_buffer_to_array_01.png" border="0" alt="agg_buffer_to_array"/></a>
-
-<a href="examples/pylab_examples/alignment_test.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/alignment_test.png" border="0" alt="alignment_test"/></a>
-
-<a href="examples/pylab_examples/annotation_demo2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/annotation_demo2_00.png" border="0" alt="annotation_demo2"/></a>
-
-<a href="examples/pylab_examples/annotation_demo2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/annotation_demo2_01.png" border="0" alt="annotation_demo2"/></a>
-
-<a href="examples/pylab_examples/annotation_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/annotation_demo_00.png" border="0" alt="annotation_demo"/></a>
-
-<a href="examples/pylab_examples/annotation_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/annotation_demo_01.png" border="0" alt="annotation_demo"/></a>
-
-<a href="examples/pylab_examples/annotation_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/annotation_demo_02.png" border="0" alt="annotation_demo"/></a>
-
-<a href="examples/pylab_examples/anscombe.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/anscombe.png" border="0" alt="anscombe"/></a>
-
-<a href="examples/pylab_examples/arctest.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/arctest.png" border="0" alt="arctest"/></a>
-
-<a href="examples/pylab_examples/arrow_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/arrow_demo.png" border="0" alt="arrow_demo"/></a>
-
-<a href="examples/pylab_examples/axes_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/axes_demo.png" border="0" alt="axes_demo"/></a>
-
-<a href="examples/pylab_examples/axes_props.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/axes_props.png" border="0" alt="axes_props"/></a>
-
-<a href="examples/pylab_examples/axhspan_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/axhspan_demo.png" border="0" alt="axhspan_demo"/></a>
-
-<a href="examples/pylab_examples/axis_equal_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/axis_equal_demo.png" border="0" alt="axis_equal_demo"/></a>
-
-<a href="examples/pylab_examples/bar_stacked.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/bar_stacked.png" border="0" alt="bar_stacked"/></a>
-
-<a href="examples/pylab_examples/barb_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/barb_demo.png" border="0" alt="barb_demo"/></a>
-
-<a href="examples/pylab_examples/barchart_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/barchart_demo.png" border="0" alt="barchart_demo"/></a>
-
-<a href="examples/pylab_examples/barcode_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/barcode_demo.png" border="0" alt="barcode_demo"/></a>
-
-<a href="examples/pylab_examples/barh_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/barh_demo_00.png" border="0" alt="barh_demo"/></a>
-
-<a href="examples/pylab_examples/barh_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/barh_demo_01.png" border="0" alt="barh_demo"/></a>
-
-<a href="examples/pylab_examples/boxplot_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/boxplot_demo_00.png" border="0" alt="boxplot_demo"/></a>
-
-<a href="examples/pylab_examples/boxplot_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/boxplot_demo_01.png" border="0" alt="boxplot_demo"/></a>
-
-<a href="examples/pylab_examples/boxplot_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/boxplot_demo_02.png" border="0" alt="boxplot_demo"/></a>
-
-<a href="examples/pylab_examples/boxplot_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/boxplot_demo_03.png" border="0" alt="boxplot_demo"/></a>
-
-<a href="examples/pylab_examples/boxplot_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/boxplot_demo_04.png" border="0" alt="boxplot_demo"/></a>
-
-<a href="examples/pylab_examples/boxplot_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/boxplot_demo_05.png" border="0" alt="boxplot_demo"/></a>
-
-<a href="examples/pylab_examples/boxplot_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/boxplot_demo_06.png" border="0" alt="boxplot_demo"/></a>
-
-<a href="examples/pylab_examples/break.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/break.png" border="0" alt="break"/></a>
-
-<a href="examples/pylab_examples/broken_barh.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/broken_barh.png" border="0" alt="broken_barh"/></a>
-
-<a href="examples/pylab_examples/clippedline.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/clippedline.png" border="0" alt="clippedline"/></a>
-
-<a href="examples/pylab_examples/cohere_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/cohere_demo.png" border="0" alt="cohere_demo"/></a>
-
-<a href="examples/pylab_examples/color_by_yvalue.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/color_by_yvalue.png" border="0" alt="color_by_yvalue"/></a>
-
-<a href="examples/pylab_examples/color_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/color_demo.png" border="0" alt="color_demo"/></a>
-
-<a href="examples/pylab_examples/colorbar_tick_labelling_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/colorbar_tick_labelling_demo_00.png" border="0" alt="colorbar_tick_labelling_demo"/></a>
-
-<a href="examples/pylab_examples/colorbar_tick_labelling_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/colorbar_tick_labelling_demo_01.png" border="0" alt="colorbar_tick_labelling_demo"/></a>
-
-<a href="examples/pylab_examples/contour_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/contour_demo_00.png" border="0" alt="contour_demo"/></a>
-
-<a href="examples/pylab_examples/contour_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/contour_demo_01.png" border="0" alt="contour_demo"/></a>
-
-<a href="examples/pylab_examples/contour_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/contour_demo_02.png" border="0" alt="contour_demo"/></a>
-
-<a href="examples/pylab_examples/contour_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/contour_demo_03.png" border="0" alt="contour_demo"/></a>
-
-<a href="examples/pylab_examples/contour_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/contour_demo_04.png" border="0" alt="contour_demo"/></a>
-
-<a href="examples/pylab_examples/contour_image.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/contour_image.png" border="0" alt="contour_image"/></a>
-
-<a href="examples/pylab_examples/contour_label_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/contour_label_demo_00.png" border="0" alt="contour_label_demo"/></a>
-
-<a href="examples/pylab_examples/contour_label_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/contour_label_demo_01.png" border="0" alt="contour_label_demo"/></a>
-
-<a href="examples/pylab_examples/contourf_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/contourf_demo_00.png" border="0" alt="contourf_demo"/></a>
-
-<a href="examples/pylab_examples/contourf_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/contourf_demo_01.png" border="0" alt="contourf_demo"/></a>
-
-<a href="examples/pylab_examples/contourf_log.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/contourf_log.png" border="0" alt="contourf_log"/></a>
-
-<a href="examples/pylab_examples/coords_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/coords_demo.png" border="0" alt="coords_demo"/></a>
-
-<a href="examples/pylab_examples/coords_report.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/coords_report.png" border="0" alt="coords_report"/></a>
-
-<a href="examples/pylab_examples/csd_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/csd_demo.png" border="0" alt="csd_demo"/></a>
-
-<a href="examples/pylab_examples/custom_cmap.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/custom_cmap.png" border="0" alt="custom_cmap"/></a>
-
-<a href="examples/pylab_examples/custom_figure_class.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/custom_figure_class.png" border="0" alt="custom_figure_class"/></a>
-
-<a href="examples/pylab_examples/custom_ticker1.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/custom_ticker1.png" border="0" alt="custom_ticker1"/></a>
-
-<a href="examples/pylab_examples/customize_rc.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/customize_rc.png" border="0" alt="customize_rc"/></a>
-
-<a href="examples/pylab_examples/dannys_example.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/dannys_example.png" border="0" alt="dannys_example"/></a>
-
-<a href="examples/pylab_examples/dash_control.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/dash_control.png" border="0" alt="dash_control"/></a>
-
-<a href="examples/pylab_examples/dashpointlabel.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/dashpointlabel.png" border="0" alt="dashpointlabel"/></a>
-
-<a href="examples/pylab_examples/date_demo1.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/date_demo1.png" border="0" alt="date_demo1"/></a>
-
-<a href="examples/pylab_examples/date_demo2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/date_demo2.png" border="0" alt="date_demo2"/></a>
-
-<a href="examples/pylab_examples/date_demo_convert.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/date_demo_convert.png" border="0" alt="date_demo_convert"/></a>
-
-<a href="examples/pylab_examples/date_demo_rrule.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/date_demo_rrule.png" border="0" alt="date_demo_rrule"/></a>
-
-<a href="examples/pylab_examples/date_index_formatter.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/date_index_formatter.png" border="0" alt="date_index_formatter"/></a>
-
-<a href="examples/pylab_examples/dolphin.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/dolphin.png" border="0" alt="dolphin"/></a>
-
-<a href="examples/pylab_examples/ellipse_collection.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/ellipse_collection.png" border="0" alt="ellipse_collection"/></a>
-
-<a href="examples/pylab_examples/ellipse_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/ellipse_demo.png" border="0" alt="ellipse_demo"/></a>
-
-<a href="examples/pylab_examples/ellipse_rotated.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/ellipse_rotated.png" border="0" alt="ellipse_rotated"/></a>
-
-<a href="examples/pylab_examples/equal_aspect_ratio.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/equal_aspect_ratio.png" border="0" alt="equal_aspect_ratio"/></a>
-
-<a href="examples/pylab_examples/errorbar_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/errorbar_demo_00.png" border="0" alt="errorbar_demo"/></a>
-
-<a href="examples/pylab_examples/errorbar_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/errorbar_demo_01.png" border="0" alt="errorbar_demo"/></a>
-
-<a href="examples/pylab_examples/errorbar_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/errorbar_demo_02.png" border="0" alt="errorbar_demo"/></a>
-
-<a href="examples/pylab_examples/errorbar_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/errorbar_demo_03.png" border="0" alt="errorbar_demo"/></a>
-
-<a href="examples/pylab_examples/errorbar_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/errorbar_demo_04.png" border="0" alt="errorbar_demo"/></a>
-
-<a href="examples/pylab_examples/errorbar_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/errorbar_demo_05.png" border="0" alt="errorbar_demo"/></a>
-
-<a href="examples/pylab_examples/errorbar_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/errorbar_demo_06.png" border="0" alt="errorbar_demo"/></a>
-
-<a href="examples/pylab_examples/errorbar_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/errorbar_demo_07.png" border="0" alt="errorbar_demo"/></a>
-
-<a href="examples/pylab_examples/errorbar_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/errorbar_demo_08.png" border="0" alt="errorbar_demo"/></a>
-
-<a href="examples/pylab_examples/errorbar_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/errorbar_demo_09.png" border="0" alt="errorbar_demo"/></a>
-
-<a href="examples/pylab_examples/errorbar_limits.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/errorbar_limits_00.png" border="0" alt="errorbar_limits"/></a>
-
-<a href="examples/pylab_examples/errorbar_limits.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/errorbar_limits_01.png" border="0" alt="errorbar_limits"/></a>
-
-<a href="examples/pylab_examples/fancyarrow_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fancyarrow_demo.png" border="0" alt="fancyarrow_demo"/></a>
-
-<a href="examples/pylab_examples/fancybox_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fancybox_demo.png" border="0" alt="fancybox_demo"/></a>
-
-<a href="examples/pylab_examples/fancybox_demo2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fancybox_demo2.png" border="0" alt="fancybox_demo2"/></a>
-
-<a href="examples/pylab_examples/fancytextbox_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fancytextbox_demo.png" border="0" alt="fancytextbox_demo"/></a>
-
-<a href="examples/pylab_examples/figimage_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/figimage_demo.png" border="0" alt="figimage_demo"/></a>
-
-<a href="examples/pylab_examples/figlegend_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/figlegend_demo.png" border="0" alt="figlegend_demo"/></a>
-
-<a href="examples/pylab_examples/figure_title.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/figure_title.png" border="0" alt="figure_title"/></a>
-
-<a href="examples/pylab_examples/fill_between.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fill_between_00.png" border="0" alt="fill_between"/></a>
-
-<a href="examples/pylab_examples/fill_between.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fill_between_01.png" border="0" alt="fill_between"/></a>
-
-<a href="examples/pylab_examples/fill_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fill_demo.png" border="0" alt="fill_demo"/></a>
-
-<a href="examples/pylab_examples/fill_demo2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fill_demo2.png" border="0" alt="fill_demo2"/></a>
-
-<a href="examples/pylab_examples/fill_spiral.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fill_spiral.png" border="0" alt="fill_spiral"/></a>
-
-<a href="examples/pylab_examples/finance_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/finance_demo.png" border="0" alt="finance_demo"/></a>
-
-<a href="examples/pylab_examples/finance_work2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/finance_work2.png" border="0" alt="finance_work2"/></a>
-
-<a href="examples/pylab_examples/findobj_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/findobj_demo.png" border="0" alt="findobj_demo"/></a>
-
-<a href="examples/pylab_examples/fonts_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fonts_demo.png" border="0" alt="fonts_demo"/></a>
-
-<a href="examples/pylab_examples/fonts_demo_kw.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fonts_demo_kw.png" border="0" alt="fonts_demo_kw"/></a>
-
-<a href="examples/pylab_examples/ganged_plots.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/ganged_plots.png" border="0" alt="ganged_plots"/></a>
-
-<a href="examples/pylab_examples/geo_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/geo_demo.png" border="0" alt="geo_demo"/></a>
-
-<a href="examples/pylab_examples/gradient_bar.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/gradient_bar.png" border="0" alt="gradient_bar"/></a>
-
-<a href="examples/pylab_examples/griddata_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/griddata_demo.png" border="0" alt="griddata_demo"/></a>
-
-<a href="examples/pylab_examples/hatch_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/hatch_demo.png" border="0" alt="hatch_demo"/></a>
-
-<a href="examples/pylab_examples/hexbin_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/hexbin_demo.png" border="0" alt="hexbin_demo"/></a>
-
-<a href="examples/pylab_examples/hexbin_demo2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/hexbin_demo2.png" border="0" alt="hexbin_demo2"/></a>
-
-<a href="examples/pylab_examples/hist_colormapped.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/hist_colormapped.png" border="0" alt="hist_colormapped"/></a>
-
-<a href="examples/pylab_examples/histogram_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/histogram_demo.png" border="0" alt="histogram_demo"/></a>
-
-<a href="examples/pylab_examples/histogram_demo_extended.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/histogram_demo_extended_00.png" border="0" alt="histogram_demo_extended"/></a>
-
-<a href="examples/pylab_examples/histogram_demo_extended.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/histogram_demo_extended_01.png" border="0" alt="histogram_demo_extended"/></a>
-
-<a href="examples/pylab_examples/histogram_demo_extended.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/histogram_demo_extended_02.png" border="0" alt="histogram_demo_extended"/></a>
-
-<a href="examples/pylab_examples/histogram_demo_extended.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/histogram_demo_extended_03.png" border="0" alt="histogram_demo_extended"/></a>
-
-<a href="examples/pylab_examples/histogram_demo_extended.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/histogram_demo_extended_04.png" border="0" alt="histogram_demo_extended"/></a>
-
-<a href="examples/pylab_examples/histogram_demo_extended.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/histogram_demo_extended_05.png" border="0" alt="histogram_demo_extended"/></a>
-
-<a href="examples/pylab_examples/hline_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/hline_demo.png" border="0" alt="hline_demo"/></a>
-
-<a href="examples/pylab_examples/image_clip_path.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/image_clip_path.png" border="0" alt="image_clip_path"/></a>
-
-<a href="examples/pylab_examples/image_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/image_demo.png" border="0" alt="image_demo"/></a>
-
-<a href="examples/pylab_examples/image_demo2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/image_demo2.png" border="0" alt="image_demo2"/></a>
-
-<a href="examples/pylab_examples/image_demo3.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/image_demo3.png" border="0" alt="image_demo3"/></a>
-
-<a href="examples/pylab_examples/image_interp.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/image_interp_00.png" border="0" alt="image_interp"/></a>
-
-<a href="examples/pylab_examples/image_interp.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/image_interp_01.png" border="0" alt="image_interp"/></a>
-
-<a href="examples/pylab_examples/image_interp.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/image_interp_02.png" border="0" alt="image_interp"/></a>
-
-<a href="examples/pylab_examples/image_masked.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/image_masked.png" border="0" alt="image_masked"/></a>
-
-<a href="examples/pylab_examples/image_nonuniform.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/image_nonuniform.png" border="0" alt="image_nonuniform"/></a>
-
-<a href="examples/pylab_examples/image_origin.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/image_origin.png" border="0" alt="image_origin"/></a>
-
-<a href="examples/pylab_examples/image_slices_viewer.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/image_slices_viewer.png" border="0" alt="image_slices_viewer"/></a>
-
-<a href="examples/pylab_examples/integral_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/integral_demo.png" border="0" alt="integral_demo"/></a>
-
-<a href="examples/pylab_examples/interp_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/interp_demo.png" border="0" alt="interp_demo"/></a>
-
-<a href="examples/pylab_examples/invert_axes.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/invert_axes.png" border="0" alt="invert_axes"/></a>
-
-<a href="examples/pylab_examples/layer_images.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/layer_images.png" border="0" alt="layer_images"/></a>
-
-<a href="examples/pylab_examples/legend_auto.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_auto_00.png" border="0" alt="legend_auto"/></a>
-
-<a href="examples/pylab_examples/legend_auto.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_auto_01.png" border="0" alt="legend_auto"/></a>
-
-<a href="examples/pylab_examples/legend_auto.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_auto_02.png" border="0" alt="legend_auto"/></a>
-
-<a href="examples/pylab_examples/legend_auto.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_auto_03.png" border="0" alt="legend_auto"/></a>
-
-<a href="examples/pylab_examples/legend_auto.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_auto_04.png" border="0" alt="legend_auto"/></a>
-
-<a href="examples/pylab_examples/legend_auto.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_auto_05.png" border="0" alt="legend_auto"/></a>
-
-<a href="examples/pylab_examples/legend_auto.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_auto_06.png" border="0" alt="legend_auto"/></a>
-
-<a href="examples/pylab_examples/legend_auto.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_auto_07.png" border="0" alt="legend_auto"/></a>
-
-<a href="examples/pylab_examples/legend_auto.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_auto_08.png" border="0" alt="legend_auto"/></a>
-
-<a href="examples/pylab_examples/legend_auto.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_auto_09.png" border="0" alt="legend_auto"/></a>
-
-<a href="examples/pylab_examples/legend_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_demo.png" border="0" alt="legend_demo"/></a>
-
-<a href="examples/pylab_examples/legend_demo2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_demo2.png" border="0" alt="legend_demo2"/></a>
-
-<a href="examples/pylab_examples/legend_demo3.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_demo3.png" border="0" alt="legend_demo3"/></a>
-
-<a href="examples/pylab_examples/legend_scatter.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_scatter.png" border="0" alt="legend_scatter"/></a>
-
-<a href="examples/pylab_examples/line_collection.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/line_collection.png" border="0" alt="line_collection"/></a>
-
-<a href="examples/pylab_examples/line_collection2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/line_collection2.png" border="0" alt="line_collection2"/></a>
-
-<a href="examples/pylab_examples/line_styles.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/line_styles.png" border="0" alt="line_styles"/></a>
-
-<a href="examples/pylab_examples/load_converter.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/load_converter.png" border="0" alt="load_converter"/></a>
-
-<a href="examples/pylab_examples/loadrec.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/loadrec.png" border="0" alt="loadrec"/></a>
-
-<a href="examples/pylab_examples/log_bar.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/log_bar.png" border="0" alt="log_bar"/></a>
-
-<a href="examples/pylab_examples/log_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/log_demo.png" border="0" alt="log_demo"/></a>
-
-<a href="examples/pylab_examples/log_test.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/log_test.png" border="0" alt="log_test"/></a>
-
-<a href="examples/pylab_examples/logo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/logo.png" border="0" alt="logo"/></a>
-
-<a href="examples/pylab_examples/major_minor_demo1.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/major_minor_demo1.png" border="0" alt="major_minor_demo1"/></a>
-
-<a href="examples/pylab_examples/major_minor_demo2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/major_minor_demo2.png" border="0" alt="major_minor_demo2"/></a>
-
-<a href="examples/pylab_examples/manual_axis.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/manual_axis.png" border="0" alt="manual_axis"/></a>
-
-<a href="examples/pylab_examples/masked_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/masked_demo.png" border="0" alt="masked_demo"/></a>
-
-<a href="examples/pylab_examples/mathtext_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/mathtext_demo.png" border="0" alt="mathtext_demo"/></a>
-
-<a href="examples/pylab_examples/matshow.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/matshow_00.png" border="0" alt="matshow"/></a>
-
-<a href="examples/pylab_examples/matshow.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/matshow_01.png" border="0" alt="matshow"/></a>
-
-<a href="examples/pylab_examples/matshow.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/matshow_04.png" border="0" alt="matshow"/></a>
-
-<a href="examples/pylab_examples/mri_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/mri_demo.png" border="0" alt="mri_demo"/></a>
-
-<a href="examples/pylab_examples/mri_with_eeg.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/mri_with_eeg.png" border="0" alt="mri_with_eeg"/></a>
-
-<a href="examples/pylab_examples/multi_image.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/multi_image.png" border="0" alt="multi_image"/></a>
-
-<a href="examples/pylab_examples/multiline.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/multiline.png" border="0" alt="multiline"/></a>
-
-<a href="examples/pylab_examples/multiple_figs_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/multiple_figs_demo_00.png" border="0" alt="multiple_figs_demo"/></a>
-
-<a href="examples/pylab_examples/multiple_figs_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/multiple_figs_demo_01.png" border="0" alt="multiple_figs_demo"/></a>
-
-<a href="examples/pylab_examples/nan_test.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/nan_test.png" border="0" alt="nan_test"/></a>
-
-<a href="examples/pylab_examples/newscalarformatter_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/newscalarformatter_demo_00.png" border="0" alt="newscalarformatter_demo"/></a>
-
-<a href="examples/pylab_examples/newscalarformatter_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/newscalarformatter_demo_01.png" border="0" alt="newscalarformatter_demo"/></a>
-
-<a href="examples/pylab_examples/newscalarformatter_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/newscalarformatter_demo_02.png" border="0" alt="newscalarformatter_demo"/></a>
-
-<a href="examples/pylab_examples/newscalarformatter_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/newscalarformatter_demo_03.png" border="0" alt="newscalarformatter_demo"/></a>
-
-<a href="examples/pylab_examples/pcolor_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/pcolor_demo.png" border="0" alt="pcolor_demo"/></a>
-
-<a href="examples/pylab_examples/pcolor_demo2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/pcolor_demo2.png" border="0" alt="pcolor_demo2"/></a>
-
-<a href="examples/pylab_examples/pcolor_log.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/pcolor_log.png" border="0" alt="pcolor_log"/></a>
-
-<a href="examples/pylab_examples/pcolor_small.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/pcolor_small.png" border="0" alt="pcolor_small"/></a>
-
-<a href="examples/pylab_examples/pie_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/pie_demo.png" border="0" alt="pie_demo"/></a>
-
-<a href="examples/pylab_examples/plotfile_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/plotfile_demo_00.png" border="0" alt="plotfile_demo"/></a>
-
-<a href="examples/pylab_examples/plotfile_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/plotfile_demo_01.png" border="0" alt="plotfile_demo"/></a>
-
-<a href="examples/pylab_examples/plotfile_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/plotfile_demo_02.png" border="0" alt="plotfile_demo"/></a>
-
-<a href="examples/pylab_examples/plotfile_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/plotfile_demo_03.png" border="0" alt="plotfile_demo"/></a>
-
-<a href="examples/pylab_examples/plotfile_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/plotfile_demo_04.png" border="0" alt="plotfile_demo"/></a>
-
-<a href="examples/pylab_examples/polar_bar.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/polar_bar.png" border="0" alt="polar_bar"/></a>
-
-<a href="examples/pylab_examples/polar_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/polar_demo.png" border="0" alt="polar_demo"/></a>
-
-<a href="examples/pylab_examples/polar_legend.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/polar_legend.png" border="0" alt="polar_legend"/></a>
-
-<a href="examples/pylab_examples/polar_scatter.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/polar_scatter.png" border="0" alt="polar_scatter"/></a>
-
-<a href="examples/pylab_examples/poormans_contour.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/poormans_contour.png" border="0" alt="poormans_contour"/></a>
-
-<a href="examples/pylab_examples/psd_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/psd_demo.png" border="0" alt="psd_demo"/></a>
-
-<a href="examples/pylab_examples/psd_demo2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/psd_demo2.png" border="0" alt="psd_demo2"/></a>
-
-<a href="examples/pylab_examples/psd_demo3.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/psd_demo3.png" border="0" alt="psd_demo3"/></a>
-
-<a href="examples/pylab_examples/pythonic_matplotlib.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/pythonic_matplotlib.png" border="0" alt="pythonic_matplotlib"/></a>
-
-<a href="examples/pylab_examples/quadmesh_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/quadmesh_demo.png" border="0" alt="quadmesh_demo"/></a>
-
-<a href="examples/pylab_examples/quiver_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/quiver_demo_00.png" border="0" alt="quiver_demo"/></a>
-
-<a href="examples/pylab_examples/quiver_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/quiver_demo_01.png" border="0" alt="quiver_demo"/></a>
-
-<a href="examples/pylab_examples/quiver_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/quiver_demo_02.png" border="0" alt="quiver_demo"/></a>
-
-<a href="examples/pylab_examples/quiver_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/quiver_demo_03.png" border="0" alt="quiver_demo"/></a>
-
-<a href="examples/pylab_examples/quiver_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/quiver_demo_04.png" border="0" alt="quiver_demo"/></a>
-
-<a href="examples/pylab_examples/quiver_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/quiver_demo_05.png" border="0" alt="quiver_demo"/></a>
-
-<a href="examples/pylab_examples/scatter_custom_symbol.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/scatter_custom_symbol.png" border="0" alt="scatter_custom_symbol"/></a>
-
-<a href="examples/pylab_examples/scatter_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/scatter_demo.png" border="0" alt="scatter_demo"/></a>
-
-<a href="examples/pylab_examples/scatter_demo2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/scatter_demo2.png" border="0" alt="scatter_demo2"/></a>
-
-<a href="examples/pylab_examples/scatter_masked.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/scatter_masked.png" border="0" alt="scatter_masked"/></a>
-
-<a href="examples/pylab_examples/scatter_star_poly.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/scatter_star_poly.png" border="0" alt="scatter_star_poly"/></a>
-
-<a href="examples/pylab_examples/set_and_get.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/set_and_get.png" border="0" alt="set_and_get"/></a>
-
-<a href="examples/pylab_examples/shared_axis_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/shared_axis_demo.png" border="0" alt="shared_axis_demo"/></a>
-
-<a href="examples/pylab_examples/simple_plot.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/simple_plot.png" border="0" alt="simple_plot"/></a>
-
-<a href="examples/pylab_examples/simplification_clipping_test.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/simplification_clipping_test.png" border="0" alt="simplification_clipping_test"/></a>
-
-<a href="examples/pylab_examples/specgram_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/specgram_demo.png" border="0" alt="specgram_demo"/></a>
-
-<a href="examples/pylab_examples/spy_demos.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/spy_demos.png" border="0" alt="spy_demos"/></a>
-
-<a href="examples/pylab_examples/stem_plot.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/stem_plot.png" border="0" alt="stem_plot"/></a>
-
-<a href="examples/pylab_examples/step_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/step_demo.png" border="0" alt="step_demo"/></a>
-
-<a href="examples/pylab_examples/stix_fonts_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/stix_fonts_demo.png" border="0" alt="stix_fonts_demo"/></a>
-
-<a href="examples/pylab_examples/subplot_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/subplot_demo.png" border="0" alt="subplot_demo"/></a>
-
-<a href="examples/pylab_examples/subplot_toolbar.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/subplot_toolbar_00.png" border="0" alt="subplot_toolbar"/></a>
-
-<a href="examples/pylab_examples/subplot_toolbar.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/subplot_toolbar_01.png" border="0" alt="subplot_toolbar"/></a>
-
-<a href="examples/pylab_examples/subplots_adjust.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/subplots_adjust.png" border="0" alt="subplots_adjust"/></a>
-
-<a href="examples/pylab_examples/symlog_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/symlog_demo.png" border="0" alt="symlog_demo"/></a>
-
-<a href="examples/pylab_examples/table_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/table_demo.png" border="0" alt="table_demo"/></a>
-
-<a href="examples/pylab_examples/tex_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/tex_demo.png" border="0" alt="tex_demo"/></a>
-
-<a href="examples/pylab_examples/text_handles.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/text_handles.png" border="0" alt="text_handles"/></a>
-
-<a href="examples/pylab_examples/text_rotation.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/text_rotation.png" border="0" alt="text_rotation"/></a>
-
-<a href="examples/pylab_examples/text_rotation_relative_to_line.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/text_rotation_relative_to_line.png" border="0" alt="text_rotation_relative_to_line"/></a>
-
-<a href="examples/pylab_examples/text_themes.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/text_themes.png" border="0" alt="text_themes"/></a>
-
-<a href="examples/pylab_examples/to_numeric.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/to_numeric.png" border="0" alt="to_numeric"/></a>
-
-<a href="examples/pylab_examples/toggle_images.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/toggle_images.png" border="0" alt="toggle_images"/></a>
-
-<a href="examples/pylab_examples/transoffset.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/transoffset.png" border="0" alt="transoffset"/></a>
-
-<a href="examples/pylab_examples/unicode_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/unicode_demo.png" border="0" alt="unicode_demo"/></a>
-
-<a href="examples/pylab_examples/usetex_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/usetex_demo.png" border="0" alt="usetex_demo"/></a>
-
-<a href="examples/pylab_examples/vertical_ticklabels.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/vertical_ticklabels.png" border="0" alt="vertical_ticklabels"/></a>
-
-<a href="examples/pylab_examples/vline_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/vline_demo.png" border="0" alt="vline_demo"/></a>
-
-<a href="examples/pylab_examples/xcorr_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/xcorr_demo.png" border="0" alt="xcorr_demo"/></a>
-
-<a href="examples/pylab_examples/zorder_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/zorder_demo_00.png" border="0" alt="zorder_demo"/></a>
-
-<a href="examples/pylab_examples/zorder_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/zorder_demo_01.png" border="0" alt="zorder_demo"/></a>
-
-<a href="examples/widgets/slider_demo.html"><img src="_static/plot_directive/mpl_examples/widgets/thumbnails/slider_demo.png" border="0" alt="slider_demo"/></a>
-
-{% endblock %}
Deleted: branches/v0_98_5_maint/doc/_templates/gen_gallery.py
===================================================================
--- branches/v0_98_5_maint/doc/_templates/gen_gallery.py 2008-12-17 16:00:44 UTC (rev 6651)
+++ branches/v0_98_5_maint/doc/_templates/gen_gallery.py 2008-12-17 16:52:39 UTC (rev 6652)
@@ -1,91 +0,0 @@
-# generate a thumbnail gallery of examples
-template = """\
-{%% extends "layout.html" %%}
-{%% set title = "Thumbnail gallery" %%}
-
-
-{%% block body %%}
-
-<h3>Click on any image to see full size image and source code</h3>
-<br/>
-
-%s
-{%% endblock %%}
-"""
-
-import os, glob, re
-
-multiimage = re.compile('(.*)_\d\d')
-
-pwd = os.getcwd()
-os.chdir('..')
-
-rootdir = '_static/plot_directive/mpl_examples'
-
-# images we want to skip for the gallery because they are an unusual
-# size that doesn't layout well in a table, or because they may be
-# redundant with other images or uninteresting
-skips = set([
- 'mathtext_examples',
- 'matshow_02',
- 'matshow_03',
- 'matplotlib_icon',
- ])
-data = []
-for subdir in ('api', 'pylab_examples', 'widgets'):
- thisdir = os.path.join(rootdir,subdir)
- if not os.path.exists(thisdir):
- raise RuntimeError('Cannot find %s'%thisdir)
- thumbdir = os.path.join(thisdir, 'thumbnails')
- if not os.path.exists(thumbdir):
- raise RuntimeError('Cannot find thumbnail dir %s'%thumbdir)
- #print thumbdir
-
- # we search for pdfs here because there is one pdf for each
- # successful image build (2 pngs since one is high res) and the
- # mapping between py files and images is 1->many
- for pdffile in sorted(glob.glob(os.path.join(thisdir, '*.pdf'))):
- basepath, filename = os.path.split(pdffile)
- basename, ext = os.path.splitext(filename)
- print 'generating', subdir, basename
-
- if basename in skips:
- print ' skipping', basename
- continue
- pngfile = os.path.join(thisdir, '%s.png'%basename)
- thumbfile = os.path.join(thumbdir, '%s.png'%basename)
- if not os.path.exists(pngfile):
- pngfile = None
- if not os.path.exists(thumbfile):
- thumbfile = None
-
- m = multiimage.match(basename)
- if m is None:
- pyfile = '%s.py'%basename
- else:
- basename = m.group(1)
- pyfile = '%s.py'%basename
-
- print ' ', pyfile, filename, basename, ext
-
- print ' ', pyfile, pngfile, thumbfile
- data.append((subdir, thisdir, pyfile, basename, pngfile, thumbfile))
-
-link_template = """\
-<a href="%s"><img src="%s" border="0" alt="%s"/></a>
-"""
-
-
-rows = []
-for (subdir, thisdir, pyfile, basename, pngfile, thumbfile) in data:
- if thumbfile is not None:
- link = 'examples/%s/%s.html'%(subdir, basename)
- rows.append(link_template%(link, thumbfile, basename))
-
-
-
-os.chdir(pwd)
-fh = file('gallery.html', 'w')
-fh.write(template%'\n'.join(rows))
-fh.close()
-
Modified: branches/v0_98_5_maint/doc/conf.py
===================================================================
--- branches/v0_98_5_maint/doc/conf.py 2008-12-17 16:00:44 UTC (rev 6651)
+++ branches/v0_98_5_maint/doc/conf.py 2008-12-17 16:52:39 UTC (rev 6652)
@@ -28,7 +28,8 @@
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['mathmpl', 'math_symbol_table', 'sphinx.ext.autodoc',
- 'only_directives', 'plot_directive', 'inheritance_diagram']
+ 'only_directives', 'plot_directive', 'inheritance_diagram',
+ 'gen_gallery']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
@@ -75,7 +76,11 @@
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
+# Plot directive configuration
+# ----------------------------
+plot_formats = ['png', 'hires.png', 'pdf']
+
# Options for HTML output
# -----------------------
Modified: branches/v0_98_5_maint/doc/make.py
===================================================================
--- branches/v0_98_5_maint/doc/make.py 2008-12-17 16:00:44 UTC (rev 6651)
+++ branches/v0_98_5_maint/doc/make.py 2008-12-17 16:52:39 UTC (rev 6652)
@@ -32,18 +32,17 @@
os.system('cd examples; svn-clean; python gen_rst.py')
#pass
-def gallery():
- 'make the thumbnail gallery'
- os.system('cd _templates; python gen_gallery.py')
-
-
def html():
check_build()
if not os.path.exists('examples/index.rst'):
examples()
shutil.copy('../lib/matplotlib/mpl-data/matplotlibrc', '_static/matplotlibrc')
#figs()
- if os.system('sphinx-build -b html -d build/doctrees . build/html'):
+ if small_docs:
+ options = "-D plot_formats=\"['png']\""
+ else:
+ options = ''
+ if os.system('sphinx-build %s -b html -d build/doctrees . build/html' % options):
raise SystemExit("Building HTML failed.")
figures_dest_path = 'build/html/pyplots'
@@ -51,10 +50,6 @@
shutil.rmtree(figures_dest_path)
shutil.copytree('pyplots', figures_dest_path)
- # rebuild the gallery
- gallery()
- print 'Just rebuilt gallery, you may need to make html again'
-
def latex():
check_build()
#figs()
@@ -96,12 +91,16 @@
'sf' : sf,
'sfpdf' : sfpdf,
'examples' : examples,
- 'gallery' : gallery,
'all' : all,
}
if len(sys.argv)>1:
+ if '--small' in sys.argv[1:]:
+ small_docs = True
+ sys.argv.remove('--small')
+ else:
+ small_docs = False
for arg in sys.argv[1:]:
func = funcd.get(arg)
if func is None:
Copied: branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py (from rev 6627, branches/v0_98_5_maint/doc/_templates/gen_gallery.py)
===================================================================
--- branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py (rev 0)
+++ branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py 2008-12-17 16:52:39 UTC (rev 6652)
@@ -0,0 +1,99 @@
+# generate a thumbnail gallery of examples
+template = """\
+{%% extends "layout.html" %%}
+{%% set title = "Thumbnail gallery" %%}
+
+
+{%% block body %%}
+
+<h3>Click on any image to see full size image and source code</h3>
+<br/>
+
+%s
+{%% endblock %%}
+"""
+
+import os, glob, re, sys, warnings
+import matplotlib.image as image
+
+multiimage = re.compile('(.*)_\d\d')
+
+def gen_gallery(app, doctree):
+ if app.builder.name != 'html':
+ return
+
+ outdir = app.builder.outdir
+ rootdir = 'plot_directive/mpl_examples'
+
+ # images we want to skip for the gallery because they are an unusual
+ # size that doesn't layout well in a table, or because they may be
+ # redundant with other images or uninteresting
+ skips = set([
+ 'mathtext_examples',
+ 'matshow_02',
+ 'matshow_03',
+ 'matplotlib_icon',
+ ])
+
+ print
+ print "generating gallery: ",
+ data = []
+ for subdir in ('api', 'pylab_examples', 'widgets'):
+ origdir = os.path.join('build', rootdir, subdir)
+ thumbdir = os.path.join(outdir, rootdir, subdir, 'thumbnails')
+ if not os.path.exists(thumbdir):
+ os.makedirs(thumbdir)
+ print subdir,
+
+ for filename in sorted(glob.glob(os.path.join(origdir, '*.png'))):
+ if filename.endswith("hires.png"):
+ continue
+
+ path, filename = os.path.split(filename)
+ basename, ext = os.path.splitext(filename)
+ if basename in skips:
+ sys.stdout.write('[skipping %s]' % basename)
+ sys.stdout.flush()
+ continue
+
+ # Create thumbnails based on images in tmpdir, and place
+ # them within the build tree
+ image.thumbnail(
+ str(os.path.join(origdir, filename)),
+ str(os.path.join(thumbdir, filename)),
+ scale=0.3)
+
+ m = multiimage.match(basename)
+ if m is None:
+ pyfile = '%s.py'%basename
+ else:
+ basename = m.group(1)
+ pyfile = '%s.py'%basename
+
+ data.append((subdir, basename,
+ os.path.join(rootdir, subdir, 'thumbnails', filename)))
+
+ sys.stdout.write(".")
+ sys.stdout.flush()
+ print
+
+ link_template = """\
+ <a href="%s"><img src="%s" border="0" alt="%s"/></a>
+ """
+
+ if len(data) == 0:
+ warnings.warn("No thumbnails were found")
+
+ rows = []
+ for (subdir, basename, thumbfile) in data:
+ if thumbfile is not None:
+ link = 'examples/%s/%s.html'%(subdir, basename)
+ rows.append(link_template%(link, thumbfile, basename))
+
+ fh = file(os.path.join(app.builder.srcdir, '_templates', 'gallery.html'),
+ 'w')
+ fh.write(template%'\n'.join(rows))
+ fh.close()
+
+def setup(app):
+ app.connect('env-updated', gen_gallery)
Property changes on: branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/v0_91_maint/doc/_templates/gen_gallery.py:5753-5771
Modified: branches/v0_98_5_maint/doc/sphinxext/inheritance_diagram.py
===================================================================
--- branches/v0_98_5_maint/doc/sphinxext/inheritance_diagram.py 2008-12-17 16:00:44 UTC (rev 6651)
+++ branches/v0_98_5_maint/doc/sphinxext/inheritance_diagram.py 2008-12-17 16:52:39 UTC (rev 6652)
@@ -272,12 +272,16 @@
"""
pass
-def inheritance_diagram_directive_run(class_names, options, state):
+def inheritance_diagram_directive(name, arguments, options, content, lineno,
+ content_offset, block_text, state,
+ state_machine):
"""
Run when the inheritance_diagram directive is first encountered.
"""
node = inheritance_diagram()
+ class_names = arguments
+
# Create a graph starting with the list of classes
graph = InheritanceGraph(class_names)
@@ -310,16 +314,13 @@
graph_hash = get_graph_hash(node)
name = "inheritance%s" % graph_hash
- png_path = os.path.join('_static', name + ".png")
+ path = '_images'
+ dest_path = os.path.join(setup.app.builder.outdir, path)
+ if not os.path.exists(dest_path):
+ os.makedirs(dest_path)
+ png_path = os.path.join(dest_path, name + ".png")
+ path = setup.app.builder.imgpath
- path = '_static'
- source = self.document.attributes['source']
- count = source.split('/doc/')[-1].count('/')
- for i in range(count):
- if os.path.exists(path): break
- path = '../'+path
- path = '../'+path #specifically added for matplotlib
-
# Create a mapping from fully-qualified class names to URLs.
urls = {}
for child in node:
@@ -344,11 +345,14 @@
graph_hash = get_graph_hash(node)
name = "inheritance%s" % graph_hash
- pdf_path = os.path.join('_static', name + ".pdf")
+ dest_path = os.path.abspath(os.path.join(setup.app.builder.outdir, '_images'))
+ if not os.path.exists(dest_path):
+ os.makedirs(dest_path)
+ pdf_path = os.path.abspath(os.path.join(dest_path, name + ".pdf"))
graph.run_dot(['-Tpdf', '-o%s' % pdf_path],
name...
[truncated message content] |
|
From: <jd...@us...> - 2008-12-17 16:00:47
|
Revision: 6651
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6651&view=rev
Author: jdh2358
Date: 2008-12-17 16:00:44 +0000 (Wed, 17 Dec 2008)
Log Message:
-----------
Merged revisions 6650 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_98_5_maint
........
r6650 | jdh2358 | 2008-12-17 07:59:31 -0800 (Wed, 17 Dec 2008) | 1 line
added piwik analytics javascript tag to header
........
Modified Paths:
--------------
trunk/matplotlib/doc/_templates/layout.html
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Modified: svnmerge-integrated
- /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6648
+ /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6650
Modified: trunk/matplotlib/doc/_templates/layout.html
===================================================================
--- trunk/matplotlib/doc/_templates/layout.html 2008-12-17 15:59:31 UTC (rev 6650)
+++ trunk/matplotlib/doc/_templates/layout.html 2008-12-17 16:00:44 UTC (rev 6651)
@@ -1,5 +1,6 @@
{% extends "!layout.html" %}
+
{% block rootrellink %}
<li><a href="{{ pathto('index') }}">matplotlib home</a>| </li>
<li><a href="{{ pathto('search') }}">search</a>| </li>
@@ -9,6 +10,20 @@
{% block relbar1 %}
+<!-- Piwik -->
+<script type="text/javascript">
+var pkBaseURL = (("https:" == document.location.protocol) ? "https://apps.sourceforge.net/piwik/matplotlib/" : "http://apps.sourceforge.net/piwik/matplotlib/");
+document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
+</script><script type="text/javascript">
+piwik_action_name = '';
+piwik_idsite = 1;
+piwik_url = pkBaseURL + "piwik.php";
+piwik_log(piwik_action_name, piwik_idsite, piwik_url);
+</script>
+<object><noscript><p><img src="http://apps.sourceforge.net/piwik/matplotlib/piwik.php?idsite=1" alt="piwik"/></p></noscript></object>
+<!-- End Piwik Tag -->
+
+
<div style="background-color: white; text-align: left; padding: 10px 10px 15px 15px">
<a href="{{ pathto('index') }}"><img src="{{
pathto("_static/logo2.png", 1) }}" border="0" alt="matplotlib"/></a>
@@ -20,5 +35,3 @@
{% block sidebar1 %}{{ sidebar() }}{% endblock %}
{% block sidebar2 %}{% endblock %}
-
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-12-17 15:59:36
|
Revision: 6650
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6650&view=rev
Author: jdh2358
Date: 2008-12-17 15:59:31 +0000 (Wed, 17 Dec 2008)
Log Message:
-----------
added piwik analytics javascript tag to header
Modified Paths:
--------------
branches/v0_98_5_maint/doc/_templates/layout.html
Modified: branches/v0_98_5_maint/doc/_templates/layout.html
===================================================================
--- branches/v0_98_5_maint/doc/_templates/layout.html 2008-12-17 14:58:42 UTC (rev 6649)
+++ branches/v0_98_5_maint/doc/_templates/layout.html 2008-12-17 15:59:31 UTC (rev 6650)
@@ -1,5 +1,6 @@
{% extends "!layout.html" %}
+
{% block rootrellink %}
<li><a href="{{ pathto('index') }}">matplotlib home</a>| </li>
<li><a href="{{ pathto('search') }}">search</a>| </li>
@@ -9,6 +10,20 @@
{% block relbar1 %}
+<!-- Piwik -->
+<script type="text/javascript">
+var pkBaseURL = (("https:" == document.location.protocol) ? "https://apps.sourceforge.net/piwik/matplotlib/" : "http://apps.sourceforge.net/piwik/matplotlib/");
+document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
+</script><script type="text/javascript">
+piwik_action_name = '';
+piwik_idsite = 1;
+piwik_url = pkBaseURL + "piwik.php";
+piwik_log(piwik_action_name, piwik_idsite, piwik_url);
+</script>
+<object><noscript><p><img src="http://apps.sourceforge.net/piwik/matplotlib/piwik.php?idsite=1" alt="piwik"/></p></noscript></object>
+<!-- End Piwik Tag -->
+
+
<div style="background-color: white; text-align: left; padding: 10px 10px 15px 15px">
<a href="{{ pathto('index') }}"><img src="{{
pathto("_static/logo2.png", 1) }}" border="0" alt="matplotlib"/></a>
@@ -20,5 +35,3 @@
{% block sidebar1 %}{{ sidebar() }}{% endblock %}
{% block sidebar2 %}{% endblock %}
-
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-12-17 14:58:51
|
Revision: 6649
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6649&view=rev
Author: jdh2358
Date: 2008-12-17 14:58:42 +0000 (Wed, 17 Dec 2008)
Log Message:
-----------
Merged revisions 6647 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_98_5_maint
........
r6647 | jdh2358 | 2008-12-17 08:55:42 -0600 (Wed, 17 Dec 2008) | 1 line
fix to figimage
........
Modified Paths:
--------------
trunk/matplotlib/examples/pylab_examples/figimage_demo.py
trunk/matplotlib/lib/matplotlib/image.py
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Modified: svnmerge-integrated
- /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6644
+ /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6648
Modified: trunk/matplotlib/examples/pylab_examples/figimage_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/figimage_demo.py 2008-12-17 14:57:28 UTC (rev 6648)
+++ trunk/matplotlib/examples/pylab_examples/figimage_demo.py 2008-12-17 14:58:42 UTC (rev 6649)
@@ -7,7 +7,7 @@
import matplotlib.pyplot as plt
-fig = plt.figure(frameon=False)
+fig = plt.figure()
Z = np.arange(10000.0)
Z.shape = 100,100
Z[:,50:] = 1.
@@ -15,11 +15,13 @@
im1 = plt.figimage(Z, xo=50, yo=0, cmap=cm.jet, origin='lower')
im2 = plt.figimage(Z, xo=100, yo=100, alpha=.8, cmap=cm.jet, origin='lower')
-dpi = 200
-plt.savefig('figimage.png', dpi=dpi)
-plt.savefig('figimage.pdf', dpi=dpi)
-plt.savefig('figimage.svg', dpi=dpi)
-plt.savefig('figimage.eps', dpi=dpi)
+
+if 0:
+ dpi = 72
+ plt.savefig('figimage_%d.png'%dpi, dpi=dpi, facecolor='gray')
+ plt.savefig('figimage_%d.pdf'%dpi, dpi=dpi, facecolor='gray')
+ plt.savefig('figimage_%d.svg'%dpi, dpi=dpi, facecolor='gray')
+ plt.savefig('figimage_%d.eps'%dpi, dpi=dpi, facecolor='gray')
plt.show()
Modified: trunk/matplotlib/lib/matplotlib/image.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/image.py 2008-12-17 14:57:28 UTC (rev 6648)
+++ trunk/matplotlib/lib/matplotlib/image.py 2008-12-17 14:58:42 UTC (rev 6649)
@@ -693,7 +693,7 @@
if not self.get_visible(): return
# todo: we should be able to do some cacheing here
im = self.make_image(renderer.get_image_magnification())
- renderer.draw_image(round(self.ox/self.magnification), round(self.oy/self.magnification), im, self.figure.bbox,
+ renderer.draw_image(round(self.ox), round(self.oy), im, self.figure.bbox,
*self.get_transformed_clip_path_and_affine())
def write_png(self, fname):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-12-17 14:57:32
|
Revision: 6648
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6648&view=rev
Author: jdh2358
Date: 2008-12-17 14:57:28 +0000 (Wed, 17 Dec 2008)
Log Message:
-----------
added some threshold crossing helper funcs to mlab
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/mlab.py
Modified: trunk/matplotlib/lib/matplotlib/mlab.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mlab.py 2008-12-17 14:55:42 UTC (rev 6647)
+++ trunk/matplotlib/lib/matplotlib/mlab.py 2008-12-17 14:57:28 UTC (rev 6648)
@@ -54,6 +54,16 @@
yourself stranded without scipy (and the far superior
scipy.integrate tools)
+:meth:`contiguous_regions`
+ return the indices of the regions spanned by some logical mask
+
+:meth:`cross_from_below`
+ return the indices where a 1D array crosses a threshold from below
+
+:meth:`cross_from_above`
+ return the indices where a 1D array crosses a threshold from above
+
+
record array helper functions
-------------------------------
@@ -3236,6 +3246,63 @@
boundaries.append((in_region, i+1))
return boundaries
+
+def cross_from_below(x, threshold):
+ """
+ return the indices into *x* where *x* crosses some threshold from
+ below, eg the i's where::
+
+ x[i-1]<threshold and x[i]>=threshold
+
+ Example code::
+
+ import matplotlib.pyplot as plt
+
+ t = np.arange(0.0, 2.0, 0.1)
+ s = np.sin(2*np.pi*t)
+
+ fig = plt.figure()
+ ax = fig.add_subplot(111)
+ ax.plot(t, s, '-o')
+ ax.axhline(0.5)
+ ax.axhline(-0.5)
+
+ ind = cross_from_below(s, 0.5)
+ ax.vlines(t[ind], -1, 1)
+
+ ind = cross_from_above(s, -0.5)
+ ax.vlines(t[ind], -1, 1)
+
+ plt.show()
+
+ .. seealso::
+
+ :func:`cross_from_above` and :func:`contiguous_regions`
+
+ """
+ x = np.asarray(x)
+ threshold = threshold
+ ind = np.nonzero( (x[:-1]<threshold) & (x[1:]>=threshold))[0]
+ if len(ind): return ind+1
+ else: return ind
+
+def cross_from_above(x, threshold):
+ """
+ return the indices into *x* where *x* crosses some threshold from
+ below, eg the i's where::
+
+ x[i-1]>threshold and x[i]<=threshold
+
+ .. seealso::
+
+ :func:`cross_from_below` and :func:`contiguous_regions`
+
+ """
+ x = np.asarray(x)
+ ind = np.nonzero( (x[:-1]>=threshold) & (x[1:]<threshold))[0]
+ if len(ind): return ind+1
+ else: return ind
+
##################################################
# Vector and path length geometry calculations
##################################################
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-12-17 14:55:46
|
Revision: 6647
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6647&view=rev
Author: jdh2358
Date: 2008-12-17 14:55:42 +0000 (Wed, 17 Dec 2008)
Log Message:
-----------
fix to figimage
Modified Paths:
--------------
branches/v0_98_5_maint/examples/pylab_examples/figimage_demo.py
branches/v0_98_5_maint/lib/matplotlib/image.py
Modified: branches/v0_98_5_maint/examples/pylab_examples/figimage_demo.py
===================================================================
--- branches/v0_98_5_maint/examples/pylab_examples/figimage_demo.py 2008-12-17 12:59:50 UTC (rev 6646)
+++ branches/v0_98_5_maint/examples/pylab_examples/figimage_demo.py 2008-12-17 14:55:42 UTC (rev 6647)
@@ -7,7 +7,7 @@
import matplotlib.pyplot as plt
-fig = plt.figure(frameon=False)
+fig = plt.figure()
Z = np.arange(10000.0)
Z.shape = 100,100
Z[:,50:] = 1.
@@ -15,11 +15,13 @@
im1 = plt.figimage(Z, xo=50, yo=0, cmap=cm.jet, origin='lower')
im2 = plt.figimage(Z, xo=100, yo=100, alpha=.8, cmap=cm.jet, origin='lower')
-dpi = 200
-plt.savefig('figimage.png', dpi=dpi)
-plt.savefig('figimage.pdf', dpi=dpi)
-plt.savefig('figimage.svg', dpi=dpi)
-plt.savefig('figimage.eps', dpi=dpi)
+
+if 0:
+ dpi = 72
+ plt.savefig('figimage_%d.png'%dpi, dpi=dpi, facecolor='gray')
+ plt.savefig('figimage_%d.pdf'%dpi, dpi=dpi, facecolor='gray')
+ plt.savefig('figimage_%d.svg'%dpi, dpi=dpi, facecolor='gray')
+ plt.savefig('figimage_%d.eps'%dpi, dpi=dpi, facecolor='gray')
plt.show()
Modified: branches/v0_98_5_maint/lib/matplotlib/image.py
===================================================================
--- branches/v0_98_5_maint/lib/matplotlib/image.py 2008-12-17 12:59:50 UTC (rev 6646)
+++ branches/v0_98_5_maint/lib/matplotlib/image.py 2008-12-17 14:55:42 UTC (rev 6647)
@@ -693,7 +693,7 @@
if not self.get_visible(): return
# todo: we should be able to do some cacheing here
im = self.make_image(renderer.get_image_magnification())
- renderer.draw_image(round(self.ox/self.magnification), round(self.oy/self.magnification), im, self.figure.bbox,
+ renderer.draw_image(round(self.ox), round(self.oy), im, self.figure.bbox,
*self.get_transformed_clip_path_and_affine())
def write_png(self, fname):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-12-17 12:59:55
|
Revision: 6646
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6646&view=rev
Author: jswhit
Date: 2008-12-17 12:59:50 +0000 (Wed, 17 Dec 2008)
Log Message:
-----------
look for data in BASEMAPDATA
Modified Paths:
--------------
trunk/toolkits/basemap/Changelog
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
trunk/toolkits/basemap/src/pj_open_lib.c
Added Paths:
-----------
trunk/toolkits/basemap/src/pj_open_lib.c.orig
Modified: trunk/toolkits/basemap/Changelog
===================================================================
--- trunk/toolkits/basemap/Changelog 2008-12-17 12:54:24 UTC (rev 6645)
+++ trunk/toolkits/basemap/Changelog 2008-12-17 12:59:50 UTC (rev 6646)
@@ -1,4 +1,7 @@
version 0.99.3 (not yet released)
+ * Basemap will now look for it's data in BASEMAPDATA.
+ If that env var not set, it will fall back to it's
+ default location.
* if readshapefile is called with drawbounds=True, a
LineCollection object is appended to the returned tuple.
* make sure drawmapscale method returns a list of objects that
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-12-17 12:54:24 UTC (rev 6645)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-12-17 12:59:50 UTC (rev 6646)
@@ -39,7 +39,14 @@
import _geoslib, netcdftime
# basemap data files now installed in lib/matplotlib/toolkits/basemap/data
-basemap_datadir = os.sep.join([os.path.dirname(__file__), 'data'])
+# check to see if environment variable BASEMAPDATA set to a directory,
+# and if so look for the data there.
+if 'BASEMAPDATA' in os.environ:
+ basemap_datadir = os.environ['BASEMAPDATA']
+ if not os.path.isdir(basemap_datadir):
+ raise RuntimeError('Path in environment BASEMAPDATA not a directory')
+else:
+ basemap_datadir = os.sep.join([os.path.dirname(__file__), 'data'])
__version__ = '0.99.3'
Modified: trunk/toolkits/basemap/src/pj_open_lib.c
===================================================================
--- trunk/toolkits/basemap/src/pj_open_lib.c 2008-12-17 12:54:24 UTC (rev 6645)
+++ trunk/toolkits/basemap/src/pj_open_lib.c 2008-12-17 12:59:50 UTC (rev 6646)
@@ -60,8 +60,8 @@
static int path_count = 0;
static char **search_path = NULL;
static char * proj_lib_name =
-#ifdef PROJ_LIB
-PROJ_LIB;
+#ifdef BASEMAPDATA
+BASEMAPDATA;
#else
0;
#endif
@@ -153,8 +153,8 @@
else if( pj_finder != NULL && pj_finder( name ) != NULL )
sysname = pj_finder( name );
- /* or is environment PROJ_LIB defined */
- else if ((sysname = getenv("PROJ_LIB")) || (sysname = proj_lib_name)) {
+ /* or is environment BASEMAPDATA defined */
+ else if ((sysname = getenv("BASEMAPDATA")) || (sysname = proj_lib_name)) {
(void)strcpy(fname, sysname);
fname[n = strlen(fname)] = DIR_CHAR;
fname[++n] = '\0';
Added: trunk/toolkits/basemap/src/pj_open_lib.c.orig
===================================================================
--- trunk/toolkits/basemap/src/pj_open_lib.c.orig (rev 0)
+++ trunk/toolkits/basemap/src/pj_open_lib.c.orig 2008-12-17 12:59:50 UTC (rev 6646)
@@ -0,0 +1,191 @@
+/******************************************************************************
+ * $Id: pj_open_lib.c,v 1.9 2007/07/06 14:58:03 fwarmerdam Exp $
+ *
+ * Project: PROJ.4
+ * Purpose: Implementation of pj_open_lib(), and pj_set_finder(). These
+ * provide a standard interface for opening projections support
+ * data files.
+ * Author: Gerald Evenden, Frank Warmerdam <war...@po...>
+ *
+ ******************************************************************************
+ * Copyright (c) 1995, Gerald Evenden
+ * Copyright (c) 2002, Frank Warmerdam <war...@po...>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ ******************************************************************************
+ *
+ * $Log: pj_open_lib.c,v $
+ * Revision 1.9 2007/07/06 14:58:03 fwarmerdam
+ * improve searchpath clearning with pj_set_searchpath()
+ *
+ * Revision 1.8 2007/03/11 17:03:18 fwarmerdam
+ * support drive letter prefixes on win32 and related fixes (bug 1499)
+ *
+ * Revision 1.7 2006/11/17 22:16:30 mloskot
+ * Uploaded PROJ.4 port for Windows CE.
+ *
+ * Revision 1.6 2004/09/16 15:14:01 fwarmerdam
+ * * src/pj_open_lib.c: added pj_set_searchpath() provided by Eric Miller.
+ *
+ * Revision 1.5 2002/12/14 20:15:30 warmerda
+ * updated headers
+ *
+ */
+
+#define PJ_LIB__
+#include <projects.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+PJ_CVSID("$Id: pj_open_lib.c,v 1.9 2007/07/06 14:58:03 fwarmerdam Exp $");
+
+static const char *(*pj_finder)(const char *) = NULL;
+static int path_count = 0;
+static char **search_path = NULL;
+static char * proj_lib_name =
+#ifdef PROJ_LIB
+PROJ_LIB;
+#else
+0;
+#endif
+
+/************************************************************************/
+/* pj_set_finder() */
+/************************************************************************/
+
+void pj_set_finder( const char *(*new_finder)(const char *) )
+
+{
+ pj_finder = new_finder;
+}
+
+/************************************************************************/
+/* pj_set_searchpath() */
+/* */
+/* Path control for callers that can't practically provide */
+/* pj_set_finder() style callbacks. Call with (0,NULL) as args */
+/* to clear the searchpath set. */
+/************************************************************************/
+
+void pj_set_searchpath ( int count, const char **path )
+{
+ int i;
+
+ if (path_count > 0 && search_path != NULL)
+ {
+ for (i = 0; i < path_count; i++)
+ {
+ pj_dalloc(search_path[i]);
+ }
+ pj_dalloc(search_path);
+ path_count = 0;
+ search_path = NULL;
+ }
+
+ if( count > 0 )
+ {
+ search_path = pj_malloc(sizeof *search_path * count);
+ for (i = 0; i < count; i++)
+ {
+ search_path[i] = pj_malloc(strlen(path[i]) + 1);
+ strcpy(search_path[i], path[i]);
+ }
+ }
+
+ path_count = count;
+}
+
+/************************************************************************/
+/* pj_open_lib() */
+/************************************************************************/
+
+FILE *
+pj_open_lib(char *name, char *mode) {
+ char fname[MAX_PATH_FILENAME+1];
+ const char *sysname;
+ FILE *fid;
+ int n = 0;
+ int i;
+#ifdef WIN32
+ static const char dir_chars[] = "/\\";
+#else
+ static const char dir_chars[] = "/";
+#endif
+
+#ifndef _WIN32_WCE
+
+ /* check if ~/name */
+ if (*name == '~' && strchr(dir_chars,name[1]) )
+ if (sysname = getenv("HOME")) {
+ (void)strcpy(fname, sysname);
+ fname[n = strlen(fname)] = DIR_CHAR;
+ fname[++n] = '\0';
+ (void)strcpy(fname+n, name + 1);
+ sysname = fname;
+ } else
+ return NULL;
+
+ /* or fixed path: /name, ./name or ../name */
+ else if (strchr(dir_chars,*name)
+ || (*name == '.' && strchr(dir_chars,name[1]))
+ || (!strncmp(name, "..", 2) && strchr(dir_chars,name[2]))
+ || (name[1] == ':' && strchr(dir_chars,name[2])) )
+ sysname = name;
+
+ /* or try to use application provided file finder */
+ else if( pj_finder != NULL && pj_finder( name ) != NULL )
+ sysname = pj_finder( name );
+
+ /* or is environment PROJ_LIB defined */
+ else if ((sysname = getenv("PROJ_LIB")) || (sysname = proj_lib_name)) {
+ (void)strcpy(fname, sysname);
+ fname[n = strlen(fname)] = DIR_CHAR;
+ fname[++n] = '\0';
+ (void)strcpy(fname+n, name);
+ sysname = fname;
+ } else /* just try it bare bones */
+ sysname = name;
+
+ if (fid = fopen(sysname, mode))
+ errno = 0;
+
+ /* If none of those work and we have a search path, try it */
+ if (!fid && path_count > 0)
+ {
+ for (i = 0; fid == NULL && i < path_count; i++)
+ {
+ sprintf(fname, "%s%c%s", search_path[i], DIR_CHAR, name);
+ sysname = fname;
+ fid = fopen (sysname, mode);
+ }
+ if (fid)
+ errno = 0;
+ }
+
+ if( getenv( "PROJ_DEBUG" ) != NULL )
+ fprintf( stderr, "pj_open_lib(%s): call fopen(%s) - %s\n",
+ name, sysname,
+ fid == NULL ? "failed" : "succeeded" );
+
+ return(fid);
+#else
+ return NULL;
+#endif /* _WIN32_WCE */
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-12-17 12:54:28
|
Revision: 6645
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6645&view=rev
Author: jdh2358
Date: 2008-12-17 12:54:24 +0000 (Wed, 17 Dec 2008)
Log Message:
-----------
Merged revisions 6644 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_98_5_maint
........
r6644 | jdh2358 | 2008-12-17 06:51:22 -0600 (Wed, 17 Dec 2008) | 1 line
added Jouni's pdf image dpi patch; apply fix to figimage
........
Modified Paths:
--------------
trunk/matplotlib/examples/pylab_examples/figimage_demo.py
trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
trunk/matplotlib/lib/matplotlib/figure.py
trunk/matplotlib/lib/matplotlib/image.py
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Modified: svnmerge-integrated
- /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6640
+ /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6644
Modified: trunk/matplotlib/examples/pylab_examples/figimage_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/figimage_demo.py 2008-12-17 12:51:22 UTC (rev 6644)
+++ trunk/matplotlib/examples/pylab_examples/figimage_demo.py 2008-12-17 12:54:24 UTC (rev 6645)
@@ -15,6 +15,11 @@
im1 = plt.figimage(Z, xo=50, yo=0, cmap=cm.jet, origin='lower')
im2 = plt.figimage(Z, xo=100, yo=100, alpha=.8, cmap=cm.jet, origin='lower')
+dpi = 200
+plt.savefig('figimage.png', dpi=dpi)
+plt.savefig('figimage.pdf', dpi=dpi)
+plt.savefig('figimage.svg', dpi=dpi)
+plt.savefig('figimage.eps', dpi=dpi)
plt.show()
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2008-12-17 12:51:22 UTC (rev 6644)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2008-12-17 12:54:24 UTC (rev 6645)
@@ -1184,13 +1184,14 @@
truetype_font_cache = maxdict(50)
afm_font_cache = maxdict(50)
- def __init__(self, file, dpi):
+ def __init__(self, file, dpi, image_dpi):
RendererBase.__init__(self)
self.file = file
self.gc = self.new_gc()
self.file.used_characters = self.used_characters = {}
self.mathtext_parser = MathTextParser("Pdf")
self.dpi = dpi
+ self.image_dpi = image_dpi
self.tex_font_map = None
def finalize(self):
@@ -1230,9 +1231,10 @@
stat_key, (realpath, set()))
used_characters[1].update(charset)
+ def get_image_magnification(self):
+ return self.image_dpi/72.0
+
def draw_image(self, x, y, im, bbox, clippath=None, clippath_trans=None):
- #print >>sys.stderr, "draw_image called"
-
# MGDTODO: Support clippath here
gc = self.new_gc()
if bbox is not None:
@@ -1240,6 +1242,7 @@
self.check_gc(gc)
h, w = im.get_size_out()
+ h, w = 72.0*h/self.image_dpi, 72.0*w/self.image_dpi
imob = self.file.imageObject(im)
self.file.output(Op.gsave, w, 0, 0, h, x, y, Op.concat_matrix,
imob, Op.use_xobject, Op.grestore)
@@ -1873,13 +1876,13 @@
return 'pdf'
def print_pdf(self, filename, **kwargs):
- dpi = 72 # there are 72 Postscript points to an inch
- # TODO: use the dpi kwarg for images
- self.figure.set_dpi(dpi)
+ ppi = 72 # Postscript points in an inch
+ image_dpi = kwargs.get('dpi', 72) # dpi to use for images
+ self.figure.set_dpi(ppi)
width, height = self.figure.get_size_inches()
- file = PdfFile(width, height, dpi, filename)
+ file = PdfFile(width, height, ppi, filename)
renderer = MixedModeRenderer(
- width, height, dpi, RendererPdf(file, dpi))
+ width, height, ppi, RendererPdf(file, ppi, image_dpi))
self.figure.draw(renderer)
renderer.finalize()
file.close()
Modified: trunk/matplotlib/lib/matplotlib/figure.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/figure.py 2008-12-17 12:51:22 UTC (rev 6644)
+++ trunk/matplotlib/lib/matplotlib/figure.py 2008-12-17 12:54:24 UTC (rev 6645)
@@ -755,7 +755,7 @@
# make a composite image blending alpha
# list of (_image.Image, ox, oy)
mag = renderer.get_image_magnification()
- ims = [(im.make_image(mag), im.ox*mag, im.oy*mag)
+ ims = [(im.make_image(mag), im.ox, im.oy)
for im in self.images]
im = _image.from_images(self.bbox.height * mag,
Modified: trunk/matplotlib/lib/matplotlib/image.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/image.py 2008-12-17 12:51:22 UTC (rev 6644)
+++ trunk/matplotlib/lib/matplotlib/image.py 2008-12-17 12:54:24 UTC (rev 6645)
@@ -630,6 +630,7 @@
self.ox = offsetx
self.oy = offsety
self.update(kwargs)
+ self.magnification = 1.0
def contains(self, mouseevent):
"""Test whether the mouse event occured within the image.
@@ -659,22 +660,30 @@
-0.5+self.oy, numrows-0.5+self.oy)
def make_image(self, magnification=1.0):
- # had to introduce argument magnification to satisfy the unit test
- # figimage_demo.py. I have no idea, how magnification should be used
- # within the function. It should be !=1.0 only for non-default DPI<
- # settings in the PS backend, as introduced by patch #1562394
- # Probably Nicholas Young should look over this code and see, how
- # magnification should be handled correctly.
if self._A is None:
raise RuntimeError('You must first set the image array')
x = self.to_rgba(self._A, self._alpha)
-
- im = _image.fromarray(x, 1)
+ self.magnification = magnification
+ # if magnification is not one, we need to resize
+ ismag = magnification!=1
+ #if ismag: raise RuntimeError
+ if ismag:
+ isoutput = 0
+ else:
+ isoutput = 1
+ im = _image.fromarray(x, isoutput)
fc = self.figure.get_facecolor()
im.set_bg( *mcolors.colorConverter.to_rgba(fc, 0) )
im.is_grayscale = (self.cmap.name == "gray" and
len(self._A.shape) == 2)
+
+ if ismag:
+ numrows, numcols = self.get_size()
+ numrows *= magnification
+ numcols *= magnification
+ im.set_interpolation(_image.NEAREST)
+ im.resize(numcols, numrows)
if self.origin=='upper':
im.flipud_out()
@@ -683,9 +692,8 @@
def draw(self, renderer, *args, **kwargs):
if not self.get_visible(): return
# todo: we should be able to do some cacheing here
- im = self.make_image()
-
- renderer.draw_image(round(self.ox), round(self.oy), im, self.figure.bbox,
+ im = self.make_image(renderer.get_image_magnification())
+ renderer.draw_image(round(self.ox/self.magnification), round(self.oy/self.magnification), im, self.figure.bbox,
*self.get_transformed_clip_path_and_affine())
def write_png(self, fname):
@@ -772,7 +780,7 @@
x.shape = im.size[1], im.size[0], 4
return x
-def thumbnail(infile, thumbfile, scale=0.1, interpolation='bilinear',
+def thumbnail(infile, thumbfile, scale=0.1, interpolation='bilinear',
preview=False):
"""
make a thumbnail of image in *infile* with output filename
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-12-17 12:51:26
|
Revision: 6644
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6644&view=rev
Author: jdh2358
Date: 2008-12-17 12:51:22 +0000 (Wed, 17 Dec 2008)
Log Message:
-----------
added Jouni's pdf image dpi patch; apply fix to figimage
Modified Paths:
--------------
branches/v0_98_5_maint/examples/pylab_examples/figimage_demo.py
branches/v0_98_5_maint/lib/matplotlib/backends/backend_pdf.py
branches/v0_98_5_maint/lib/matplotlib/figure.py
branches/v0_98_5_maint/lib/matplotlib/image.py
Modified: branches/v0_98_5_maint/examples/pylab_examples/figimage_demo.py
===================================================================
--- branches/v0_98_5_maint/examples/pylab_examples/figimage_demo.py 2008-12-17 11:20:35 UTC (rev 6643)
+++ branches/v0_98_5_maint/examples/pylab_examples/figimage_demo.py 2008-12-17 12:51:22 UTC (rev 6644)
@@ -15,6 +15,11 @@
im1 = plt.figimage(Z, xo=50, yo=0, cmap=cm.jet, origin='lower')
im2 = plt.figimage(Z, xo=100, yo=100, alpha=.8, cmap=cm.jet, origin='lower')
+dpi = 200
+plt.savefig('figimage.png', dpi=dpi)
+plt.savefig('figimage.pdf', dpi=dpi)
+plt.savefig('figimage.svg', dpi=dpi)
+plt.savefig('figimage.eps', dpi=dpi)
plt.show()
Modified: branches/v0_98_5_maint/lib/matplotlib/backends/backend_pdf.py
===================================================================
--- branches/v0_98_5_maint/lib/matplotlib/backends/backend_pdf.py 2008-12-17 11:20:35 UTC (rev 6643)
+++ branches/v0_98_5_maint/lib/matplotlib/backends/backend_pdf.py 2008-12-17 12:51:22 UTC (rev 6644)
@@ -1184,13 +1184,14 @@
truetype_font_cache = maxdict(50)
afm_font_cache = maxdict(50)
- def __init__(self, file, dpi):
+ def __init__(self, file, dpi, image_dpi):
RendererBase.__init__(self)
self.file = file
self.gc = self.new_gc()
self.file.used_characters = self.used_characters = {}
self.mathtext_parser = MathTextParser("Pdf")
self.dpi = dpi
+ self.image_dpi = image_dpi
self.tex_font_map = None
def finalize(self):
@@ -1230,9 +1231,10 @@
stat_key, (realpath, set()))
used_characters[1].update(charset)
+ def get_image_magnification(self):
+ return self.image_dpi/72.0
+
def draw_image(self, x, y, im, bbox, clippath=None, clippath_trans=None):
- #print >>sys.stderr, "draw_image called"
-
# MGDTODO: Support clippath here
gc = self.new_gc()
if bbox is not None:
@@ -1240,6 +1242,7 @@
self.check_gc(gc)
h, w = im.get_size_out()
+ h, w = 72.0*h/self.image_dpi, 72.0*w/self.image_dpi
imob = self.file.imageObject(im)
self.file.output(Op.gsave, w, 0, 0, h, x, y, Op.concat_matrix,
imob, Op.use_xobject, Op.grestore)
@@ -1873,13 +1876,13 @@
return 'pdf'
def print_pdf(self, filename, **kwargs):
- dpi = 72 # there are 72 Postscript points to an inch
- # TODO: use the dpi kwarg for images
- self.figure.set_dpi(dpi)
+ ppi = 72 # Postscript points in an inch
+ image_dpi = kwargs.get('dpi', 72) # dpi to use for images
+ self.figure.set_dpi(ppi)
width, height = self.figure.get_size_inches()
- file = PdfFile(width, height, dpi, filename)
+ file = PdfFile(width, height, ppi, filename)
renderer = MixedModeRenderer(
- width, height, dpi, RendererPdf(file, dpi))
+ width, height, ppi, RendererPdf(file, ppi, image_dpi))
self.figure.draw(renderer)
renderer.finalize()
file.close()
Modified: branches/v0_98_5_maint/lib/matplotlib/figure.py
===================================================================
--- branches/v0_98_5_maint/lib/matplotlib/figure.py 2008-12-17 11:20:35 UTC (rev 6643)
+++ branches/v0_98_5_maint/lib/matplotlib/figure.py 2008-12-17 12:51:22 UTC (rev 6644)
@@ -755,7 +755,7 @@
# make a composite image blending alpha
# list of (_image.Image, ox, oy)
mag = renderer.get_image_magnification()
- ims = [(im.make_image(mag), im.ox*mag, im.oy*mag)
+ ims = [(im.make_image(mag), im.ox, im.oy)
for im in self.images]
im = _image.from_images(self.bbox.height * mag,
Modified: branches/v0_98_5_maint/lib/matplotlib/image.py
===================================================================
--- branches/v0_98_5_maint/lib/matplotlib/image.py 2008-12-17 11:20:35 UTC (rev 6643)
+++ branches/v0_98_5_maint/lib/matplotlib/image.py 2008-12-17 12:51:22 UTC (rev 6644)
@@ -630,6 +630,7 @@
self.ox = offsetx
self.oy = offsety
self.update(kwargs)
+ self.magnification = 1.0
def contains(self, mouseevent):
"""Test whether the mouse event occured within the image.
@@ -659,22 +660,30 @@
-0.5+self.oy, numrows-0.5+self.oy)
def make_image(self, magnification=1.0):
- # had to introduce argument magnification to satisfy the unit test
- # figimage_demo.py. I have no idea, how magnification should be used
- # within the function. It should be !=1.0 only for non-default DPI<
- # settings in the PS backend, as introduced by patch #1562394
- # Probably Nicholas Young should look over this code and see, how
- # magnification should be handled correctly.
if self._A is None:
raise RuntimeError('You must first set the image array')
x = self.to_rgba(self._A, self._alpha)
-
- im = _image.fromarray(x, 1)
+ self.magnification = magnification
+ # if magnification is not one, we need to resize
+ ismag = magnification!=1
+ #if ismag: raise RuntimeError
+ if ismag:
+ isoutput = 0
+ else:
+ isoutput = 1
+ im = _image.fromarray(x, isoutput)
fc = self.figure.get_facecolor()
im.set_bg( *mcolors.colorConverter.to_rgba(fc, 0) )
im.is_grayscale = (self.cmap.name == "gray" and
len(self._A.shape) == 2)
+
+ if ismag:
+ numrows, numcols = self.get_size()
+ numrows *= magnification
+ numcols *= magnification
+ im.set_interpolation(_image.NEAREST)
+ im.resize(numcols, numrows)
if self.origin=='upper':
im.flipud_out()
@@ -683,9 +692,8 @@
def draw(self, renderer, *args, **kwargs):
if not self.get_visible(): return
# todo: we should be able to do some cacheing here
- im = self.make_image()
-
- renderer.draw_image(round(self.ox), round(self.oy), im, self.figure.bbox,
+ im = self.make_image(renderer.get_image_magnification())
+ renderer.draw_image(round(self.ox/self.magnification), round(self.oy/self.magnification), im, self.figure.bbox,
*self.get_transformed_clip_path_and_affine())
def write_png(self, fname):
@@ -772,7 +780,7 @@
x.shape = im.size[1], im.size[0], 4
return x
-def thumbnail(infile, thumbfile, scale=0.1, interpolation='bilinear',
+def thumbnail(infile, thumbfile, scale=0.1, interpolation='bilinear',
preview=False):
"""
make a thumbnail of image in *infile* with output filename
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-12-17 11:20:44
|
Revision: 6643
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6643&view=rev
Author: jdh2358
Date: 2008-12-17 11:20:35 +0000 (Wed, 17 Dec 2008)
Log Message:
-----------
added per window icon from sf patch 2412313
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2008-12-17 07:32:18 UTC (rev 6642)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2008-12-17 11:20:35 UTC (rev 6643)
@@ -439,6 +439,8 @@
self.window = gtk.Window()
self.window.set_title("Figure %d" % num)
+ if (window_icon):
+ self.window.set_icon_from_file(window_icon)
self.vbox = gtk.VBox()
self.window.add(self.vbox)
@@ -694,6 +696,8 @@
window = gtk.Window()
+ if (window_icon):
+ window.set_icon_from_file(window_icon)
window.set_title("Subplot Configuration Tool")
window.set_default_size(w, h)
vbox = gtk.VBox()
@@ -1260,9 +1264,9 @@
icon_filename = 'matplotlib.png'
else:
icon_filename = 'matplotlib.svg'
- gtk.window_set_default_icon_from_file (
- os.path.join (matplotlib.rcParams['datapath'], 'images', icon_filename))
+ window_icon = os.path.join(matplotlib.rcParams['datapath'], 'images', icon_filename)
except:
+ window_icon = None
verbose.report('Could not load matplotlib icon: %s' % sys.exc_info()[1])
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2008-12-17 07:32:22
|
Revision: 6642
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6642&view=rev
Author: leejjoon
Date: 2008-12-17 07:32:18 +0000 (Wed, 17 Dec 2008)
Log Message:
-----------
added group id in Artist. added two svg filter example
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/artist.py
trunk/matplotlib/lib/matplotlib/backend_bases.py
trunk/matplotlib/lib/matplotlib/backends/backend_svg.py
trunk/matplotlib/lib/matplotlib/lines.py
trunk/matplotlib/lib/matplotlib/patches.py
trunk/matplotlib/lib/matplotlib/text.py
Added Paths:
-----------
trunk/matplotlib/examples/misc/svg_filter_line.py
trunk/matplotlib/examples/misc/svg_filter_pie.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-12-17 00:55:52 UTC (rev 6641)
+++ trunk/matplotlib/CHANGELOG 2008-12-17 07:32:18 UTC (rev 6642)
@@ -1,3 +1,6 @@
+2008-12-17 Add group id support in artist. Two examples which
+ demostrate svg filter are added. -JJL
+
2008-12-16 Another attempt to fix dpi-dependent behavior of Legend. -JJL
2008-12-16 Fixed dpi-dependent behavior of Legend and fancybox in Text.
Added: trunk/matplotlib/examples/misc/svg_filter_line.py
===================================================================
--- trunk/matplotlib/examples/misc/svg_filter_line.py (rev 0)
+++ trunk/matplotlib/examples/misc/svg_filter_line.py 2008-12-17 07:32:18 UTC (rev 6642)
@@ -0,0 +1,85 @@
+"""
+Demonstrate SVG filtering effects which might be used with mpl.
+
+Note that the filtering effects are only effective if your svg rederer
+support it.
+"""
+
+import matplotlib
+
+matplotlib.use("Svg")
+
+import matplotlib.pyplot as plt
+import matplotlib.transforms as mtransforms
+
+fig1 = plt.figure()
+ax = fig1.add_axes([0.1, 0.1, 0.8, 0.8])
+
+# draw lines
+l1, = ax.plot([0.1, 0.5, 0.9], [0.1, 0.9, 0.5], "bo-",
+ mec="b", lw=5, ms=10, label="Line 1")
+l2, = ax.plot([0.1, 0.5, 0.9], [0.5, 0.2, 0.7], "rs-",
+ mec="r", lw=5, ms=10, color="r", label="Line 2")
+
+
+for l in [l1, l2]:
+
+ # draw shadows with same lines with slight offset and gray colors.
+
+ xx = l.get_xdata()
+ yy = l.get_ydata()
+ shadow, = ax.plot(xx, yy)
+ shadow.update_from(l)
+
+ # adjust color
+ shadow.set_color("0.2")
+ # adjust zorder of the shadow lines so that it is drawn below the
+ # original lines
+ shadow.set_zorder(l.get_zorder()-0.5)
+
+ # offset transform
+ ot = mtransforms.offset_copy(l.get_transform(), fig1,
+ x=4.0, y=-6.0, units='points')
+
+ shadow.set_transform(ot)
+
+ # set the id for a later use
+ shadow.set_gid(l.get_label()+"_shadow")
+
+
+ax.set_xlim(0., 1.)
+ax.set_ylim(0., 1.)
+
+# save the figure as a string in the svg format.
+from StringIO import StringIO
+f = StringIO()
+plt.savefig(f, format="svg")
+
+
+import xml.etree.cElementTree as ET
+
+# filter definition for a gaussian blur
+filter_def = """
+ <defs xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
+ <filter id='dropshadow' height='1.2' width='1.2'>
+ <feGaussianBlur result='blur' stdDeviation='3'/>
+ </filter>
+ </defs>
+"""
+
+
+# read in the saved svg
+tree, xmlid = ET.XMLID(f.getvalue())
+
+# insert the filter definition in the svg dom tree.
+tree.insert(0, ET.XML(filter_def))
+
+for l in [l1, l2]:
+ # pick up the svg element with given id
+ shadow = xmlid[l.get_label()+"_shadow"]
+ # apply shdow filter
+ shadow.set("filter",'url(#dropshadow)')
+
+fn = "svg_filter_line.svg"
+print "Saving '%s'" % fn
+ET.ElementTree(tree).write(fn)
Added: trunk/matplotlib/examples/misc/svg_filter_pie.py
===================================================================
--- trunk/matplotlib/examples/misc/svg_filter_pie.py (rev 0)
+++ trunk/matplotlib/examples/misc/svg_filter_pie.py 2008-12-17 07:32:18 UTC (rev 6642)
@@ -0,0 +1,95 @@
+"""
+Demonstrate SVG filtering effects which might be used with mpl.
+The pie chart drawing code is borrowed from pie_demo.py
+
+Note that the filtering effects are only effective if your svg rederer
+support it.
+"""
+
+
+import matplotlib
+matplotlib.use("Svg")
+
+import matplotlib.pyplot as plt
+from matplotlib.patches import Shadow
+
+# make a square figure and axes
+fig1 = plt.figure(1, figsize=(6,6))
+ax = fig1.add_axes([0.1, 0.1, 0.8, 0.8])
+
+labels = 'Frogs', 'Hogs', 'Dogs', 'Logs'
+fracs = [15,30,45, 10]
+
+explode=(0, 0.05, 0, 0)
+
+# We want to draw the shadow for each pie but we will not use "shadow"
+# option as it does'n save the references to the shadow patches.
+pies = ax.pie(fracs, explode=explode, labels=labels, autopct='%1.1f%%')
+
+for w in pies[0]:
+ # set the id with the label.
+ w.set_gid(w.get_label())
+
+ # we don't want to draw the edge of the pie
+ w.set_ec("none")
+
+for w in pies[0]:
+ # create shadow patch
+ s = Shadow(w, -0.01, -0.01)
+ s.set_gid(w.get_gid()+"_shadow")
+ s.set_zorder(w.get_zorder() - 0.1)
+ ax.add_patch(s)
+
+
+# save
+from StringIO import StringIO
+f = StringIO()
+plt.savefig(f, format="svg")
+
+import xml.etree.cElementTree as ET
+
+
+# filter definition for shadow using a gaussian blur
+# and lighteneing effect.
+# The lightnening filter is copied from http://www.w3.org/TR/SVG/filters.html
+
+# I tested it with Inkscape and Firefox3. "Gaussian blur" is supported
+# in both, but the lightnening effect only in the inkscape. Also note
+# that, inkscape's exporting also may not support it.
+
+filter_def = """
+ <defs xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
+ <filter id='dropshadow' height='1.2' width='1.2'>
+ <feGaussianBlur result='blur' stdDeviation='2'/>
+ </filter>
+
+ <filter id='MyFilter' filterUnits='objectBoundingBox' x='0' y='0' width='1' height='1'>
+ <feGaussianBlur in='SourceAlpha' stdDeviation='4%' result='blur'/>
+ <feOffset in='blur' dx='4%' dy='4%' result='offsetBlur'/>
+ <feSpecularLighting in='blur' surfaceScale='5' specularConstant='.75'
+ specularExponent='20' lighting-color='#bbbbbb' result='specOut'>
+ <fePointLight x='-5000%' y='-10000%' z='20000%'/>
+ </feSpecularLighting>
+ <feComposite in='specOut' in2='SourceAlpha' operator='in' result='specOut'/>
+ <feComposite in='SourceGraphic' in2='specOut' operator='arithmetic'
+ k1='0' k2='1' k3='1' k4='0'/>
+ </filter>
+ </defs>
+"""
+
+
+tree, xmlid = ET.XMLID(f.getvalue())
+
+# insert the filter definition in the svg dom tree.
+tree.insert(0, ET.XML(filter_def))
+
+for i, pie_name in enumerate(labels):
+ pie = xmlid[pie_name]
+ pie.set("filter", 'url(#MyFilter)')
+
+ shadow = xmlid[pie_name + "_shadow"]
+ shadow.set("filter",'url(#dropshadow)')
+
+fn = "svg_filter_pie.svg"
+print "Saving '%s'" % fn
+ET.ElementTree(tree).write(fn)
Modified: trunk/matplotlib/lib/matplotlib/artist.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/artist.py 2008-12-17 00:55:52 UTC (rev 6641)
+++ trunk/matplotlib/lib/matplotlib/artist.py 2008-12-17 07:32:18 UTC (rev 6642)
@@ -52,6 +52,7 @@
self.axes = None
self._remove_method = None
self._url = None
+ self._gid = None
self.x_isdata = True # False to avoid updating Axes.dataLim with x
self.y_isdata = True # with y
self._snap = None
@@ -330,9 +331,26 @@
def set_url(self, url):
"""
Sets the url for the artist
+
+ ACCEPTS: a url string
"""
self._url = url
+
+ def get_gid(self):
+ """
+ Returns the group id
+ """
+ return self._gid
+
+ def set_gid(self, gid):
+ """
+ Sets the (group) id for the artist
+
+ ACCEPTS: an id string
+ """
+ self._gid = gid
+
def get_snap(self):
"""
Returns the snap setting which may be:
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py 2008-12-17 00:55:52 UTC (rev 6641)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py 2008-12-17 07:32:18 UTC (rev 6642)
@@ -52,10 +52,11 @@
def __init__(self):
self._texmanager = None
- def open_group(self, s):
+ def open_group(self, s, gid=None):
"""
- Open a grouping element with label *s*. Is only currently used by
- :mod:`~matplotlib.backends.backend_svg`
+ Open a grouping element with label *s*. If *gid* is given, use
+ *gid* as the id of the group. Is only currently used by
+ :mod:`~matplotlib.backends.backend_svg`.
"""
pass
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_svg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_svg.py 2008-12-17 00:55:52 UTC (rev 6641)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_svg.py 2008-12-17 07:32:18 UTC (rev 6642)
@@ -147,9 +147,16 @@
self._clipd[path] = id
return id
- def open_group(self, s):
- self._groupd[s] = self._groupd.get(s,0) + 1
- self._svgwriter.write('<g id="%s%d">\n' % (s, self._groupd[s]))
+ def open_group(self, s, gid=None):
+ """
+ Open a grouping element with label *s*. If *gid* is given, use
+ *gid* as the id of the group.
+ """
+ if gid:
+ self._svgwriter.write('<g id="%s">\n' % (gid))
+ else:
+ self._groupd[s] = self._groupd.get(s,0) + 1
+ self._svgwriter.write('<g id="%s%d">\n' % (s, self._groupd[s]))
def close_group(self, s):
self._svgwriter.write('</g>\n')
Modified: trunk/matplotlib/lib/matplotlib/lines.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/lines.py 2008-12-17 00:55:52 UTC (rev 6641)
+++ trunk/matplotlib/lib/matplotlib/lines.py 2008-12-17 07:32:18 UTC (rev 6642)
@@ -463,7 +463,7 @@
if self._invalid:
self.recache()
- renderer.open_group('line2d')
+ renderer.open_group('line2d', self.get_gid())
if not self._visible: return
gc = renderer.new_gc()
Modified: trunk/matplotlib/lib/matplotlib/patches.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/patches.py 2008-12-17 00:55:52 UTC (rev 6641)
+++ trunk/matplotlib/lib/matplotlib/patches.py 2008-12-17 07:32:18 UTC (rev 6642)
@@ -264,7 +264,8 @@
def draw(self, renderer):
'Draw the :class:`Patch` to the given *renderer*.'
if not self.get_visible(): return
- #renderer.open_group('patch')
+
+ renderer.open_group('patch', self.get_gid())
gc = renderer.new_gc()
if cbook.is_string_like(self._edgecolor) and self._edgecolor.lower()=='none':
@@ -300,7 +301,7 @@
renderer.draw_path(gc, tpath, affine, rgbFace)
- #renderer.close_group('patch')
+ renderer.close_group('patch')
def get_path(self):
"""
Modified: trunk/matplotlib/lib/matplotlib/text.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/text.py 2008-12-17 00:55:52 UTC (rev 6641)
+++ trunk/matplotlib/lib/matplotlib/text.py 2008-12-17 07:32:18 UTC (rev 6642)
@@ -447,6 +447,8 @@
if not self.get_visible(): return
if self._text=='': return
+ renderer.open_group('text', self.get_gid())
+
bbox, info = self._get_layout(renderer)
trans = self.get_transform()
@@ -499,6 +501,8 @@
self._fontproperties, angle,
ismath=ismath)
+ renderer.close_group('text')
+
def get_color(self):
"Return the color of the text"
return self._color
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2008-12-17 00:55:55
|
Revision: 6641
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6641&view=rev
Author: leejjoon
Date: 2008-12-17 00:55:52 +0000 (Wed, 17 Dec 2008)
Log Message:
-----------
Merged revisions 6640 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_98_5_maint
........
r6640 | leejjoon | 2008-12-16 19:50:56 -0500 (Tue, 16 Dec 2008) | 1 line
Another attempt to fix dpi-dependent behavior of Legend
........
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/legend.py
trunk/matplotlib/lib/matplotlib/offsetbox.py
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Modified: svnmerge-integrated
- /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6637
+ /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6640
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-12-17 00:50:56 UTC (rev 6640)
+++ trunk/matplotlib/CHANGELOG 2008-12-17 00:55:52 UTC (rev 6641)
@@ -1,3 +1,4 @@
+2008-12-16 Another attempt to fix dpi-dependent behavior of Legend. -JJL
2008-12-16 Fixed dpi-dependent behavior of Legend and fancybox in Text.
Modified: trunk/matplotlib/lib/matplotlib/legend.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/legend.py 2008-12-17 00:50:56 UTC (rev 6640)
+++ trunk/matplotlib/lib/matplotlib/legend.py 2008-12-17 00:55:52 UTC (rev 6641)
@@ -34,7 +34,7 @@
from matplotlib.collections import LineCollection, RegularPolyCollection
from matplotlib.transforms import Bbox
-from matplotlib.offsetbox import HPacker, VPacker, TextArea, DrawingArea
+from matplotlib.offsetbox import HPacker, VPacker, PackerBase, TextArea, DrawingArea
class Legend(Artist):
@@ -207,11 +207,6 @@
reps = int(self.numpoints / len(self._scatteryoffsets)) + 1
self._scatteryoffsets = np.tile(self._scatteryoffsets, reps)[:self.scatterpoints]
- # handles & labels (which can be iterators) need to be
- # explicitly converted to list.
- self._handles_labels = list(handles), list(labels)
-
-
# _legend_box is an OffsetBox instance that contains all
# legend items and will be initialized from _init_legend_box()
# method.
@@ -277,12 +272,13 @@
self._set_artist_props(self.legendPatch)
self._drawFrame = True
-
+
# init with null renderer
- #self._init_legend_box(handles, labels, None)
- #self._legend_box.set_figure(self.figure)
+ self._init_legend_box(handles, labels)
+ self._last_fontsize_points = self.fontsize
+
def _set_artist_props(self, a):
"""
set the boilerplate props for artists added to axes
@@ -294,9 +290,9 @@
a.set_transform(self.get_transform())
- def _findoffset_best(self, width, height, xdescent, ydescent):
+ def _findoffset_best(self, width, height, xdescent, ydescent, renderer):
"Heper function to locate the legend at its best position"
- ox, oy = self._find_best_position(width, height)
+ ox, oy = self._find_best_position(width, height, renderer)
return ox+xdescent, oy+ydescent
def _findoffset_loc(self, width, height, xdescent, ydescent, renderer):
@@ -317,10 +313,7 @@
"Draw everything that belongs to the legend"
if not self.get_visible(): return
- # populate the legend_box with legend items.
- handles, labels = self._handles_labels
- self._init_legend_box(handles, labels, renderer)
- self._legend_box.set_figure(self.figure)
+ self._update_legend_box(renderer)
renderer.open_group('legend')
@@ -328,12 +321,15 @@
# _legend_box will draw itself at the location of the return
# value of the find_offset.
if self._loc == 0:
- self._legend_box.set_offset(self._findoffset_best)
+ _findoffset = self._findoffset_best
else:
- def _findoffset_loc(width, height, xdescent, ydescent):
- return self._findoffset_loc(width, height, xdescent, ydescent, renderer)
- self._legend_box.set_offset(_findoffset_loc)
+ _findoffset = self._findoffset_loc
+ def findoffset(width, height, xdescent, ydescent):
+ return _findoffset(width, height, xdescent, ydescent, renderer)
+
+ self._legend_box.set_offset(findoffset)
+
fontsize = renderer.points_to_pixels(self.fontsize)
# if mode == fill, set the width of the legend_box to the
@@ -361,15 +357,18 @@
renderer.close_group('legend')
- def _approx_text_height(self):
+ def _approx_text_height(self, renderer=None):
"""
Return the approximate height of the text. This is used to place
the legend handle.
"""
- return self.fontsize/72.0*self.figure.dpi
+ if renderer is None:
+ return self.fontsize
+ else:
+ return renderer.points_to_pixels(self.fontsize)
- def _init_legend_box(self, handles, labels, renderer=None):
+ def _init_legend_box(self, handles, labels):
"""
Initiallize the legend_box. The legend_box is an instance of
the OffsetBox, which is packed with legend handles and
@@ -377,10 +376,7 @@
drawing time.
"""
- if renderer is None:
- fontsize = self.fontsize
- else:
- fontsize = renderer.points_to_pixels(self.fontsize)
+ fontsize = self.fontsize
# legend_box is a HPacker, horizontally packed with
# columns. Each column is a VPacker, vertically packed with
@@ -415,10 +411,13 @@
height = self._approx_text_height() * 0.7
descent = 0.
- # each handle needs to be drawn inside a box of
- # (x, y, w, h) = (0, -descent, width, height).
- # And their corrdinates should be given in the display coordinates.
+ # each handle needs to be drawn inside a box of (x, y, w, h) =
+ # (0, -descent, width, height). And their corrdinates should
+ # be given in the display coordinates.
+ # NOTE : the coordinates will be updated again in
+ # _update_legend_box() method.
+
# The transformation of each handle will be automatically set
# to self.get_trasnform(). If the artist does not uses its
# default trasnform (eg, Collections), you need to
@@ -548,8 +547,8 @@
for i0, di in largecol+smallcol:
# pack handleBox and labelBox into itemBox
itemBoxes = [HPacker(pad=0,
- sep=self.handletextpad*fontsize,
- children=[h, t], align="baseline")
+ sep=self.handletextpad*fontsize,
+ children=[h, t], align="baseline")
for h, t in handle_label[i0:i0+di]]
# minimumdescent=False for the text of the last row of the column
itemBoxes[-1].get_children()[1].set_minimumdescent(False)
@@ -572,10 +571,100 @@
mode=mode,
children=columnbox)
+ self._legend_box.set_figure(self.figure)
+
self.texts = text_list
self.legendHandles = handle_list
+
+
+ def _update_legend_box(self, renderer):
+ """
+ Update the dimension of the legend_box. This is required
+ becuase the paddings, the hadle size etc. depends on the dpi
+ of the renderer.
+ """
+
+ # fontsize in points.
+ fontsize = renderer.points_to_pixels(self.fontsize)
+
+ if self._last_fontsize_points == fontsize:
+ # no update is needed
+ return
+
+ # each handle needs to be drawn inside a box of
+ # (x, y, w, h) = (0, -descent, width, height).
+ # And their corrdinates should be given in the display coordinates.
+
+ # The approximate height and descent of text. These values are
+ # only used for plotting the legend handle.
+ height = self._approx_text_height(renderer) * 0.7
+ descent = 0.
+
+ for handle in self.legendHandles:
+ if isinstance(handle, RegularPolyCollection):
+ npoints = self.scatterpoints
+ else:
+ npoints = self.numpoints
+ if npoints > 1:
+ # we put some pad here to compensate the size of the
+ # marker
+ xdata = np.linspace(0.3*fontsize,
+ (self.handlelength-0.3)*fontsize,
+ npoints)
+ xdata_marker = xdata
+ elif npoints == 1:
+ xdata = np.linspace(0, self.handlelength*fontsize, 2)
+ xdata_marker = [0.5*self.handlelength*fontsize]
+
+ if isinstance(handle, Line2D):
+ legline = handle
+ ydata = ((height-descent)/2.)*np.ones(xdata.shape, float)
+ legline.set_data(xdata, ydata)
+
+ legline_marker = legline._legmarker
+ legline_marker.set_data(xdata_marker, ydata[:len(xdata_marker)])
+
+ elif isinstance(handle, Patch):
+ p = handle
+ p.set_bounds(0., 0.,
+ self.handlelength*fontsize,
+ (height-descent),
+ )
+
+ elif isinstance(handle, RegularPolyCollection):
+
+ p = handle
+ ydata = height*self._scatteryoffsets
+ p.set_offsets(zip(xdata_marker,ydata))
+
+
+ # correction factor
+ cor = fontsize / self._last_fontsize_points
+
+ # helper function to iterate over all children
+ def all_children(parent):
+ yield parent
+ for c in parent.get_children():
+ for cc in all_children(c): yield cc
+
+
+ #now update paddings
+ for box in all_children(self._legend_box):
+ if isinstance(box, PackerBase):
+ box.pad = box.pad * cor
+ box.sep = box.sep * cor
+
+ elif isinstance(box, DrawingArea):
+ box.width = self.handlelength*fontsize
+ box.height = height
+ box.xdescent = 0.
+ box.ydescent=descent
+
+ self._last_fontsize_points = fontsize
+
+
def _auto_legend_data(self):
"""
Returns list of vertices and extents covered by the plot.
@@ -683,7 +772,7 @@
return anchored_box.x0, anchored_box.y0
- def _find_best_position(self, width, height, consider=None):
+ def _find_best_position(self, width, height, renderer, consider=None):
"""
Determine the best location to place the legend.
@@ -696,7 +785,7 @@
verts, bboxes, lines = self._auto_legend_data()
bbox = Bbox.from_bounds(0, 0, width, height)
- consider = [self._get_anchored_bbox(x, bbox, self.parent.bbox) for x in range(1, len(self.codes))]
+ consider = [self._get_anchored_bbox(x, bbox, self.parent.bbox, renderer) for x in range(1, len(self.codes))]
#tx, ty = self.legendPatch.get_x(), self.legendPatch.get_y()
Modified: trunk/matplotlib/lib/matplotlib/offsetbox.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/offsetbox.py 2008-12-17 00:50:56 UTC (rev 6640)
+++ trunk/matplotlib/lib/matplotlib/offsetbox.py 2008-12-17 00:55:52 UTC (rev 6641)
@@ -164,7 +164,7 @@
accepts float
"""
- self._width = width
+ self.width = width
def set_height(self, height):
"""
@@ -172,7 +172,7 @@
accepts float
"""
- self._height = height
+ self.height = height
def get_children(self):
"""
@@ -215,7 +215,31 @@
bbox_artist(self, renderer, fill=False, props=dict(pad=0.))
-class VPacker(OffsetBox):
+class PackerBase(OffsetBox):
+ def __init__(self, pad=None, sep=None, width=None, height=None,
+ align=None, mode=None,
+ children=None):
+ """
+ *pad* : boundary pad
+ *sep* : spacing between items
+ *width*, *height* : width and height of the container box.
+ calculated if None.
+ *align* : alignment of boxes
+ *mode* : packing mode
+ """
+ super(PackerBase, self).__init__()
+
+ self.height = height
+ self.width = width
+ self.sep = sep
+ self.pad = pad
+ self.mode = mode
+ self.align = align
+
+ self._children = children
+
+
+class VPacker(PackerBase):
"""
The VPacker has its children packed vertically. It automatically
adjust the relative postisions of children in the drawing time.
@@ -231,18 +255,12 @@
*align* : alignment of boxes
*mode* : packing mode
"""
- super(VPacker, self).__init__()
+ super(VPacker, self).__init__(pad, sep, width, height,
+ align, mode,
+ children)
- self._height = height
- self._width = width
- self._align = align
- self._sep = sep
- self._pad = pad
- self._mode = mode
-
- self._children = children
-
+
def get_extent_offsets(self, renderer):
"""
update offset of childrens and return the extents of the box
@@ -254,12 +272,12 @@
wd_list = [(w, xd) for w, h, xd, yd in whd_list]
width, xdescent, xoffsets = _get_aligned_offsets(wd_list,
- self._width,
- self._align)
+ self.width,
+ self.align)
pack_list = [(h, yd) for w,h,xd,yd in whd_list]
- height, yoffsets_ = _get_packed_offsets(pack_list, self._height,
- self._sep, self._mode)
+ height, yoffsets_ = _get_packed_offsets(pack_list, self.height,
+ self.sep, self.mode)
yoffsets = yoffsets_ + [yd for w,h,xd,yd in whd_list]
ydescent = height - yoffsets[0]
@@ -268,18 +286,17 @@
#w, h, xd, h_yd = whd_list[-1]
yoffsets = yoffsets - ydescent
- return width + 2*self._pad, height + 2*self._pad, \
- xdescent+self._pad, ydescent+self._pad, \
+ return width + 2*self.pad, height + 2*self.pad, \
+ xdescent+self.pad, ydescent+self.pad, \
zip(xoffsets, yoffsets)
-
-class HPacker(OffsetBox):
+class HPacker(PackerBase):
"""
The HPacker has its children packed horizontally. It automatically
adjust the relative postisions of children in the drawing time.
"""
- def __init__(self, pad=None, width=None, height=None, sep=None,
+ def __init__(self, pad=None, sep=None, width=None, height=None,
align="baseline", mode="fixed",
children=None):
"""
@@ -290,19 +307,10 @@
*align* : alignment of boxes
*mode* : packing mode
"""
- super(HPacker, self).__init__()
+ super(HPacker, self).__init__(pad, sep, width, height,
+ align, mode, children)
- self._height = height
- self._width = width
- self._align = align
-
- self._sep = sep
- self._pad = pad
- self._mode = mode
- self._children = children
-
-
def get_extent_offsets(self, renderer):
"""
update offset of childrens and return the extents of the box
@@ -310,30 +318,30 @@
whd_list = [c.get_extent(renderer) for c in self.get_children()]
- if self._height is None:
+ if self.height is None:
height_descent = max([h-yd for w,h,xd,yd in whd_list])
ydescent = max([yd for w,h,xd,yd in whd_list])
height = height_descent + ydescent
else:
- height = self._height - 2*self._pad # width w/o pad
+ height = self.height - 2*self._pad # width w/o pad
hd_list = [(h, yd) for w, h, xd, yd in whd_list]
height, ydescent, yoffsets = _get_aligned_offsets(hd_list,
- self._height,
- self._align)
+ self.height,
+ self.align)
pack_list = [(w, xd) for w,h,xd,yd in whd_list]
- width, xoffsets_ = _get_packed_offsets(pack_list, self._width,
- self._sep, self._mode)
+ width, xoffsets_ = _get_packed_offsets(pack_list, self.width,
+ self.sep, self.mode)
xoffsets = xoffsets_ + [xd for w,h,xd,yd in whd_list]
xdescent=whd_list[0][2]
xoffsets = xoffsets - xdescent
- return width + 2*self._pad, height + 2*self._pad, \
- xdescent + self._pad, ydescent + self._pad, \
+ return width + 2*self.pad, height + 2*self.pad, \
+ xdescent + self.pad, ydescent + self.pad, \
zip(xoffsets, yoffsets)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2008-12-17 00:51:00
|
Revision: 6640
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6640&view=rev
Author: leejjoon
Date: 2008-12-17 00:50:56 +0000 (Wed, 17 Dec 2008)
Log Message:
-----------
Another attempt to fix dpi-dependent behavior of Legend
Modified Paths:
--------------
branches/v0_98_5_maint/CHANGELOG
branches/v0_98_5_maint/lib/matplotlib/legend.py
branches/v0_98_5_maint/lib/matplotlib/offsetbox.py
Modified: branches/v0_98_5_maint/CHANGELOG
===================================================================
--- branches/v0_98_5_maint/CHANGELOG 2008-12-16 22:26:11 UTC (rev 6639)
+++ branches/v0_98_5_maint/CHANGELOG 2008-12-17 00:50:56 UTC (rev 6640)
@@ -1,3 +1,5 @@
+2008-12-16 Another attempt to fix dpi-dependent behavior of Legend. -JJL
+
======================================================================
2008-12-16 Release 0.98.5.1 at r6636
Modified: branches/v0_98_5_maint/lib/matplotlib/legend.py
===================================================================
--- branches/v0_98_5_maint/lib/matplotlib/legend.py 2008-12-16 22:26:11 UTC (rev 6639)
+++ branches/v0_98_5_maint/lib/matplotlib/legend.py 2008-12-17 00:50:56 UTC (rev 6640)
@@ -34,7 +34,7 @@
from matplotlib.collections import LineCollection, RegularPolyCollection
from matplotlib.transforms import Bbox
-from matplotlib.offsetbox import HPacker, VPacker, TextArea, DrawingArea
+from matplotlib.offsetbox import HPacker, VPacker, PackerBase, TextArea, DrawingArea
class Legend(Artist):
@@ -207,11 +207,6 @@
reps = int(self.numpoints / len(self._scatteryoffsets)) + 1
self._scatteryoffsets = np.tile(self._scatteryoffsets, reps)[:self.scatterpoints]
- # handles & labels (which can be iterators) need to be
- # explicitly converted to list.
- self._handles_labels = list(handles), list(labels)
-
-
# _legend_box is an OffsetBox instance that contains all
# legend items and will be initialized from _init_legend_box()
# method.
@@ -277,12 +272,13 @@
self._set_artist_props(self.legendPatch)
self._drawFrame = True
-
+
# init with null renderer
- #self._init_legend_box(handles, labels, None)
- #self._legend_box.set_figure(self.figure)
+ self._init_legend_box(handles, labels)
+ self._last_fontsize_points = self.fontsize
+
def _set_artist_props(self, a):
"""
set the boilerplate props for artists added to axes
@@ -294,9 +290,9 @@
a.set_transform(self.get_transform())
- def _findoffset_best(self, width, height, xdescent, ydescent):
+ def _findoffset_best(self, width, height, xdescent, ydescent, renderer):
"Heper function to locate the legend at its best position"
- ox, oy = self._find_best_position(width, height)
+ ox, oy = self._find_best_position(width, height, renderer)
return ox+xdescent, oy+ydescent
def _findoffset_loc(self, width, height, xdescent, ydescent, renderer):
@@ -317,10 +313,7 @@
"Draw everything that belongs to the legend"
if not self.get_visible(): return
- # populate the legend_box with legend items.
- handles, labels = self._handles_labels
- self._init_legend_box(handles, labels, renderer)
- self._legend_box.set_figure(self.figure)
+ self._update_legend_box(renderer)
renderer.open_group('legend')
@@ -328,12 +321,15 @@
# _legend_box will draw itself at the location of the return
# value of the find_offset.
if self._loc == 0:
- self._legend_box.set_offset(self._findoffset_best)
+ _findoffset = self._findoffset_best
else:
- def _findoffset_loc(width, height, xdescent, ydescent):
- return self._findoffset_loc(width, height, xdescent, ydescent, renderer)
- self._legend_box.set_offset(_findoffset_loc)
+ _findoffset = self._findoffset_loc
+ def findoffset(width, height, xdescent, ydescent):
+ return _findoffset(width, height, xdescent, ydescent, renderer)
+
+ self._legend_box.set_offset(findoffset)
+
fontsize = renderer.points_to_pixels(self.fontsize)
# if mode == fill, set the width of the legend_box to the
@@ -361,15 +357,18 @@
renderer.close_group('legend')
- def _approx_text_height(self):
+ def _approx_text_height(self, renderer=None):
"""
Return the approximate height of the text. This is used to place
the legend handle.
"""
- return self.fontsize/72.0*self.figure.dpi
+ if renderer is None:
+ return self.fontsize
+ else:
+ return renderer.points_to_pixels(self.fontsize)
- def _init_legend_box(self, handles, labels, renderer=None):
+ def _init_legend_box(self, handles, labels):
"""
Initiallize the legend_box. The legend_box is an instance of
the OffsetBox, which is packed with legend handles and
@@ -377,10 +376,7 @@
drawing time.
"""
- if renderer is None:
- fontsize = self.fontsize
- else:
- fontsize = renderer.points_to_pixels(self.fontsize)
+ fontsize = self.fontsize
# legend_box is a HPacker, horizontally packed with
# columns. Each column is a VPacker, vertically packed with
@@ -415,10 +411,13 @@
height = self._approx_text_height() * 0.7
descent = 0.
- # each handle needs to be drawn inside a box of
- # (x, y, w, h) = (0, -descent, width, height).
- # And their corrdinates should be given in the display coordinates.
+ # each handle needs to be drawn inside a box of (x, y, w, h) =
+ # (0, -descent, width, height). And their corrdinates should
+ # be given in the display coordinates.
+ # NOTE : the coordinates will be updated again in
+ # _update_legend_box() method.
+
# The transformation of each handle will be automatically set
# to self.get_trasnform(). If the artist does not uses its
# default trasnform (eg, Collections), you need to
@@ -548,8 +547,8 @@
for i0, di in largecol+smallcol:
# pack handleBox and labelBox into itemBox
itemBoxes = [HPacker(pad=0,
- sep=self.handletextpad*fontsize,
- children=[h, t], align="baseline")
+ sep=self.handletextpad*fontsize,
+ children=[h, t], align="baseline")
for h, t in handle_label[i0:i0+di]]
# minimumdescent=False for the text of the last row of the column
itemBoxes[-1].get_children()[1].set_minimumdescent(False)
@@ -572,10 +571,100 @@
mode=mode,
children=columnbox)
+ self._legend_box.set_figure(self.figure)
+
self.texts = text_list
self.legendHandles = handle_list
+
+
+ def _update_legend_box(self, renderer):
+ """
+ Update the dimension of the legend_box. This is required
+ becuase the paddings, the hadle size etc. depends on the dpi
+ of the renderer.
+ """
+
+ # fontsize in points.
+ fontsize = renderer.points_to_pixels(self.fontsize)
+
+ if self._last_fontsize_points == fontsize:
+ # no update is needed
+ return
+
+ # each handle needs to be drawn inside a box of
+ # (x, y, w, h) = (0, -descent, width, height).
+ # And their corrdinates should be given in the display coordinates.
+
+ # The approximate height and descent of text. These values are
+ # only used for plotting the legend handle.
+ height = self._approx_text_height(renderer) * 0.7
+ descent = 0.
+
+ for handle in self.legendHandles:
+ if isinstance(handle, RegularPolyCollection):
+ npoints = self.scatterpoints
+ else:
+ npoints = self.numpoints
+ if npoints > 1:
+ # we put some pad here to compensate the size of the
+ # marker
+ xdata = np.linspace(0.3*fontsize,
+ (self.handlelength-0.3)*fontsize,
+ npoints)
+ xdata_marker = xdata
+ elif npoints == 1:
+ xdata = np.linspace(0, self.handlelength*fontsize, 2)
+ xdata_marker = [0.5*self.handlelength*fontsize]
+
+ if isinstance(handle, Line2D):
+ legline = handle
+ ydata = ((height-descent)/2.)*np.ones(xdata.shape, float)
+ legline.set_data(xdata, ydata)
+
+ legline_marker = legline._legmarker
+ legline_marker.set_data(xdata_marker, ydata[:len(xdata_marker)])
+
+ elif isinstance(handle, Patch):
+ p = handle
+ p.set_bounds(0., 0.,
+ self.handlelength*fontsize,
+ (height-descent),
+ )
+
+ elif isinstance(handle, RegularPolyCollection):
+
+ p = handle
+ ydata = height*self._scatteryoffsets
+ p.set_offsets(zip(xdata_marker,ydata))
+
+
+ # correction factor
+ cor = fontsize / self._last_fontsize_points
+
+ # helper function to iterate over all children
+ def all_children(parent):
+ yield parent
+ for c in parent.get_children():
+ for cc in all_children(c): yield cc
+
+
+ #now update paddings
+ for box in all_children(self._legend_box):
+ if isinstance(box, PackerBase):
+ box.pad = box.pad * cor
+ box.sep = box.sep * cor
+
+ elif isinstance(box, DrawingArea):
+ box.width = self.handlelength*fontsize
+ box.height = height
+ box.xdescent = 0.
+ box.ydescent=descent
+
+ self._last_fontsize_points = fontsize
+
+
def _auto_legend_data(self):
"""
Returns list of vertices and extents covered by the plot.
@@ -683,7 +772,7 @@
return anchored_box.x0, anchored_box.y0
- def _find_best_position(self, width, height, consider=None):
+ def _find_best_position(self, width, height, renderer, consider=None):
"""
Determine the best location to place the legend.
@@ -696,7 +785,7 @@
verts, bboxes, lines = self._auto_legend_data()
bbox = Bbox.from_bounds(0, 0, width, height)
- consider = [self._get_anchored_bbox(x, bbox, self.parent.bbox) for x in range(1, len(self.codes))]
+ consider = [self._get_anchored_bbox(x, bbox, self.parent.bbox, renderer) for x in range(1, len(self.codes))]
#tx, ty = self.legendPatch.get_x(), self.legendPatch.get_y()
Modified: branches/v0_98_5_maint/lib/matplotlib/offsetbox.py
===================================================================
--- branches/v0_98_5_maint/lib/matplotlib/offsetbox.py 2008-12-16 22:26:11 UTC (rev 6639)
+++ branches/v0_98_5_maint/lib/matplotlib/offsetbox.py 2008-12-17 00:50:56 UTC (rev 6640)
@@ -164,7 +164,7 @@
accepts float
"""
- self._width = width
+ self.width = width
def set_height(self, height):
"""
@@ -172,7 +172,7 @@
accepts float
"""
- self._height = height
+ self.height = height
def get_children(self):
"""
@@ -215,7 +215,31 @@
bbox_artist(self, renderer, fill=False, props=dict(pad=0.))
-class VPacker(OffsetBox):
+class PackerBase(OffsetBox):
+ def __init__(self, pad=None, sep=None, width=None, height=None,
+ align=None, mode=None,
+ children=None):
+ """
+ *pad* : boundary pad
+ *sep* : spacing between items
+ *width*, *height* : width and height of the container box.
+ calculated if None.
+ *align* : alignment of boxes
+ *mode* : packing mode
+ """
+ super(PackerBase, self).__init__()
+
+ self.height = height
+ self.width = width
+ self.sep = sep
+ self.pad = pad
+ self.mode = mode
+ self.align = align
+
+ self._children = children
+
+
+class VPacker(PackerBase):
"""
The VPacker has its children packed vertically. It automatically
adjust the relative postisions of children in the drawing time.
@@ -231,18 +255,12 @@
*align* : alignment of boxes
*mode* : packing mode
"""
- super(VPacker, self).__init__()
+ super(VPacker, self).__init__(pad, sep, width, height,
+ align, mode,
+ children)
- self._height = height
- self._width = width
- self._align = align
- self._sep = sep
- self._pad = pad
- self._mode = mode
-
- self._children = children
-
+
def get_extent_offsets(self, renderer):
"""
update offset of childrens and return the extents of the box
@@ -254,12 +272,12 @@
wd_list = [(w, xd) for w, h, xd, yd in whd_list]
width, xdescent, xoffsets = _get_aligned_offsets(wd_list,
- self._width,
- self._align)
+ self.width,
+ self.align)
pack_list = [(h, yd) for w,h,xd,yd in whd_list]
- height, yoffsets_ = _get_packed_offsets(pack_list, self._height,
- self._sep, self._mode)
+ height, yoffsets_ = _get_packed_offsets(pack_list, self.height,
+ self.sep, self.mode)
yoffsets = yoffsets_ + [yd for w,h,xd,yd in whd_list]
ydescent = height - yoffsets[0]
@@ -268,18 +286,17 @@
#w, h, xd, h_yd = whd_list[-1]
yoffsets = yoffsets - ydescent
- return width + 2*self._pad, height + 2*self._pad, \
- xdescent+self._pad, ydescent+self._pad, \
+ return width + 2*self.pad, height + 2*self.pad, \
+ xdescent+self.pad, ydescent+self.pad, \
zip(xoffsets, yoffsets)
-
-class HPacker(OffsetBox):
+class HPacker(PackerBase):
"""
The HPacker has its children packed horizontally. It automatically
adjust the relative postisions of children in the drawing time.
"""
- def __init__(self, pad=None, width=None, height=None, sep=None,
+ def __init__(self, pad=None, sep=None, width=None, height=None,
align="baseline", mode="fixed",
children=None):
"""
@@ -290,19 +307,10 @@
*align* : alignment of boxes
*mode* : packing mode
"""
- super(HPacker, self).__init__()
+ super(HPacker, self).__init__(pad, sep, width, height,
+ align, mode, children)
- self._height = height
- self._width = width
- self._align = align
-
- self._sep = sep
- self._pad = pad
- self._mode = mode
- self._children = children
-
-
def get_extent_offsets(self, renderer):
"""
update offset of childrens and return the extents of the box
@@ -310,30 +318,30 @@
whd_list = [c.get_extent(renderer) for c in self.get_children()]
- if self._height is None:
+ if self.height is None:
height_descent = max([h-yd for w,h,xd,yd in whd_list])
ydescent = max([yd for w,h,xd,yd in whd_list])
height = height_descent + ydescent
else:
- height = self._height - 2*self._pad # width w/o pad
+ height = self.height - 2*self._pad # width w/o pad
hd_list = [(h, yd) for w, h, xd, yd in whd_list]
height, ydescent, yoffsets = _get_aligned_offsets(hd_list,
- self._height,
- self._align)
+ self.height,
+ self.align)
pack_list = [(w, xd) for w,h,xd,yd in whd_list]
- width, xoffsets_ = _get_packed_offsets(pack_list, self._width,
- self._sep, self._mode)
+ width, xoffsets_ = _get_packed_offsets(pack_list, self.width,
+ self.sep, self.mode)
xoffsets = xoffsets_ + [xd for w,h,xd,yd in whd_list]
xdescent=whd_list[0][2]
xoffsets = xoffsets - xdescent
- return width + 2*self._pad, height + 2*self._pad, \
- xdescent + self._pad, ydescent + self._pad, \
+ return width + 2*self.pad, height + 2*self.pad, \
+ xdescent + self.pad, ydescent + self.pad, \
zip(xoffsets, yoffsets)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-12-16 23:22:42
|
Revision: 6639
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6639&view=rev
Author: jdh2358
Date: 2008-12-16 22:26:11 +0000 (Tue, 16 Dec 2008)
Log Message:
-----------
export universal flags before making
Modified Paths:
--------------
trunk/matplotlib/release/osx/Makefile
trunk/matplotlib/release/osx/data/setup.cfg
Modified: trunk/matplotlib/release/osx/Makefile
===================================================================
--- trunk/matplotlib/release/osx/Makefile 2008-12-16 20:03:07 UTC (rev 6638)
+++ trunk/matplotlib/release/osx/Makefile 2008-12-16 22:26:11 UTC (rev 6639)
@@ -2,18 +2,22 @@
ZLIBVERSION=1.2.3
PNGVERSION=1.2.33
FREETYPEVERSION=2.3.7
-MPLVERSION=0.98.5
-MPLSRC=matplotlib-0.98.5
+MPLVERSION=0.98.5.1
+MPLSRC=matplotlib-${MPLVERSION}
MACOSX_DEPLOYMENT_TARGET=10.4
## You shouldn't need to configure past this point
-CFLAGS="-Os -arch ppc -arch i386 -I${SRCDIR}/zlib-1.2.3 -I${SRCDIR}/libpng-1.2.33 -I${SRCDIR}/freetype-2.3.7/include"
-LDFLAGS="-arch ppc -arch i386 -L${SRCDIR}/zlib-1.2.3 -L${SRCDIR}/libpng-1.2.33 -L${SRCDIR}/freetype-2.3.7"
+CFLAGS="-Os -arch ppc -arch i386 -I${SRCDIR}/zlib-${ZLIBVERSION} -I${SRCDIR}/libpng-${PNGVERSION} -I${SRCDIR}/freetype-${FREETYPEVERSION}/include"
-CFLAGS_DEPS="-arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk"
-LDFLAGS_DEPS="-arch i386 -arch ppc -syslibroot,/Developer/SDKs/MacOSX10.4u.sdk"
+LDFLAGS="-arch ppc -arch i386 -L${SRCDIR}/zlib-${ZLIBVERSION} -L${SRCDIR}/libpng-${PNGVERSION} -L${SRCDIR}/freetype-${FREETYPEVERSION}"
+CFLAGS_ZLIB="-arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk"
+LDFLAGS_ZLIB="-arch i386 -arch ppc -syslibroot,/Developer/SDKs/MacOSX10.4u.sdk"
+
+CFLAGS_DEPS="-arch i386 -arch ppc -I${SRCDIR}/zlib-${ZLIBVERSION} -isysroot /Developer/SDKs/MacOSX10.4u.sdk"
+LDFLAGS_DEPS="-arch i386 -arch ppc -L${SRCDIR}/zlib-${ZLIBVERSION} -syslibroot,/Developer/SDKs/MacOSX10.4u.sdk"
+
clean:
rm -rf zlib-${ZLIBVERSION}.tar.gz libpng-${PNGVERSION}.tar.bz2 \
freetype-${FREETYPEVERSION}.tar.bz2 bdist_mpkg-0.4.3.tar.gz \
@@ -33,37 +37,62 @@
zlib:
+ unset PKG_CONFIG_PATH &&\
rm -rf zlib-${ZLIBVERSION} &&\
tar xvfz zlib-${ZLIBVERSION}.tar.gz &&\
cd zlib-${ZLIBVERSION} &&\
+ export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} &&\
+ export CFLAGS=${CFLAGS_DEPS} &&\
+ export LDFLAGS=${LDFLAGS_DEPS} &&\
./configure &&\
- MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} CFLAGS=${CFLAGS_DEPS} LDFLAGS=${LDFLAGS_DEPS} make -j3
+ MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} CFLAGS=${CFLAGS_ZLIB} LDFLAGS=${LDFLAGS_ZLIB} make -j3&& \
+ unset MACOSX_DEPLOYMENT_TARGET
png: zlib
+ unset PKG_CONFIG_PATH &&\
rm -rf libpng-${PNGVERSION} &&\
tar xvfj libpng-${PNGVERSION}.tar.bz2
cd libpng-${PNGVERSION} &&\
+ export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} &&\
+ export CFLAGS=${CFLAGS_DEPS} &&\
+ export LDFLAGS=${LDFLAGS_DEPS} &&\
./configure --disable-dependency-tracking &&\
- MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} CFLAGS=${CFLAGS_DEPS} LDFLAGS=${LDFLAGS_DEPS} make -j3 &&\
- cp .libs/libpng.a .
+ make -j3 &&\
+ cp .libs/libpng.a . &&\
+ unset MACOSX_DEPLOYMENT_TARGET
+
freetype: zlib
+ unset PKG_CONFIG_PATH &&\
rm -rf ${FREETYPEVERSION} &&\
tar xvfj freetype-${FREETYPEVERSION}.tar.bz2 &&\
cd freetype-${FREETYPEVERSION} &&\
+ export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} &&\
+ export CFLAGS=${CFLAGS_DEPS} &&\
+ export LDFLAGS=${LDFLAGS_DEPS} &&\
./configure &&\
- MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} CFLAGS=${CFLAGS_DEPS} LDFLAGS=${LDFLAGS_DEPS} make -j3 &&\
- cp objs/.libs/libfreetype.a .
+ make -j3 &&\
+ cp objs/.libs/libfreetype.a . &&\
+ unset MACOSX_DEPLOYMENT_TARGET
dependencies:
make zlib png freetype
installers:
+ unset PKG_CONFIG_PATH &&\
tar xvfz matplotlib-${MPLVERSION}.tar.gz && \
cd ${MPLSRC} && \
rm -rf build && \
cp ../data/setup.cfg . &&\
- CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} bdist_mpkg &&\
- CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} python setupegg.py bdist_egg
+ export CFLAGS=${CFLAGS} &&\
+ export LDFLAGS=${LDFLAGS} &&\
+ bdist_mpkg &&\
+ python setupegg.py bdist_egg &&\
+ cd dist && \
+ zip -ro matplotlib-${MPLVERSION}-py2.5-macosx10.5.zip matplotlib-${MPLVERSION}-py2.5-macosx10.5.mpkg
+all:
+ make clean fetch_deps dependencies installers
+
+
Modified: trunk/matplotlib/release/osx/data/setup.cfg
===================================================================
--- trunk/matplotlib/release/osx/data/setup.cfg 2008-12-16 20:03:07 UTC (rev 6638)
+++ trunk/matplotlib/release/osx/data/setup.cfg 2008-12-16 22:26:11 UTC (rev 6639)
@@ -52,9 +52,9 @@
#
#gtk = False
#gtkagg = False
-#tkagg = False
-#wxagg = False
-#macosx = False
+tkagg = True
+wxagg = True
+macosx = True
[rc_options]
# User-configurable options
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-12-16 20:03:12
|
Revision: 6638
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6638&view=rev
Author: jdh2358
Date: 2008-12-16 20:03:07 +0000 (Tue, 16 Dec 2008)
Log Message:
-----------
fixed merge between 98 branch and trunk
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Modified: svnmerge-integrated
- /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6633
+ /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6637
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-12-16 19:34:32 UTC (rev 6637)
+++ trunk/matplotlib/CHANGELOG 2008-12-16 20:03:07 UTC (rev 6638)
@@ -1,9 +1,8 @@
+
2008-12-16 Fixed dpi-dependent behavior of Legend and fancybox in Text.
- -JJL
2008-12-16 Added markevery property to Line2D to support subsampling
of markers - JDH
-
2008-12-15 Removed mpl_data symlink in docs. On platforms that do not
support symlinks, these become copies, and the font files
are large, so the distro becomes unneccessarily bloaded.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|