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: <lee...@us...> - 2010-02-16 22:55:33
|
Revision: 8135
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8135&view=rev
Author: leejjoon
Date: 2010-02-16 22:55:27 +0000 (Tue, 16 Feb 2010)
Log Message:
-----------
fix a bug in Text._get_layout that returns an incorrect information for an empty string
Modified Paths:
--------------
branches/v0_99_maint/lib/matplotlib/text.py
Modified: branches/v0_99_maint/lib/matplotlib/text.py
===================================================================
--- branches/v0_99_maint/lib/matplotlib/text.py 2010-02-16 14:31:02 UTC (rev 8134)
+++ branches/v0_99_maint/lib/matplotlib/text.py 2010-02-16 22:55:27 UTC (rev 8135)
@@ -275,8 +275,11 @@
baseline = None
for i, line in enumerate(lines):
clean_line, ismath = self.is_math_text(line)
- w, h, d = renderer.get_text_width_height_descent(
- clean_line, self._fontproperties, ismath=ismath)
+ if clean_line:
+ w, h, d = renderer.get_text_width_height_descent(
+ clean_line, self._fontproperties, ismath=ismath)
+ else:
+ w, h, d = 0, 0, 0
if baseline is None:
baseline = h - d
whs[i] = w, h
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2010-02-16 14:31:10
|
Revision: 8134
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8134&view=rev
Author: mdehoon
Date: 2010-02-16 14:31:02 +0000 (Tue, 16 Feb 2010)
Log Message:
-----------
Keeping track of the mouse entering and exiting a window, and moving over an
active window.
Modified Paths:
--------------
trunk/matplotlib/src/_macosx.m
Modified: trunk/matplotlib/src/_macosx.m
===================================================================
--- trunk/matplotlib/src/_macosx.m 2010-02-15 16:38:50 UTC (rev 8133)
+++ trunk/matplotlib/src/_macosx.m 2010-02-16 14:31:02 UTC (rev 8134)
@@ -336,6 +336,8 @@
@interface View : NSView
{ PyObject* canvas;
NSRect rubberband;
+ BOOL inside;
+ NSTrackingRectTag tracking;
}
- (void)dealloc;
- (void)drawRect:(NSRect)rect;
@@ -344,6 +346,8 @@
- (void)setCanvas: (PyObject*)newCanvas;
- (BOOL)windowShouldClose:(NSNotification*)notification;
- (BOOL)isFlipped;
+- (void)mouseEntered:(NSEvent*)event;
+- (void)mouseExited:(NSEvent*)event;
- (void)mouseDown:(NSEvent*)event;
- (void)mouseUp:(NSEvent*)event;
- (void)mouseDragged:(NSEvent*)event;
@@ -4463,6 +4467,8 @@
{
self = [super initWithFrame: rect];
rubberband = NSZeroRect;
+ inside = false;
+ tracking = nil;
return self;
}
@@ -4470,6 +4476,7 @@
{
FigureCanvas* fc = (FigureCanvas*)canvas;
if (fc) fc->view = NULL;
+ [self removeTrackingRect: tracking];
[super dealloc];
}
@@ -4551,6 +4558,11 @@
else
PyErr_Print();
PyGILState_Release(gstate);
+ if (tracking) [self removeTrackingRect: tracking];
+ tracking = [self addTrackingRect: [self bounds]
+ owner: self
+ userData: nil
+ assumeInside: NO];
[self setNeedsDisplay: YES];
}
@@ -4575,6 +4587,45 @@
return YES;
}
+- (void)mouseEntered:(NSEvent *)event
+{
+ PyGILState_STATE gstate;
+ PyObject* result;
+ NSWindow* window = [self window];
+ if ([window isKeyWindow]==false) return;
+
+ gstate = PyGILState_Ensure();
+ result = PyObject_CallMethod(canvas, "enter_notify_event", "");
+ if(result)
+ Py_DECREF(result);
+ else
+ PyErr_Print();
+ PyGILState_Release(gstate);
+
+ [window setAcceptsMouseMovedEvents: YES];
+ inside = true;
+}
+
+- (void)mouseExited:(NSEvent *)event
+{
+ PyGILState_STATE gstate;
+ PyObject* result;
+ NSWindow* window = [self window];
+ if ([window isKeyWindow]==false) return;
+
+ if (inside==false) return;
+ gstate = PyGILState_Ensure();
+ result = PyObject_CallMethod(canvas, "leave_notify_event", "");
+ if(result)
+ Py_DECREF(result);
+ else
+ PyErr_Print();
+ PyGILState_Release(gstate);
+
+ [[self window] setAcceptsMouseMovedEvents: NO];
+ inside = false;
+}
+
- (void)mouseDown:(NSEvent *)event
{
int x, y;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2010-02-15 16:38:58
|
Revision: 8133
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8133&view=rev
Author: jswhit
Date: 2010-02-15 16:38:50 +0000 (Mon, 15 Feb 2010)
Log Message:
-----------
update for newer version of geos
Modified Paths:
--------------
trunk/toolkits/basemap/doc/users/installing.rst
Modified: trunk/toolkits/basemap/doc/users/installing.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/installing.rst 2010-02-15 02:34:39 UTC (rev 8132)
+++ trunk/toolkits/basemap/doc/users/installing.rst 2010-02-15 16:38:50 UTC (rev 8133)
@@ -23,8 +23,8 @@
**Required libraries that ship with basemap**
-`GEOS <http://trac.osgeo.org/geos/>`__ (Geometry Engine - Open Source) library 2.2.3 or later (2.2.3 recommended).
- Source code is included in the geos-2.2.3 directory.
+`GEOS <http://trac.osgeo.org/geos/>`__ (Geometry Engine - Open Source) library 3.1.1 or later.
+ Source code is included in the geos-3.1.1 directory.
When building from source, must be built and installed separately
from basemap (see build instructions below).
Included in Windows binary installers.
@@ -75,7 +75,7 @@
Then go to next step. If you don't have it, you can build it from
the source code included with basemap by following these steps::
- cd geos-2.2.3
+ cd geos-3.1.1
export GEOS_DIR=<where you want the libs and headers to go>
# A reasonable choice on a Unix-like system is /usr/local, or
# if you don't have permission to write there, your home directory.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2010-02-15 02:34:45
|
Revision: 8132
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8132&view=rev
Author: jswhit
Date: 2010-02-15 02:34:39 +0000 (Mon, 15 Feb 2010)
Log Message:
-----------
update with nsper
Modified Paths:
--------------
trunk/toolkits/basemap/doc/users/graticule.rst
trunk/toolkits/basemap/doc/users/intro.rst
trunk/toolkits/basemap/doc/users/mapsetup.rst
Modified: trunk/toolkits/basemap/doc/users/graticule.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/graticule.rst 2010-02-15 02:31:33 UTC (rev 8131)
+++ trunk/toolkits/basemap/doc/users/graticule.rst 2010-02-15 02:34:39 UTC (rev 8132)
@@ -8,10 +8,10 @@
:func:`~mpl_toolkits.basemap.Basemap.drawparallels` and
:func:`~mpl_toolkits.basemap.Basemap.drawmeridians` instance methods.
The longitude and latitude lines can be labelled where they intersect
-the map projection boundary. There are four exceptions: meridians
+the map projection boundary. There are a few exceptions: meridians
and parallels cannot be labelled on maps with
-``proj`` set to ``ortho`` (orthographic) or
-``vandg`` (van der Grinten),
+``proj`` set to ``ortho`` (orthographic), ``geos`` (geostationary),
+``vandg`` (van der Grinten) or ``nsper`` (near-sided perspective),
and meridians cannot be labelled on maps with
``proj`` set to ``robin`` (robinson), ``mbtfpq``
(McBryde-Thomas Flat Polar Quartic), ``moll`` (mollweide) or ``sinu``
Modified: trunk/toolkits/basemap/doc/users/intro.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/intro.rst 2010-02-15 02:31:33 UTC (rev 8131)
+++ trunk/toolkits/basemap/doc/users/intro.rst 2010-02-15 02:34:39 UTC (rev 8132)
@@ -11,7 +11,7 @@
`CDAT <http://www-pcmdi.llnl.gov/software/cdat/support/vcs/vcs.html>`_
are other libraries that provide similar capabilities in Python.
-Basemap does not do any plotting on it's own, but provides the facilities to transform coordinates to one of 22 different map projections (using the
+Basemap does not do any plotting on it's own, but provides the facilities to transform coordinates to one of 23 different map projections (using the
`PROJ.4 <http://trac.osgeo.org/proj/>`_ C library). `Matplotlib
<http://matplotlib.sourceforge.net>`_ is then
used to plot contours, images, vectors, lines or points
Modified: trunk/toolkits/basemap/doc/users/mapsetup.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/mapsetup.rst 2010-02-15 02:31:33 UTC (rev 8131)
+++ trunk/toolkits/basemap/doc/users/mapsetup.rst 2010-02-15 02:34:39 UTC (rev 8132)
@@ -6,7 +6,7 @@
In order to represent the curved surface of the earth on a two-dimensional
map, a map projection is needed. Since this cannot be done without
distortion, there are many map projections, each with it's own advantages
-and disadvantages. Basemap provides 22 different map projections.
+and disadvantages. Basemap provides 23 different map projections.
Some are global, some can only represent a portion of the globe. When
a :class:`~mpl_toolkits.basemap.Basemap` class instance is
created, the desired map projection must
@@ -37,6 +37,7 @@
gnomon.rst
ortho.rst
geos.rst
+ nsper.rst
moll.rst
robin.rst
sinu.rst
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2010-02-15 02:31:40
|
Revision: 8131
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8131&view=rev
Author: jswhit
Date: 2010-02-15 02:31:33 +0000 (Mon, 15 Feb 2010)
Log Message:
-----------
add nsper examples
Added Paths:
-----------
trunk/toolkits/basemap/doc/users/figures/nsper_full.py
trunk/toolkits/basemap/doc/users/figures/nsper_partial.py
trunk/toolkits/basemap/doc/users/nsper.rst
Added: trunk/toolkits/basemap/doc/users/figures/nsper_full.py
===================================================================
--- trunk/toolkits/basemap/doc/users/figures/nsper_full.py (rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/nsper_full.py 2010-02-15 02:31:33 UTC (rev 8131)
@@ -0,0 +1,18 @@
+from mpl_toolkits.basemap import Basemap
+import numpy as np
+import matplotlib.pyplot as plt
+# lon_0, lat_0 are the center point of the projection.
+# satellite_height is the altitude of the camera.
+# resolution = 'l' means use low resolution coastlines.
+h = 3000.
+m = Basemap(projection='nsper',lon_0=-105,lat_0=40,
+ satellite_height=h*1000.,resolution='l')
+m.drawcoastlines()
+m.fillcontinents(color='coral',lake_color='aqua')
+# draw parallels and meridians.
+m.drawparallels(np.arange(-90.,120.,30.))
+m.drawmeridians(np.arange(0.,420.,60.))
+m.drawmapboundary(fill_color='aqua')
+plt.title("Full Disk Near-Sided Perspective Projection %d km above earth" %
+ h,fontsize=10)
+plt.savefig('nsper_full.png')
Added: trunk/toolkits/basemap/doc/users/figures/nsper_partial.py
===================================================================
--- trunk/toolkits/basemap/doc/users/figures/nsper_partial.py (rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/nsper_partial.py 2010-02-15 02:31:33 UTC (rev 8131)
@@ -0,0 +1,33 @@
+from mpl_toolkits.basemap import Basemap
+import numpy as np
+import matplotlib.pyplot as plt
+fig = plt.figure()
+# global ortho map centered on lon_0,lat_0
+lat_0=10.; lon_0=57.
+# altitude of camera (in km).
+h = 3000.
+# resolution = None means don't process the boundary datasets.
+m1 = Basemap(projection='nsper',satellite_height=h*1000.,\
+ lon_0=lon_0,lat_0=lat_0,resolution=None)
+# add an axes with a black background
+ax = fig.add_axes([0.1,0.1,0.8,0.8],axisbg='k')
+# plot just upper right quadrant (corners determined from global map).
+# keywords llcrnrx,llcrnry,urcrnrx,urcrnry used to define the lower
+# left and upper right corners in map projection coordinates.
+# llcrnrlat,llcrnrlon,ucrnrlon,urcrnrlat could be used to define
+# lat/lon values of corners - but this won't work in cases such as this
+# where one of the corners does not lie on the earth.
+m = Basemap(projection='nsper',satellite_height=h*1000.,\
+ lon_0=lon_0,lat_0=lat_0,resolution='l',\
+ llcrnrx=0.,llcrnry=0.,urcrnrx=m1.urcrnrx/2.,urcrnry=m1.urcrnry/2.)
+m.drawcoastlines()
+m.drawmapboundary(fill_color='aqua')
+m.fillcontinents(color='coral',lake_color='aqua')
+m.drawcountries()
+# draw parallels and meridians.
+m.drawparallels(np.arange(-90.,120.,30.))
+m.drawmeridians(np.arange(0.,360.,60.))
+m.drawmapboundary()
+plt.title('Near-Sided Perspective Map Showing A Quadrant of the Globe',\
+ fontsize=12)
+plt.savefig('nsper_partial.png')
Added: trunk/toolkits/basemap/doc/users/nsper.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/nsper.rst (rev 0)
+++ trunk/toolkits/basemap/doc/users/nsper.rst 2010-02-15 02:31:33 UTC (rev 8131)
@@ -0,0 +1,15 @@
+.. _nsper:
+
+Near-Sided Perspective Projection
+=================================
+
+The near-sided perspective projection displays the earth as a satellite
+(in orbit at an arbitrary altitude above the earth) would see it.
+
+.. literalinclude:: figures/nsper_full.py
+
+.. image:: figures/nsper_full.png
+
+.. literalinclude:: figures/nsper_partial.py
+
+.. image:: figures/nsper_partial.png
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2010-02-15 02:02:38
|
Revision: 8130
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8130&view=rev
Author: astraw
Date: 2010-02-15 02:02:32 +0000 (Mon, 15 Feb 2010)
Log Message:
-----------
testing bugfix: always copy baseline image
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/testing/decorators.py
Modified: trunk/matplotlib/lib/matplotlib/testing/decorators.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/testing/decorators.py 2010-02-15 00:19:05 UTC (rev 8129)
+++ trunk/matplotlib/lib/matplotlib/testing/decorators.py 2010-02-15 02:02:32 UTC (rev 8130)
@@ -88,8 +88,7 @@
orig_expected_fnames = [os.path.join(baseline_dir,fname) + '.' + extension for fname in baseline_images]
expected_fnames = [os.path.join(result_dir,'expected-'+fname) + '.' + extension for fname in baseline_images]
for src,dst in zip( orig_expected_fnames, expected_fnames ):
- if os.path.exists(src) and not os.path.exists(dst):
- shutil.copyfile(src,dst)
+ shutil.copyfile(src,dst)
actual_fnames = [os.path.join(result_dir, fname) + '.' + extension for fname in baseline_images]
have_baseline_images = [os.path.exists(expected) for expected in expected_fnames]
have_baseline_image = np.all(have_baseline_images)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2010-02-15 01:09:42
|
Revision: 8129
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8129&view=rev
Author: astraw
Date: 2010-02-15 00:19:05 +0000 (Mon, 15 Feb 2010)
Log Message:
-----------
replace not-obviously wrong image that is spontaneously failing tests
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_image/image_interps.png
Modified: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_image/image_interps.png
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2010-02-12 17:25:03
|
Revision: 8128
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8128&view=rev
Author: astraw
Date: 2010-02-12 17:24:56 +0000 (Fri, 12 Feb 2010)
Log Message:
-----------
allow numpy 2.x to pass check for numpy >= 1.1 (reported by Nadia Dencheva)
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/__init__.py
trunk/matplotlib/setupext.py
Modified: trunk/matplotlib/lib/matplotlib/__init__.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/__init__.py 2010-02-12 02:21:05 UTC (rev 8127)
+++ trunk/matplotlib/lib/matplotlib/__init__.py 2010-02-12 17:24:56 UTC (rev 8128)
@@ -147,8 +147,10 @@
import numpy
nn = numpy.__version__.split('.')
if not (int(nn[0]) >= 1 and int(nn[1]) >= 1):
- raise ImportError(
- 'numpy 1.1 or later is required; you have %s' % numpy.__version__)
+ if not (int(nn[0]) >= 2):
+ raise ImportError(
+ 'numpy 1.1 or later is required; you have %s' %
+ numpy.__version__)
def is_string_like(obj):
if hasattr(obj, 'shape'): return 0
Modified: trunk/matplotlib/setupext.py
===================================================================
--- trunk/matplotlib/setupext.py 2010-02-12 02:21:05 UTC (rev 8127)
+++ trunk/matplotlib/setupext.py 2010-02-12 17:24:56 UTC (rev 8128)
@@ -516,9 +516,11 @@
return False
nn = numpy.__version__.split('.')
if not (int(nn[0]) >= 1 and int(nn[1]) >= 1):
- print_message(
- 'numpy 1.1 or later is required; you have %s' % numpy.__version__)
- return False
+ if not (int(nn[0]) >= 2):
+ print_message(
+ 'numpy 1.1 or later is required; you have %s' %
+ numpy.__version__)
+ return False
module = Extension('test', [])
add_numpy_flags(module)
add_base_flags(module)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2010-02-12 02:21:15
|
Revision: 8127
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8127&view=rev
Author: astraw
Date: 2010-02-12 02:21:05 +0000 (Fri, 12 Feb 2010)
Log Message:
-----------
Add option to bootstrap confidence intervals for boxplot (Paul Hobson)
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/axes.py
Added Paths:
-----------
trunk/matplotlib/examples/pylab_examples/boxplot_demo3.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2010-02-11 13:15:28 UTC (rev 8126)
+++ trunk/matplotlib/CHANGELOG 2010-02-12 02:21:05 UTC (rev 8127)
@@ -1,3 +1,7 @@
+2010-02-11 Added 'bootstrap' option to boxplot. This allows bootstrap
+ estimates of median confidence intervals. Based on an
+ initial patch by Paul Hobson. - ADS
+
2010-02-06 Added setup.cfg "basedirlist" option to override setting
in setupext.py "basedir" dictionary; added "gnu0"
platform requested by Benjamin Drung. - EF
Added: trunk/matplotlib/examples/pylab_examples/boxplot_demo3.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/boxplot_demo3.py (rev 0)
+++ trunk/matplotlib/examples/pylab_examples/boxplot_demo3.py 2010-02-12 02:21:05 UTC (rev 8127)
@@ -0,0 +1,27 @@
+import matplotlib.pyplot as plt
+import matplotlib.transforms as mtransforms
+import numpy as np
+
+np.random.seed(2)
+inc = 0.1
+e1 = np.random.uniform(0,1, size=(500,))
+e2 = np.random.uniform(0,1, size=(500,))
+e3 = np.random.uniform(0,1 + inc, size=(500,))
+e4 = np.random.uniform(0,1 + 2*inc, size=(500,))
+
+treatments = [e1,e2,e3,e4]
+
+fig = plt.figure()
+ax = fig.add_subplot(111)
+pos = np.array(range(len(treatments)))+1
+bp = ax.boxplot( treatments, sym='k+', patch_artist=True,
+ positions=pos, notch=1, bootstrap=5000 )
+text_transform= mtransforms.blended_transform_factory(ax.transData,
+ ax.transAxes)
+ax.set_xlabel('treatment')
+ax.set_ylabel('response')
+ax.set_ylim(-0.2, 1.4)
+plt.setp(bp['whiskers'], color='k', linestyle='-' )
+plt.setp(bp['fliers'], markersize=3.0)
+fig.subplots_adjust(right=0.99,top=0.99)
+plt.show()
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2010-02-11 13:15:28 UTC (rev 8126)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2010-02-12 02:21:05 UTC (rev 8127)
@@ -4881,7 +4881,8 @@
return (l0, caplines, barcols)
def boxplot(self, x, notch=0, sym='b+', vert=1, whis=1.5,
- positions=None, widths=None, patch_artist=False):
+ positions=None, widths=None, patch_artist=False,
+ bootstrap=None):
"""
call signature::
@@ -4910,6 +4911,16 @@
a function of the inner quartile range. They extend to the
most extreme data point within ( ``whis*(75%-25%)`` ) data range.
+ *bootstrap* (default None) specifies whether to bootstrap the
+ confidence intervals around the median for notched
+ boxplots. If bootstrap==None, no bootstrapping is performed,
+ and notches are calculated using a Gaussian-based asymptotic
+ approximation (see McGill, R., Tukey, J.W., and Larsen, W.A.,
+ 1978, and Kendall and Stuart, 1967). Otherwise, bootstrap
+ specifies the number of times to bootstrap the median to
+ determine it's 95% confidence intervals. Values between 1000
+ and 10000 are recommended.
+
*positions* (default 1,2,...,n) sets the horizontal positions of
the boxes. The ticks and limits are automatically set to match
the positions.
@@ -5021,8 +5032,33 @@
med_x = [box_x_min, box_x_max]
# calculate 'notch' plot
else:
- notch_max = med + 1.57*iq/np.sqrt(row)
- notch_min = med - 1.57*iq/np.sqrt(row)
+ if bootstrap is not None:
+ # Do a bootstrap estimate of notch locations.
+ def bootstrapMedian(data, N=5000):
+ # determine 95% confidence intervals of the median
+ M = len(data)
+ percentile = [2.5,97.5]
+ estimate = np.zeros(N)
+ for n in range(N):
+ bsIndex = np.random.random_integers(0,M-1,M)
+ bsData = data[bsIndex]
+ estimate[n] = mlab.prctile(bsData, 50)
+ CI = mlab.prctile(estimate, percentile)
+ return CI
+
+ # get conf. intervals around median
+ CI = bootstrapMedian(d, N=bootstrap)
+ notch_max = CI[1]
+ notch_min = CI[0]
+ else:
+ # Estimate notch locations using Gaussian-based
+ # asymptotic approximation.
+ #
+ # For discussion: McGill, R., Tukey, J.W.,
+ # and Larsen, W.A. (1978) "Variations of
+ # Boxplots", The American Statistician, 32:12-16.
+ notch_max = med + 1.57*iq/np.sqrt(row)
+ notch_min = med - 1.57*iq/np.sqrt(row)
# make our notched box vectors
box_x = [box_x_min, box_x_max, box_x_max, cap_x_max, box_x_max,
box_x_max, box_x_min, box_x_min, cap_x_min, box_x_min,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2010-02-11 13:15:34
|
Revision: 8126
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8126&view=rev
Author: jswhit
Date: 2010-02-11 13:15:28 +0000 (Thu, 11 Feb 2010)
Log Message:
-----------
add limited area plot
Modified Paths:
--------------
trunk/toolkits/basemap/examples/nsper_demo.py
Modified: trunk/toolkits/basemap/examples/nsper_demo.py
===================================================================
--- trunk/toolkits/basemap/examples/nsper_demo.py 2010-02-11 13:02:50 UTC (rev 8125)
+++ trunk/toolkits/basemap/examples/nsper_demo.py 2010-02-11 13:15:28 UTC (rev 8126)
@@ -21,5 +21,23 @@
m.drawmeridians(np.arange(0.,420.,20.))
m.drawmapboundary()
plt.title('Near-Sided Perspective Map Centered on Lon=%s, Lat=%s, H=%g' %\
- (lon_0,lat_0,h),fontsize=10)
+ (lon_0,lat_0,h/1000.),fontsize=10)
+
+fig = plt.figure()
+m1 = Basemap(projection='nsper',lon_0=lon_0,lat_0=lat_0,satellite_height=h,resolution=None)
+ax = fig.add_axes([0.1,0.1,0.8,0.8],axisbg='k')
+# plot just upper right quadrant (coordinates determined from global map).
+m = Basemap(projection='nsper',lon_0=lon_0,lat_0=lat_0,satellite_height=h,resolution='l',llcrnrx=0.,llcrnry=0.,urcrnrx=m1.urcrnrx/2.,urcrnry=m1.urcrnry/2.)
+m.drawcoastlines()
+m.drawmapboundary(fill_color='aqua')
+m.fillcontinents(color='coral',lake_color='aqua')
+m.drawcountries()
+m.drawstates()
+# draw parallels and meridians.
+m.drawparallels(np.arange(-90.,120.,30.))
+m.drawmeridians(np.arange(0.,420.,60.))
+m.drawmapboundary()
+plt.title('Near-Sided Perspective Map Centered on Lon=%s, Lat=%s, H=%g' %\
+ (lon_0,lat_0,h/1000.),fontsize=10)
+
plt.show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2010-02-11 13:03:03
|
Revision: 8125
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8125&view=rev
Author: jswhit
Date: 2010-02-11 13:02:50 +0000 (Thu, 11 Feb 2010)
Log Message:
-----------
initial support for near-sided perspective satellite projection.
Modified Paths:
--------------
trunk/toolkits/basemap/Changelog
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/proj.py
Added Paths:
-----------
trunk/toolkits/basemap/examples/nsper_demo.py
Modified: trunk/toolkits/basemap/Changelog
===================================================================
--- trunk/toolkits/basemap/Changelog 2010-02-10 16:00:15 UTC (rev 8124)
+++ trunk/toolkits/basemap/Changelog 2010-02-11 13:02:50 UTC (rev 8125)
@@ -1,4 +1,6 @@
version 0.99.5 (not yet released)
+ * added "near-sided perspective" projection for a satellite
+ view at an arbitrary altitude.
* patch from Stephane Raynaud to pass format string to
drawmapscale, and allow units='m'.
* updated proj4 source to version 4.7.0, pyproj to 1.8.6.
Added: trunk/toolkits/basemap/examples/nsper_demo.py
===================================================================
--- trunk/toolkits/basemap/examples/nsper_demo.py (rev 0)
+++ trunk/toolkits/basemap/examples/nsper_demo.py 2010-02-11 13:02:50 UTC (rev 8125)
@@ -0,0 +1,25 @@
+from mpl_toolkits.basemap import Basemap
+import numpy as np
+import matplotlib.pyplot as plt
+
+# create Basemap instance for Near-Sided Perspective (satellite view) projection.
+lon_0 = float(raw_input('enter reference longitude (lon_0):'))
+lat_0 = float(raw_input('enter reference longitude (lat_0):'))
+h = float(raw_input('enter altitude of camera in km (h):'))
+h=h*1000.
+
+# map with continents drawn and filled.
+fig = plt.figure()
+m = Basemap(projection='nsper',lon_0=lon_0,lat_0=lat_0,satellite_height=h,resolution='l')
+m.drawcoastlines()
+m.drawmapboundary(fill_color='aqua')
+m.fillcontinents(color='coral',lake_color='aqua')
+m.drawcountries()
+m.drawstates()
+# draw parallels and meridians.
+m.drawparallels(np.arange(-90.,120.,10.))
+m.drawmeridians(np.arange(0.,420.,20.))
+m.drawmapboundary()
+plt.title('Near-Sided Perspective Map Centered on Lon=%s, Lat=%s, H=%g' %\
+ (lon_0,lat_0,h),fontsize=10)
+plt.show()
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2010-02-10 16:00:15 UTC (rev 8124)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2010-02-11 13:02:50 UTC (rev 8125)
@@ -78,6 +78,7 @@
'poly' : 'Polyconic',
'ortho' : 'Orthographic',
'geos' : 'Geostationary',
+ 'nsper' : 'Near-Sided Perspective',
'sinu' : 'Sinusoidal',
'moll' : 'Mollweide',
'robin' : 'Robinson',
@@ -116,6 +117,7 @@
'poly' : 'lon_0,lat_0',
'ortho' : 'lon_0,lat_0,llcrnrx,llcrnry,urcrnrx,urcrnry,no width/height',
'geos' : 'lon_0,satellite_height,llcrnrx,llcrnry,urcrnrx,urcrnry,no width/height',
+ 'nsper' : 'lon_0,satellite_height,llcrnrx,llcrnry,urcrnrx,urcrnry,no width/height',
'sinu' : 'lon_0,lat_0,no corners or width/height',
'moll' : 'lon_0,lat_0,no corners or width/height',
'robin' : 'lon_0,lat_0,no corners or width/height',
@@ -189,10 +191,10 @@
For the cylindrical projections (``cyl``, ``merc``, ``mill`` and ``gall``),
the default is to use
llcrnrlon=-180,llcrnrlat=-90, urcrnrlon=180 and urcrnrlat=90). For all other
- projections except ``ortho`` and ``geos``, either the lat/lon values of the
+ projections except ``ortho``, ``geos`` and ``nsper``, either the lat/lon values of the
corners or width and height must be specified by the user.
- For ``ortho`` and ``geos``, the lat/lon values of the corners may be specified,
+ For ``ortho``, ``geos`` and ``nsper``, the lat/lon values of the corners may be specified,
or the x/y values of the corners (llcrnrx,llcrnry,urcrnrx,urcrnry) in the
coordinate system of the global projection (with x=0,y=0 at the center
of the global projection). If the corners are not specified,
@@ -311,8 +313,9 @@
latitude circle boundinglat is tangent to the edge
of the map at lon_0.
satellite_height height of satellite (in m) above equator -
- only relevant for geostationary projections
- (``geos``). Default 35,786 km.
+ only relevant for geostationary
+ and near-sided perspective (``geos`` or ``nsper``)
+ projections. Default 35,786 km.
================ ====================================================
Useful instance variables:
@@ -475,7 +478,7 @@
_insert_validated(projparams, lon_0, 'lon_0', -360, 720)
_insert_validated(projparams, lon_1, 'lon_1', -360, 720)
_insert_validated(projparams, lon_2, 'lon_2', -360, 720)
- if projection == 'geos':
+ if projection in ['geos','nsper']:
projparams['h'] = satellite_height
# check for sane values of projection corners.
using_corners = (None not in [llcrnrlon,llcrnrlat,urcrnrlon,urcrnrlat])
@@ -601,6 +604,24 @@
self._fulldisk = False
self.llcrnrlon = llcrnrlon; self.llcrnrlat = llcrnrlat
self.urcrnrlon = urcrnrlon; self.urcrnrlat = urcrnrlat
+ elif projection == 'nsper':
+ if not projparams.has_key('R'):
+ raise ValueError, 'near-sided perspective projection only works for perfect spheres - not ellipsoids'
+ if lat_0 is None or lon_0 is None:
+ msg='must specify lon_0 and lat_0 for near-sided perspective Basemap'
+ raise ValueError(msg)
+ if width is not None or height is not None:
+ print 'warning: width and height keywords ignored for %s projection' % _projnames[self.projection]
+ if not using_corners:
+ llcrnrlon = -180.
+ llcrnrlat = -90.
+ urcrnrlon = 180
+ urcrnrlat = 90.
+ self._fulldisk = True
+ else:
+ self._fulldisk = False
+ self.llcrnrlon = llcrnrlon; self.llcrnrlat = llcrnrlat
+ self.urcrnrlon = urcrnrlon; self.urcrnrlat = urcrnrlat
elif projection in _pseudocyl:
if lon_0 is None:
raise ValueError, 'must specify lon_0 for %s projection' % _projnames[self.projection]
@@ -723,7 +744,7 @@
self.aspect = (self.urcrnrlat-self.llcrnrlat)/(self.urcrnrlon-self.llcrnrlon)
else:
self.aspect = (proj.ymax-proj.ymin)/(proj.xmax-proj.xmin)
- if projection in ['geos','ortho'] and \
+ if projection in ['geos','ortho','nsper'] and \
None not in [llcrnrx,llcrnry,urcrnrx,urcrnry]:
self.llcrnrx = llcrnrx+0.5*proj.xmax
self.llcrnry = llcrnry+0.5*proj.ymax
@@ -764,7 +785,7 @@
self.latmax = self.urcrnrlat
self.lonmin = self.llcrnrlon
self.lonmax = self.urcrnrlon
- elif self.projection in ['ortho','geos'] + _pseudocyl:
+ elif self.projection in ['ortho','geos','nsper'] + _pseudocyl:
self.latmin = -90.
self.latmax = 90.
self.lonmin = self.llcrnrlon
@@ -906,12 +927,12 @@
if containsPole and\
self.projection in _cylproj + _pseudocyl + ['geos']:
raise ValueError('%s projection cannot cross pole'%(self.projection))
- # make sure orthographic or gnomonic projection has containsPole=True
+ # make sure some projections have has containsPole=True
# we will compute the intersections in stereographic
- # coordinates, then transform to orthographic. This is
+ # coordinates, then transform back. This is
# because these projections are only defined on a hemisphere, and
# some boundary features (like Eurasia) would be undefined otherwise.
- if self.projection in ['ortho','gnom'] and name == 'gshhs':
+ if self.projection in ['ortho','gnom','nsper'] and name == 'gshhs':
containsPole = True
lon_0=self.projparams['lon_0']
lat_0=self.projparams['lat_0']
@@ -922,7 +943,7 @@
lat0 = 90.*(np.around(lat_0/90.))
if np.abs(int(lat0)) == 90: lon0=0.
maptran = pyproj.Proj(proj='stere',lon_0=lon0,lat_0=lat0,R=re)
- # boundary polygon for ortho/gnom projection
+ # boundary polygon for ortho/gnom/nsper projection
# in stereographic coorindates.
b = self._boundarypolyll.boundary
blons = b[:,0]; blats = b[:,1]
@@ -1030,9 +1051,10 @@
else:
# transform coordinates from lat/lon
# to map projection coordinates.
- # special case for ortho/gnom, compute coastline polygon
+ # special case for ortho/gnom/nsper, compute coastline polygon
# vertices in stereographic coords.
- if name == 'gshhs' and self.projection in ['ortho','gnom']:
+ if name == 'gshhs' and self.projection in\
+ ['ortho','gnom','nsper']:
b[:,0], b[:,1] = maptran(b[:,0], b[:,1])
else:
b[:,0], b[:,1] = self(b[:,0], b[:,1])
@@ -1046,10 +1068,10 @@
# in this map projection.
bx = np.compress(goodmask, b[:,0])
by = np.compress(goodmask, b[:,1])
- # for ortho/gnom projection, all points
+ # for ortho/gnom/nsper projection, all points
# outside map projection region are eliminated
# with the above step, so we're done.
- if self.projection in ['ortho','gnom']:
+ if self.projection in ['ortho','gnom','nsper']:
polygons.append(zip(bx,by))
polygon_types.append(type)
continue
@@ -1073,22 +1095,22 @@
# iterate over geometries in intersection.
for psub in geoms:
b = psub.boundary
- # if projection in ['ortho','gnom'],
+ # if projection in ['ortho','gnom','nsper'],
# transform polygon from stereographic
- # to ortho/gnom coordinates.
- if self.projection in ['ortho','gnom']:
+ # to ortho/gnom/nsper coordinates.
+ if self.projection in ['ortho','gnom','nsper']:
# if coastline polygon covers more than 99%
# of map region for fulldisk projection,
# it's probably bogus, so skip it.
areafrac = psub.area()/boundarypolyxy.area()
- if self.projection == 'ortho':
+ if self.projection == ['ortho','nsper']:
if name == 'gshhs' and\
self._fulldisk and\
areafrac > 0.99: continue
# inverse transform from stereographic
# to lat/lon.
b[:,0], b[:,1] = maptran(b[:,0], b[:,1], inverse=True)
- # orthographic/gnomonic.
+ # orthographic/gnomonic/nsper.
b[:,0], b[:,1]= self(b[:,0], b[:,1])
polygons.append(zip(b[:,0],b[:,1]))
polygon_types.append(type)
@@ -1102,7 +1124,7 @@
if self.projection == 'vandg':
nx = 10*nx; ny = 10*ny
maptran = self
- if self.projection in ['ortho','geos']:
+ if self.projection in ['ortho','geos','nsper']:
# circular region.
thetas = np.linspace(0.,2.*np.pi,2*nx*ny)[:-1]
rminor = self._height
@@ -1246,10 +1268,10 @@
# get current axes instance (if none specified).
ax = ax or self._check_ax()
limb = None
- if self.projection in ['ortho','geos'] or (self.projection=='aeqd' and\
+ if self.projection in ['ortho','geos','nsper'] or (self.projection=='aeqd' and\
self._fulldisk):
limb = Ellipse((self._width,self._height),2.*self._width,2.*self._height)
- if self.projection in ['ortho','geos','aeqd'] and self._fulldisk:
+ if self.projection in ['ortho','geos','nsper','aeqd'] and self._fulldisk:
# elliptical region.
ax.add_patch(limb)
if fill_color is None:
@@ -1301,7 +1323,7 @@
except AttributeError:
for spine in ax.spines.itervalues():
spine.set_linewidth(linewidth)
- if self.projection not in ['geos','ortho']:
+ if self.projection not in ['geos','ortho','nsper']:
if fill_color is not None:
ax.axesPatch.set_facecolor(fill_color)
try:
@@ -1876,7 +1898,7 @@
linecolls[circ] = (lines,[])
# draw labels for parallels
# parallels not labelled for fulldisk orthographic or geostationary
- if self.projection in ['ortho','geos','vandg','aeqd'] and max(labels):
+ if self.projection in ['ortho','geos','nsper','vandg','aeqd'] and max(labels):
if self.projection == 'vandg' or self._fulldisk:
print 'Warning: Cannot label parallels on %s basemap' % _projnames[self.projection]
labels = [0,0,0,0]
@@ -2118,7 +2140,7 @@
if self.projection in ['sinu','moll','vandg'] and max(labels):
print 'Warning: Cannot label meridians on %s basemap' % _projnames[self.projection]
labels = [0,0,0,0]
- if self.projection in ['ortho','geos','aeqd'] and max(labels):
+ if self.projection in ['ortho','geos','nsper','aeqd'] and max(labels):
if self._fulldisk:
print dedent(
"""'Warning: Cannot label meridians on full-disk
@@ -2572,7 +2594,7 @@
# turn off axes frame for non-rectangular projections.
if self.projection in _pseudocyl:
ax.set_frame_on(False)
- if self.projection in ['ortho','geos','aeqd'] and self._fulldisk:
+ if self.projection in ['ortho','geos','nsper','aeqd'] and self._fulldisk:
ax.set_frame_on(False)
# make sure aspect ratio of map preserved.
# plot is re-centered in bounding rectangle.
@@ -3298,7 +3320,7 @@
self.transform_scalar(self._bm_rgba[:,:,k],\
self._bm_lons,self._bm_lats,nx,ny,returnxy=True)
# for ortho,geos mask pixels outside projection limb.
- if self.projection in ['geos','ortho'] or \
+ if self.projection in ['geos','ortho','nsper'] or \
(self.projection == 'aeqd' and self._fulldisk):
lonsr,latsr = self(x,y,inverse=True)
mask = ma.zeros((ny,nx,4),np.int8)
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/proj.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/proj.py 2010-02-10 16:00:15 UTC (rev 8124)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/proj.py 2010-02-11 13:02:50 UTC (rev 8125)
@@ -147,6 +147,38 @@
llcrnrx, llcrnry = self(llcrnrlon,llcrnrlat)
if llcrnrx > 1.e20 or llcrnry > 1.e20:
raise ValueError(_lower_left_out_of_bounds)
+ elif self.projection == 'nsper':
+ self._proj4 = pyproj.Proj(projparams)
+ # find major and minor axes of ellipse defining map proj region.
+ # h is measured from surface of earth at equator.
+ h = projparams['h'] + self.rmajor
+ # latitude of horizon on central meridian
+ lonmax = 90.-(180./np.pi)*np.arcsin(self.rmajor/h)
+ # longitude of horizon on equator
+ latmax = 90.-(180./np.pi)*np.arcsin(self.rmajor/h)
+ # truncate to nearest hundredth of a degree (to make sure
+ # they aren't slightly over the horizon)
+ latmax = int(100*latmax)/100.
+ lonmax = int(100*lonmax)/100.
+ # width and height of visible projection
+ P = pyproj.Proj(proj='nsper',a=self.rmajor,\
+ b=self.rminor,lat_0=0,lon_0=0,h=projparams['h'])
+ x1,y1 = P(0.,latmax); x2,y2 = P(lonmax,0.)
+ width = x2; height = y1
+ self._height = height
+ self._width = width
+ if (llcrnrlon == -180 and llcrnrlat == -90 and
+ urcrnrlon == 180 and urcrnrlat == 90):
+ self._fulldisk = True
+ llcrnrx = -width
+ llcrnry = -height
+ urcrnrx = -llcrnrx
+ urcrnry = -llcrnry
+ else:
+ self._fulldisk = False
+ llcrnrx, llcrnry = self(llcrnrlon,llcrnrlat)
+ if llcrnrx > 1.e20 or llcrnry > 1.e20:
+ raise ValueError(_lower_left_out_of_bounds)
elif self.projection in _pseudocyl:
self._proj4 = pyproj.Proj(projparams)
xtmp,urcrnry = self(projparams['lon_0'],90.)
@@ -172,9 +204,9 @@
if urcrnrislatlon:
self.urcrnrlon = urcrnrlon
self.urcrnrlat = urcrnrlat
- if self.projection not in ['ortho','geos','aeqd'] + _pseudocyl:
+ if self.projection not in ['ortho','geos','nsper','aeqd'] + _pseudocyl:
urcrnrx,urcrnry = self(urcrnrlon,urcrnrlat)
- elif self.projection in ['ortho','geos','aeqd']:
+ elif self.projection in ['ortho','geos','nsper','aeqd']:
if self._fulldisk:
urcrnrx = 2.*self._width
urcrnry = 2.*self._height
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2010-02-10 16:00:34
|
Revision: 8124
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8124&view=rev
Author: jdh2358
Date: 2010-02-10 16:00:15 +0000 (Wed, 10 Feb 2010)
Log Message:
-----------
added Yannick Copin's updated sanke demo
Modified Paths:
--------------
trunk/matplotlib/examples/api/sankey_demo.py
Modified: trunk/matplotlib/examples/api/sankey_demo.py
===================================================================
--- trunk/matplotlib/examples/api/sankey_demo.py 2010-02-10 15:56:34 UTC (rev 8123)
+++ trunk/matplotlib/examples/api/sankey_demo.py 2010-02-10 16:00:15 UTC (rev 8124)
@@ -1,105 +1,188 @@
#!/usr/bin/env python
-# Time-stamp: <2010-02-10 01:49:08 ycopin>
-import numpy as np
-import matplotlib.pyplot as plt
-import matplotlib.patches as mpatches
-from matplotlib.path import Path
+__author__ = "Yannick Copin <yc...@ip...>"
+__version__ = "Time-stamp: <10/02/2010 16:49 yc...@ly...>"
-def sankey(ax, losses, labels=None,
- dx=40, dy=10, angle=45, w=3, dip=10, offset=2, **kwargs):
+import numpy as N
+
+def sankey(ax,
+ outputs=[100.], outlabels=None,
+ inputs=[100.], inlabels='',
+ dx=40, dy=10, outangle=45, w=3, inangle=30, offset=2, **kwargs):
"""Draw a Sankey diagram.
- losses: array of losses, should sum up to 100%
- labels: loss labels (same length as losses),
- or None (use default labels) or '' (no labels)
+ outputs: array of outputs, should sum up to 100%
+ outlabels: output labels (same length as outputs),
+ or None (use default labels) or '' (no labels)
+ inputs and inlabels: similar for inputs
dx: horizontal elongation
dy: vertical elongation
- angle: arrow angle [deg]
- w: arrow shoulder
- dip: input dip
+ outangle: output arrow angle [deg]
+ w: output arrow shoulder
+ inangle: input dip angle
offset: text offset
**kwargs: propagated to Patch (e.g. fill=False)
- Return (patch,texts)."""
+ Return (patch,[intexts,outtexts])."""
- assert sum(losses)==100, "Input losses don't sum up to 100%"
+ import matplotlib.patches as mpatches
+ from matplotlib.path import Path
- def add_loss(loss, last=False):
- h = (loss/2+w)*np.tan(angle/180.*np.pi) # Arrow tip height
+ outs = N.absolute(outputs)
+ outsigns = N.sign(outputs)
+ outsigns[-1] = 0 # Last output
+
+ ins = N.absolute(inputs)
+ insigns = N.sign(inputs)
+ insigns[0] = 0 # First input
+
+ assert sum(outs)==100, "Outputs don't sum up to 100%"
+ assert sum(ins)==100, "Inputs don't sum up to 100%"
+
+ def add_output(path, loss, sign=1):
+ h = (loss/2+w)*N.tan(outangle/180.*N.pi) # Arrow tip height
move,(x,y) = path[-1] # Use last point as reference
- if last: # Final loss (horizontal)
+ if sign==0: # Final loss (horizontal)
path.extend([(Path.LINETO,[x+dx,y]),
(Path.LINETO,[x+dx,y+w]),
(Path.LINETO,[x+dx+h,y-loss/2]), # Tip
(Path.LINETO,[x+dx,y-loss-w]),
(Path.LINETO,[x+dx,y-loss])])
- tips.append(path[-3][1])
+ outtips.append((sign,path[-3][1]))
else: # Intermediate loss (vertical)
- path.extend([(Path.LINETO,[x+dx/2,y]),
- (Path.CURVE3,[x+dx,y]),
- (Path.CURVE3,[x+dx,y+dy]),
- (Path.LINETO,[x+dx-w,y+dy]),
- (Path.LINETO,[x+dx+loss/2,y+dy+h]), # Tip
- (Path.LINETO,[x+dx+loss+w,y+dy]),
- (Path.LINETO,[x+dx+loss,y+dy]),
- (Path.CURVE3,[x+dx+loss,y-loss]),
- (Path.CURVE3,[x+dx/2+loss,y-loss])])
- tips.append(path[-5][1])
+ path.extend([(Path.CURVE4,[x+dx/2,y]),
+ (Path.CURVE4,[x+dx,y]),
+ (Path.CURVE4,[x+dx,y+sign*dy]),
+ (Path.LINETO,[x+dx-w,y+sign*dy]),
+ (Path.LINETO,[x+dx+loss/2,y+sign*(dy+h)]), # Tip
+ (Path.LINETO,[x+dx+loss+w,y+sign*dy]),
+ (Path.LINETO,[x+dx+loss,y+sign*dy]),
+ (Path.CURVE3,[x+dx+loss,y-sign*loss]),
+ (Path.CURVE3,[x+dx/2+loss,y-sign*loss])])
+ outtips.append((sign,path[-5][1]))
- tips = [] # Arrow tip positions
- path = [(Path.MOVETO,[0,100])] # 1st point
- for i,loss in enumerate(losses):
- add_loss(loss, last=(i==(len(losses)-1)))
- path.extend([(Path.LINETO,[0,0]),
- (Path.LINETO,[dip,50]), # Dip
- (Path.CLOSEPOLY,[0,100])])
+ def add_input(path, gain, sign=1):
+ h = (gain/2)*N.tan(inangle/180.*N.pi) # Dip depth
+ move,(x,y) = path[-1] # Use last point as reference
+ if sign==0: # First gain (horizontal)
+ path.extend([(Path.LINETO,[x-dx,y]),
+ (Path.LINETO,[x-dx+h,y+gain/2]), # Dip
+ (Path.LINETO,[x-dx,y+gain])])
+ xd,yd = path[-2][1] # Dip position
+ indips.append((sign,[xd-h,yd]))
+ else: # Intermediate gain (vertical)
+ path.extend([(Path.CURVE4,[x-dx/2,y]),
+ (Path.CURVE4,[x-dx,y]),
+ (Path.CURVE4,[x-dx,y+sign*dy]),
+ (Path.LINETO,[x-dx-gain/2,y+sign*(dy-h)]), # Dip
+ (Path.LINETO,[x-dx-gain,y+sign*dy]),
+ (Path.CURVE3,[x-dx-gain,y-sign*gain]),
+ (Path.CURVE3,[x-dx/2-gain,y-sign*gain])])
+ xd,yd = path[-4][1] # Dip position
+ indips.append((sign,[xd,yd+sign*h]))
+
+ outtips = [] # Output arrow tip dir. and positions
+ urpath = [(Path.MOVETO,[0,100])] # 1st point of upper right path
+ lrpath = [(Path.LINETO,[0,0])] # 1st point of lower right path
+ for loss,sign in zip(outs,outsigns):
+ add_output(sign>=0 and urpath or lrpath, loss, sign=sign)
+
+ indips = [] # Input arrow tip dir. and positions
+ llpath = [(Path.LINETO,[0,0])] # 1st point of lower left path
+ ulpath = [(Path.MOVETO,[0,100])] # 1st point of upper left path
+ for gain,sign in zip(ins,insigns)[::-1]:
+ add_input(sign<=0 and llpath or ulpath, gain, sign=sign)
+
+ def revert(path):
+ """A path is not just revertable by path[::-1] because of Bezier
+ curves."""
+ rpath = []
+ nextmove = Path.LINETO
+ for move,pos in path[::-1]:
+ rpath.append((nextmove,pos))
+ nextmove = move
+ return rpath
+
+ # Concatenate subpathes in correct order
+ path = urpath + revert(lrpath) + llpath + revert(ulpath)
+
codes,verts = zip(*path)
- verts = np.array(verts)
+ verts = N.array(verts)
# Path patch
path = Path(verts,codes)
patch = mpatches.PathPatch(path, **kwargs)
ax.add_patch(patch)
+ if False: # DEBUG
+ print "urpath", urpath
+ print "lrpath", revert(lrpath)
+ print "llpath", llpath
+ print "ulpath", revert(ulpath)
+
+ xs,ys = zip(*verts)
+ ax.plot(xs,ys,'go-')
+
# Labels
- if labels=='': # No labels
- pass
- elif labels is None: # Default labels
- labels = [ '%2d%%' % loss for loss in losses ]
- else:
- assert len(labels)==len(losses)
- texts = []
- for i,label in enumerate(labels):
- x,y = tips[i] # Label position
- last = (i==(len(losses)-1))
- if last:
- t = ax.text(x+offset,y,label, ha='left', va='center')
+ def set_labels(labels,values):
+ """Set or check labels according to values."""
+ if labels=='': # No labels
+ return labels
+ elif labels is None: # Default labels
+ return [ '%2d%%' % val for val in values ]
else:
- t = ax.text(x,y+offset,label, ha='center', va='bottom')
- texts.append(t)
+ assert len(labels)==len(values)
+ return labels
+ def put_labels(labels,positions,output=True):
+ """Put labels to positions."""
+ texts = []
+ lbls = output and labels or labels[::-1]
+ for i,label in enumerate(lbls):
+ s,(x,y) = positions[i] # Label direction and position
+ if s==0:
+ t = ax.text(x+offset,y,label,
+ ha=output and 'left' or 'right', va='center')
+ elif s>0:
+ t = ax.text(x,y+offset,label, ha='center', va='bottom')
+ else:
+ t = ax.text(x,y-offset,label, ha='center', va='top')
+ texts.append(t)
+ return texts
+
+ outlabels = set_labels(outlabels, outs)
+ outtexts = put_labels(outlabels, outtips, output=True)
+
+ inlabels = set_labels(inlabels, ins)
+ intexts = put_labels(inlabels, indips, output=False)
+
# Axes management
- ax.set_xlim(verts[:,0].min()-10, verts[:,0].max()+40)
- ax.set_ylim(verts[:,1].min()-10, verts[:,1].max()+20)
+ ax.set_xlim(verts[:,0].min()-dx, verts[:,0].max()+dx)
+ ax.set_ylim(verts[:,1].min()-dy, verts[:,1].max()+dy)
ax.set_aspect('equal', adjustable='datalim')
- ax.set_xticks([])
- ax.set_yticks([])
- return patch,texts
+ return patch,[intexts,outtexts]
if __name__=='__main__':
- losses = [10.,20.,5.,15.,10.,40.]
- labels = ['First','Second','Third','Fourth','Fifth','Hurray!']
- labels = [ s+'\n%d%%' % l for l,s in zip(losses,labels) ]
+ import matplotlib.pyplot as P
- fig = plt.figure()
- ax = fig.add_subplot(1,1,1)
+ outputs = [10.,-20.,5.,15.,-10.,40.]
+ outlabels = ['First','Second','Third','Fourth','Fifth','Hurray!']
+ outlabels = [ s+'\n%d%%' % abs(l) for l,s in zip(outputs,outlabels) ]
- patch,texts = sankey(ax, losses, labels, fc='g', alpha=0.2)
- texts[1].set_color('r')
- texts[-1].set_fontweight('bold')
+ inputs = [60.,-25.,15.]
- plt.show()
+ fig = P.figure()
+ ax = fig.add_subplot(1,1,1, xticks=[],yticks=[],
+ title="Sankey diagram"
+ )
+
+ patch,(intexts,outtexts) = sankey(ax, outputs=outputs, outlabels=outlabels,
+ inputs=inputs, inlabels=None,
+ fc='g', alpha=0.2)
+ outtexts[1].set_color('r')
+ outtexts[-1].set_fontweight('bold')
+
+ P.show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2010-02-10 15:56:40
|
Revision: 8123
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8123&view=rev
Author: jdh2358
Date: 2010-02-10 15:56:34 +0000 (Wed, 10 Feb 2010)
Log Message:
-----------
added Yannick Copin's sanke demo
Added Paths:
-----------
trunk/matplotlib/examples/api/sankey_demo.py
Added: trunk/matplotlib/examples/api/sankey_demo.py
===================================================================
--- trunk/matplotlib/examples/api/sankey_demo.py (rev 0)
+++ trunk/matplotlib/examples/api/sankey_demo.py 2010-02-10 15:56:34 UTC (rev 8123)
@@ -0,0 +1,105 @@
+#!/usr/bin/env python
+# Time-stamp: <2010-02-10 01:49:08 ycopin>
+
+import numpy as np
+import matplotlib.pyplot as plt
+import matplotlib.patches as mpatches
+from matplotlib.path import Path
+
+def sankey(ax, losses, labels=None,
+ dx=40, dy=10, angle=45, w=3, dip=10, offset=2, **kwargs):
+ """Draw a Sankey diagram.
+
+ losses: array of losses, should sum up to 100%
+ labels: loss labels (same length as losses),
+ or None (use default labels) or '' (no labels)
+ dx: horizontal elongation
+ dy: vertical elongation
+ angle: arrow angle [deg]
+ w: arrow shoulder
+ dip: input dip
+ offset: text offset
+ **kwargs: propagated to Patch (e.g. fill=False)
+
+ Return (patch,texts)."""
+
+ assert sum(losses)==100, "Input losses don't sum up to 100%"
+
+ def add_loss(loss, last=False):
+ h = (loss/2+w)*np.tan(angle/180.*np.pi) # Arrow tip height
+ move,(x,y) = path[-1] # Use last point as reference
+ if last: # Final loss (horizontal)
+ path.extend([(Path.LINETO,[x+dx,y]),
+ (Path.LINETO,[x+dx,y+w]),
+ (Path.LINETO,[x+dx+h,y-loss/2]), # Tip
+ (Path.LINETO,[x+dx,y-loss-w]),
+ (Path.LINETO,[x+dx,y-loss])])
+ tips.append(path[-3][1])
+ else: # Intermediate loss (vertical)
+ path.extend([(Path.LINETO,[x+dx/2,y]),
+ (Path.CURVE3,[x+dx,y]),
+ (Path.CURVE3,[x+dx,y+dy]),
+ (Path.LINETO,[x+dx-w,y+dy]),
+ (Path.LINETO,[x+dx+loss/2,y+dy+h]), # Tip
+ (Path.LINETO,[x+dx+loss+w,y+dy]),
+ (Path.LINETO,[x+dx+loss,y+dy]),
+ (Path.CURVE3,[x+dx+loss,y-loss]),
+ (Path.CURVE3,[x+dx/2+loss,y-loss])])
+ tips.append(path[-5][1])
+
+ tips = [] # Arrow tip positions
+ path = [(Path.MOVETO,[0,100])] # 1st point
+ for i,loss in enumerate(losses):
+ add_loss(loss, last=(i==(len(losses)-1)))
+ path.extend([(Path.LINETO,[0,0]),
+ (Path.LINETO,[dip,50]), # Dip
+ (Path.CLOSEPOLY,[0,100])])
+ codes,verts = zip(*path)
+ verts = np.array(verts)
+
+ # Path patch
+ path = Path(verts,codes)
+ patch = mpatches.PathPatch(path, **kwargs)
+ ax.add_patch(patch)
+
+ # Labels
+ if labels=='': # No labels
+ pass
+ elif labels is None: # Default labels
+ labels = [ '%2d%%' % loss for loss in losses ]
+ else:
+ assert len(labels)==len(losses)
+
+ texts = []
+ for i,label in enumerate(labels):
+ x,y = tips[i] # Label position
+ last = (i==(len(losses)-1))
+ if last:
+ t = ax.text(x+offset,y,label, ha='left', va='center')
+ else:
+ t = ax.text(x,y+offset,label, ha='center', va='bottom')
+ texts.append(t)
+
+ # Axes management
+ ax.set_xlim(verts[:,0].min()-10, verts[:,0].max()+40)
+ ax.set_ylim(verts[:,1].min()-10, verts[:,1].max()+20)
+ ax.set_aspect('equal', adjustable='datalim')
+ ax.set_xticks([])
+ ax.set_yticks([])
+
+ return patch,texts
+
+if __name__=='__main__':
+
+ losses = [10.,20.,5.,15.,10.,40.]
+ labels = ['First','Second','Third','Fourth','Fifth','Hurray!']
+ labels = [ s+'\n%d%%' % l for l,s in zip(losses,labels) ]
+
+ fig = plt.figure()
+ ax = fig.add_subplot(1,1,1)
+
+ patch,texts = sankey(ax, losses, labels, fc='g', alpha=0.2)
+ texts[1].set_color('r')
+ texts[-1].set_fontweight('bold')
+
+ plt.show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2010-02-09 13:04:51
|
Revision: 8122
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8122&view=rev
Author: mdboom
Date: 2010-02-09 13:04:44 +0000 (Tue, 09 Feb 2010)
Log Message:
-----------
Use a custom encoding containing all of the used glyphs when writing out a Postscript Type 3 font. This resolves a bug when converting Ps output containing non-standard characters (such as the minus sign) to Pdf using ps2pdf/gs 8.7 or later.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
trunk/matplotlib/ttconv/pprdrv_tt.cpp
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_ps.py 2010-02-08 17:50:27 UTC (rev 8121)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_ps.py 2010-02-09 13:04:44 UTC (rev 8122)
@@ -396,7 +396,7 @@
imagecmd = "false 3 colorimage"
return h, w, bits, imagecmd
-
+
def draw_image(self, gc, x, y, im, dx=None, dy=None, transform=None):
"""
Draw the Image instance into the current axes; x is the
@@ -1110,6 +1110,14 @@
for c in chars:
gind = cmap.get(c) or 0
glyph_ids.append(gind)
+
+ fonttype = rcParams['ps.fonttype']
+
+ # Can not use more than 255 characters from a
+ # single font for Type 3
+ if len(glyph_ids) > 255:
+ fonttype = 42
+
# The ttf to ps (subsetting) support doesn't work for
# OpenType fonts that are Postscript inside (like the
# STIX fonts). This will simply turn that off to avoid
@@ -1118,7 +1126,7 @@
raise RuntimeError("OpenType CFF fonts can not be saved using the internal Postscript backend at this time.\nConsider using the Cairo backend.")
else:
fonttype = rcParams['ps.fonttype']
- convert_ttf_to_ps(font_filename, fh, rcParams['ps.fonttype'], glyph_ids)
+ convert_ttf_to_ps(font_filename, fh, fonttype, glyph_ids)
print >>fh, "end"
print >>fh, "%%EndProlog"
@@ -1394,7 +1402,7 @@
"""
paper_option = "-sPAPERSIZE=%s" % ptype
-
+
psfile = tmpfile + '.ps'
outfile = tmpfile + '.output'
dpi = rcParams['ps.distiller.res']
@@ -1436,7 +1444,7 @@
if eps: paper_option = "-dEPSCrop"
else: paper_option = "-sPAPERSIZE=%s" % ptype
-
+
command = 'ps2pdf -dAutoFilterColorImages=false \
-sColorImageFilter=FlateEncode %s "%s" "%s" > "%s"'% \
(paper_option, tmpfile, pdffile, outfile)
Modified: trunk/matplotlib/ttconv/pprdrv_tt.cpp
===================================================================
--- trunk/matplotlib/ttconv/pprdrv_tt.cpp 2010-02-08 17:50:27 UTC (rev 8121)
+++ trunk/matplotlib/ttconv/pprdrv_tt.cpp 2010-02-09 13:04:44 UTC (rev 8122)
@@ -58,10 +58,10 @@
ULONG val=0;
for(x=0; x<4; x++)
- {
- val *= 0x100;
- val += p[x];
- }
+ {
+ val *= 0x100;
+ val += p[x];
+ }
return val;
} /* end of ftohULONG() */
@@ -75,10 +75,10 @@
USHORT val=0;
for(x=0; x<2; x++)
- {
- val *= 0x100;
- val += p[x];
- }
+ {
+ val *= 0x100;
+ val += p[x];
+ }
return val;
} /* end of getUSHORT() */
@@ -120,38 +120,38 @@
ptr = font->offset_table + 12;
x=0;
while(TRUE)
- {
- if( strncmp((const char*)ptr,name,4) == 0 )
- {
- ULONG offset,length;
- BYTE *table;
+ {
+ if( strncmp((const char*)ptr,name,4) == 0 )
+ {
+ ULONG offset,length;
+ BYTE *table;
- offset = getULONG( ptr + 8 );
- length = getULONG( ptr + 12 );
- table = (BYTE*)calloc( sizeof(BYTE), length );
+ offset = getULONG( ptr + 8 );
+ length = getULONG( ptr + 12 );
+ table = (BYTE*)calloc( sizeof(BYTE), length );
- try {
+ try {
#ifdef DEBUG_TRUETYPE
- debug("Loading table \"%s\" from offset %d, %d bytes",name,offset,length);
+ debug("Loading table \"%s\" from offset %d, %d bytes",name,offset,length);
#endif
- if( fseek( font->file, (long)offset, SEEK_SET ) )
- throw TTException("TrueType font may be corrupt (reason 3)");
+ if( fseek( font->file, (long)offset, SEEK_SET ) )
+ throw TTException("TrueType font may be corrupt (reason 3)");
- if( fread(table,sizeof(BYTE),length,font->file) != (sizeof(BYTE) * length))
- throw TTException("TrueType font may be corrupt (reason 4)");
- } catch (TTException& ) {
- free(table);
- throw;
- }
- return table;
- }
+ if( fread(table,sizeof(BYTE),length,font->file) != (sizeof(BYTE) * length))
+ throw TTException("TrueType font may be corrupt (reason 4)");
+ } catch (TTException& ) {
+ free(table);
+ throw;
+ }
+ return table;
+ }
- x++;
- ptr += 16;
- if(x == font->numTables)
- throw TTException("TrueType font is missing table");
- }
+ x++;
+ ptr += 16;
+ if(x == font->numTables)
+ throw TTException("TrueType font is missing table");
+ }
} /* end of GetTable() */
@@ -165,12 +165,12 @@
void Read_name(struct TTFONT *font)
{
BYTE *table_ptr,*ptr2;
- int numrecords; /* Number of strings in this table */
- BYTE *strings; /* pointer to start of string storage */
+ int numrecords; /* Number of strings in this table */
+ BYTE *strings; /* pointer to start of string storage */
int x;
- int platform,encoding; /* Current platform id, encoding id, */
- int language,nameid; /* language id, name id, */
- int offset,length; /* offset and length of string. */
+ int platform,encoding; /* Current platform id, encoding id, */
+ int language,nameid; /* language id, name id, */
+ int offset,length; /* offset and length of string. */
#ifdef DEBUG_TRUETYPE
debug("Read_name()");
@@ -192,136 +192,136 @@
}
font->Copyright = font->Trademark = (char*)NULL;
- table_ptr = GetTable(font, "name"); /* pointer to table */
+ table_ptr = GetTable(font, "name"); /* pointer to table */
try {
- numrecords = getUSHORT( table_ptr + 2 ); /* number of names */
- strings = table_ptr + getUSHORT( table_ptr + 4 ); /* start of string storage */
+ numrecords = getUSHORT( table_ptr + 2 ); /* number of names */
+ strings = table_ptr + getUSHORT( table_ptr + 4 ); /* start of string storage */
ptr2 = table_ptr + 6;
for(x=0; x < numrecords; x++,ptr2+=12)
- {
- platform = getUSHORT(ptr2);
- encoding = getUSHORT(ptr2+2);
- language = getUSHORT(ptr2+4);
- nameid = getUSHORT(ptr2+6);
- length = getUSHORT(ptr2+8);
- offset = getUSHORT(ptr2+10);
+ {
+ platform = getUSHORT(ptr2);
+ encoding = getUSHORT(ptr2+2);
+ language = getUSHORT(ptr2+4);
+ nameid = getUSHORT(ptr2+6);
+ length = getUSHORT(ptr2+8);
+ offset = getUSHORT(ptr2+10);
#ifdef DEBUG_TRUETYPE
- debug("platform %d, encoding %d, language 0x%x, name %d, offset %d, length %d",
- platform,encoding,language,nameid,offset,length);
+ debug("platform %d, encoding %d, language 0x%x, name %d, offset %d, length %d",
+ platform,encoding,language,nameid,offset,length);
#endif
- /* Copyright notice */
- if( platform == 1 && nameid == 0 )
- {
- font->Copyright = (char*)calloc(sizeof(char),length+1);
- strncpy(font->Copyright,(const char*)strings+offset,length);
- font->Copyright[length]=(char)NULL;
- replace_newlines_with_spaces(font->Copyright);
+ /* Copyright notice */
+ if( platform == 1 && nameid == 0 )
+ {
+ font->Copyright = (char*)calloc(sizeof(char),length+1);
+ strncpy(font->Copyright,(const char*)strings+offset,length);
+ font->Copyright[length]=(char)NULL;
+ replace_newlines_with_spaces(font->Copyright);
#ifdef DEBUG_TRUETYPE
- debug("font->Copyright=\"%s\"",font->Copyright);
+ debug("font->Copyright=\"%s\"",font->Copyright);
#endif
- continue;
- }
+ continue;
+ }
- /* Font Family name */
- if( platform == 1 && nameid == 1 )
- {
- free(font->FamilyName);
- font->FamilyName = (char*)calloc(sizeof(char),length+1);
- strncpy(font->FamilyName,(const char*)strings+offset,length);
- font->FamilyName[length]=(char)NULL;
- replace_newlines_with_spaces(font->FamilyName);
+ /* Font Family name */
+ if( platform == 1 && nameid == 1 )
+ {
+ free(font->FamilyName);
+ font->FamilyName = (char*)calloc(sizeof(char),length+1);
+ strncpy(font->FamilyName,(const char*)strings+offset,length);
+ font->FamilyName[length]=(char)NULL;
+ replace_newlines_with_spaces(font->FamilyName);
#ifdef DEBUG_TRUETYPE
- debug("font->FamilyName=\"%s\"",font->FamilyName);
+ debug("font->FamilyName=\"%s\"",font->FamilyName);
#endif
- continue;
- }
+ continue;
+ }
- /* Font Family name */
- if( platform == 1 && nameid == 2 )
- {
- free(font->Style);
- font->Style = (char*)calloc(sizeof(char),length+1);
- strncpy(font->Style,(const char*)strings+offset,length);
- font->Style[length]=(char)NULL;
- replace_newlines_with_spaces(font->Style);
+ /* Font Family name */
+ if( platform == 1 && nameid == 2 )
+ {
+ free(font->Style);
+ font->Style = (char*)calloc(sizeof(char),length+1);
+ strncpy(font->Style,(const char*)strings+offset,length);
+ font->Style[length]=(char)NULL;
+ replace_newlines_with_spaces(font->Style);
#ifdef DEBUG_TRUETYPE
- debug("font->Style=\"%s\"",font->Style);
+ debug("font->Style=\"%s\"",font->Style);
#endif
- continue;
- }
+ continue;
+ }
- /* Full Font name */
- if( platform == 1 && nameid == 4 )
- {
- free(font->FullName);
- font->FullName = (char*)calloc(sizeof(char),length+1);
- strncpy(font->FullName,(const char*)strings+offset,length);
- font->FullName[length]=(char)NULL;
- replace_newlines_with_spaces(font->FullName);
+ /* Full Font name */
+ if( platform == 1 && nameid == 4 )
+ {
+ free(font->FullName);
+ font->FullName = (char*)calloc(sizeof(char),length+1);
+ strncpy(font->FullName,(const char*)strings+offset,length);
+ font->FullName[length]=(char)NULL;
+ replace_newlines_with_spaces(font->FullName);
#ifdef DEBUG_TRUETYPE
- debug("font->FullName=\"%s\"",font->FullName);
+ debug("font->FullName=\"%s\"",font->FullName);
#endif
- continue;
- }
+ continue;
+ }
- /* Version string */
- if( platform == 1 && nameid == 5 )
- {
- free(font->Version);
- font->Version = (char*)calloc(sizeof(char),length+1);
- strncpy(font->Version,(const char*)strings+offset,length);
- font->Version[length]=(char)NULL;
- replace_newlines_with_spaces(font->Version);
+ /* Version string */
+ if( platform == 1 && nameid == 5 )
+ {
+ free(font->Version);
+ font->Version = (char*)calloc(sizeof(char),length+1);
+ strncpy(font->Version,(const char*)strings+offset,length);
+ font->Version[length]=(char)NULL;
+ replace_newlines_with_spaces(font->Version);
#ifdef DEBUG_TRUETYPE
- debug("font->Version=\"%s\"",font->Version);
+ debug("font->Version=\"%s\"",font->Version);
#endif
- continue;
- }
+ continue;
+ }
- /* PostScript name */
- if( platform == 1 && nameid == 6 )
- {
- free(font->PostName);
- font->PostName = (char*)calloc(sizeof(char),length+1);
- strncpy(font->PostName,(const char*)strings+offset,length);
- font->PostName[length]=(char)NULL;
- replace_newlines_with_spaces(font->PostName);
+ /* PostScript name */
+ if( platform == 1 && nameid == 6 )
+ {
+ free(font->PostName);
+ font->PostName = (char*)calloc(sizeof(char),length+1);
+ strncpy(font->PostName,(const char*)strings+offset,length);
+ font->PostName[length]=(char)NULL;
+ replace_newlines_with_spaces(font->PostName);
#ifdef DEBUG_TRUETYPE
- debug("font->PostName=\"%s\"",font->PostName);
+ debug("font->PostName=\"%s\"",font->PostName);
#endif
- continue;
- }
+ continue;
+ }
- /* Trademark string */
- if( platform == 1 && nameid == 7 )
- {
- font->Trademark = (char*)calloc(sizeof(char),length+1);
- strncpy(font->Trademark,(const char*)strings+offset,length);
- font->Trademark[length]=(char)NULL;
- replace_newlines_with_spaces(font->Trademark);
+ /* Trademark string */
+ if( platform == 1 && nameid == 7 )
+ {
+ font->Trademark = (char*)calloc(sizeof(char),length+1);
+ strncpy(font->Trademark,(const char*)strings+offset,length);
+ font->Trademark[length]=(char)NULL;
+ replace_newlines_with_spaces(font->Trademark);
#ifdef DEBUG_TRUETYPE
- debug("font->Trademark=\"%s\"",font->Trademark);
+ debug("font->Trademark=\"%s\"",font->Trademark);
#endif
- continue;
- }
+ continue;
+ }
- }
+ }
} catch (TTException& ) {
free(table_ptr);
throw;
@@ -346,17 +346,17 @@
** font manufacturer's revision number for the font.
*/
if( font->target_type == PS_TYPE_42 )
- {
- stream.printf("%%!PS-TrueTypeFont-%d.%d-%d.%d\n",
- font->TTVersion.whole, font->TTVersion.fraction,
- font->MfrRevision.whole, font->MfrRevision.fraction);
- }
+ {
+ stream.printf("%%!PS-TrueTypeFont-%d.%d-%d.%d\n",
+ font->TTVersion.whole, font->TTVersion.fraction,
+ font->MfrRevision.whole, font->MfrRevision.fraction);
+ }
/* If it is not a Type 42 font, we will use a different format. */
else
- {
- stream.putline("%!PS-Adobe-3.0 Resource-Font");
- } /* See RBIIp 641 */
+ {
+ stream.putline("%!PS-Adobe-3.0 Resource-Font");
+ } /* See RBIIp 641 */
/* We will make the title the name of the font. */
stream.printf("%%%%Title: %s\n",font->FullName);
@@ -367,46 +367,46 @@
/* We created this file. */
if( font->target_type == PS_TYPE_42 )
- stream.putline("%%Creator: Converted from TrueType to type 42 by PPR");
+ stream.putline("%%Creator: Converted from TrueType to type 42 by PPR");
else
- stream.putline("%%Creator: Converted from TrueType by PPR");
+ stream.putline("%%Creator: Converted from TrueType by PPR");
/* If VM usage information is available, print it. */
if( font->target_type == PS_TYPE_42 )
- {
- VMMin = (int)getULONG( font->post_table + 16 );
- VMMax = (int)getULONG( font->post_table + 20 );
- if( VMMin > 0 && VMMax > 0 )
- stream.printf("%%%%VMUsage: %d %d\n",VMMin,VMMax);
- }
+ {
+ VMMin = (int)getULONG( font->post_table + 16 );
+ VMMax = (int)getULONG( font->post_table + 20 );
+ if( VMMin > 0 && VMMax > 0 )
+ stream.printf("%%%%VMUsage: %d %d\n",VMMin,VMMax);
+ }
/* Start the dictionary which will eventually */
/* become the font. */
if( font->target_type != PS_TYPE_3 )
- {
- stream.putline("15 dict begin");
- }
+ {
+ stream.putline("15 dict begin");
+ }
else
- {
- stream.putline("25 dict begin");
+ {
+ stream.putline("25 dict begin");
- /* Type 3 fonts will need some subroutines here. */
- stream.putline("/_d{bind def}bind def");
- stream.putline("/_m{moveto}_d");
- stream.putline("/_l{lineto}_d");
- stream.putline("/_cl{closepath eofill}_d");
- stream.putline("/_c{curveto}_d");
- stream.putline("/_sc{7 -1 roll{setcachedevice}{pop pop pop pop pop pop}ifelse}_d");
- stream.putline("/_e{exec}_d");
- }
+ /* Type 3 fonts will need some subroutines here. */
+ stream.putline("/_d{bind def}bind def");
+ stream.putline("/_m{moveto}_d");
+ stream.putline("/_l{lineto}_d");
+ stream.putline("/_cl{closepath eofill}_d");
+ stream.putline("/_c{curveto}_d");
+ stream.putline("/_sc{7 -1 roll{setcachedevice}{pop pop pop pop pop pop}ifelse}_d");
+ stream.putline("/_e{exec}_d");
+ }
stream.printf("/FontName /%s def\n",font->PostName);
stream.putline("/PaintType 0 def");
if(font->target_type == PS_TYPE_42)
- stream.putline("/FontMatrix[1 0 0 1 0 0]def");
+ stream.putline("/FontMatrix[1 0 0 1 0 0]def");
else
- stream.putline("/FontMatrix[.001 0 0 .001 0 0]def");
+ stream.putline("/FontMatrix[.001 0 0 .001 0 0]def");
stream.printf("/FontBBox[%d %d %d %d]def\n",font->llx,font->lly,font->urx,font->ury);
stream.printf("/FontType %d def\n", font->target_type );
@@ -414,11 +414,25 @@
/*-------------------------------------------------------------
** Define the encoding array for this font.
-** It seems best to just use "Standard".
+** Since we don't really want to deal with converting all of
+** the possible font encodings in the wild to a standard PS
+** one, we just explicitly create one for each font.
-------------------------------------------------------------*/
-void ttfont_encoding(TTStreamWriter& stream)
+void ttfont_encoding(TTStreamWriter& stream, struct TTFONT *font, std::vector<int>& glyph_ids, font_type_enum target_type)
{
- stream.putline("/Encoding StandardEncoding def");
+ if (target_type == PS_TYPE_3) {
+ stream.printf("/Encoding [ ");
+
+ for (std::vector<int>::const_iterator i = glyph_ids.begin();
+ i != glyph_ids.end(); ++i) {
+ const char* name = ttfont_CharStrings_getname(font, *i);
+ stream.printf("/%s ", name);
+ }
+
+ stream.printf("] def\n");
+ } else {
+ stream.putline("/Encoding StandardEncoding def");
+ }
} /* end of ttfont_encoding() */
/*-----------------------------------------------------------
@@ -439,13 +453,13 @@
stream.printf("/FullName (%s) def\n",font->FullName);
if( font->Copyright != (char*)NULL || font->Trademark != (char*)NULL )
- {
- stream.printf("/Notice (%s",
- font->Copyright != (char*)NULL ? font->Copyright : "");
- stream.printf("%s%s) def\n",
- font->Trademark != (char*)NULL ? " " : "",
- font->Trademark != (char*)NULL ? font->Trademark : "");
- }
+ {
+ stream.printf("/Notice (%s",
+ font->Copyright != (char*)NULL ? font->Copyright : "");
+ stream.printf("%s%s) def\n",
+ font->Trademark != (char*)NULL ? " " : "",
+ font->Trademark != (char*)NULL ? font->Trademark : "");
+ }
/* This information is not quite correct. */
stream.printf("/Weight (%s) def\n",font->Style);
@@ -494,12 +508,12 @@
static const char hexdigits[]="0123456789ABCDEF";
if(!in_string)
- {
- stream.put_char('<');
- string_len=0;
- line_len++;
- in_string=TRUE;
- }
+ {
+ stream.put_char('<');
+ string_len=0;
+ line_len++;
+ in_string=TRUE;
+ }
stream.put_char( hexdigits[ n / 16 ] );
stream.put_char( hexdigits[ n % 16 ] );
@@ -507,10 +521,10 @@
line_len+=2;
if(line_len > 70)
- {
- stream.put_char('\n');
- line_len=0;
- }
+ {
+ stream.put_char('\n');
+ line_len=0;
+ }
} /* end of sfnts_pputBYTE() */
@@ -553,17 +567,17 @@
void sfnts_end_string(TTStreamWriter& stream)
{
if(in_string)
- {
- string_len=0; /* fool sfnts_pputBYTE() */
+ {
+ string_len=0; /* fool sfnts_pputBYTE() */
- #ifdef DEBUG_TRUETYPE_INLINE
- puts("\n% dummy byte:\n");
- #endif
+ #ifdef DEBUG_TRUETYPE_INLINE
+ puts("\n% dummy byte:\n");
+ #endif
- sfnts_pputBYTE(stream, 0); /* extra byte for pre-2013 compatibility */
- stream.put_char('>');
- line_len++;
- }
+ sfnts_pputBYTE(stream, 0); /* extra byte for pre-2013 compatibility */
+ stream.put_char('>');
+ line_len++;
+ }
in_string=FALSE;
} /* end of sfnts_end_string() */
@@ -589,7 +603,7 @@
ULONG off;
ULONG length;
int c;
- ULONG total=0; /* running total of bytes written to table */
+ ULONG total=0; /* running total of bytes written to table */
int x;
#ifdef DEBUG_TRUETYPE
@@ -604,58 +618,58 @@
/* Copy the glyphs one by one */
for(x=0; x < font->numGlyphs; x++)
- {
- /* Read the glyph offset from the index-to-location table. */
- if(font->indexToLocFormat == 0)
- {
- off = getUSHORT( font->loca_table + (x * 2) );
- off *= 2;
- length = getUSHORT( font->loca_table + ((x+1) * 2) );
- length *= 2;
- length -= off;
- }
- else
- {
- off = getULONG( font->loca_table + (x * 4) );
- length = getULONG( font->loca_table + ((x+1) * 4) );
- length -= off;
- }
+ {
+ /* Read the glyph offset from the index-to-location table. */
+ if(font->indexToLocFormat == 0)
+ {
+ off = getUSHORT( font->loca_table + (x * 2) );
+ off *= 2;
+ length = getUSHORT( font->loca_table + ((x+1) * 2) );
+ length *= 2;
+ length -= off;
+ }
+ else
+ {
+ off = getULONG( font->loca_table + (x * 4) );
+ length = getULONG( font->loca_table + ((x+1) * 4) );
+ length -= off;
+ }
- #ifdef DEBUG_TRUETYPE
- debug("glyph length=%d",(int)length);
- #endif
+ #ifdef DEBUG_TRUETYPE
+ debug("glyph length=%d",(int)length);
+ #endif
- /* Start new string if necessary. */
- sfnts_new_table( stream, (int)length );
+ /* Start new string if necessary. */
+ sfnts_new_table( stream, (int)length );
- /*
- ** Make sure the glyph is padded out to a
- ** two byte boundary.
- */
- if( length % 2 )
- throw TTException("TrueType font contains a 'glyf' table without 2 byte padding");
+ /*
+ ** Make sure the glyph is padded out to a
+ ** two byte boundary.
+ */
+ if( length % 2 )
+ throw TTException("TrueType font contains a 'glyf' table without 2 byte padding");
- /* Copy the bytes of the glyph. */
- while( length-- )
- {
- if( (c = fgetc(font->file)) == EOF )
- throw TTException("TrueType font may be corrupt (reason 6)");
+ /* Copy the bytes of the glyph. */
+ while( length-- )
+ {
+ if( (c = fgetc(font->file)) == EOF )
+ throw TTException("TrueType font may be corrupt (reason 6)");
- sfnts_pputBYTE(stream, c);
- total++; /* add to running total */
- }
+ sfnts_pputBYTE(stream, c);
+ total++; /* add to running total */
+ }
- }
+ }
free(font->loca_table);
font->loca_table = NULL;
/* Pad out to full length from table directory */
while( total < correct_total_length )
- {
- sfnts_pputBYTE(stream, 0);
- total++;
- }
+ {
+ sfnts_pputBYTE(stream, 0);
+ total++;
+ }
} /* end of sfnts_glyf_table() */
@@ -667,32 +681,32 @@
*/
void ttfont_sfnts(TTStreamWriter& stream, struct TTFONT *font)
{
- static const char *table_names[] = /* The names of all tables */
- { /* which it is worth while */
- "cvt ", /* to include in a Type 42 */
- "fpgm", /* PostScript font. */
- "glyf",
- "head",
- "hhea",
- "hmtx",
- "loca",
- "maxp",
- "prep"
- } ;
+ static const char *table_names[] = /* The names of all tables */
+ { /* which it is worth while */
+ "cvt ", /* to include in a Type 42 */
+ "fpgm", /* PostScript font. */
+ "glyf",
+ "head",
+ "hhea",
+ "hmtx",
+ "loca",
+ "maxp",
+ "prep"
+ } ;
- struct { /* The location of each of */
- ULONG oldoffset; /* the above tables. */
- ULONG newoffset;
- ULONG length;
- ULONG checksum;
- } tables[9];
+ struct { /* The location of each of */
+ ULONG oldoffset; /* the above tables. */
+ ULONG newoffset;
+ ULONG length;
+ ULONG checksum;
+ } tables[9];
- BYTE *ptr; /* A pointer into the origional table directory. */
- ULONG x,y; /* General use loop countes. */
- int c; /* Input character. */
+ BYTE *ptr; /* A pointer into the origional table directory. */
+ ULONG x,y; /* General use loop countes. */
+ int c; /* Input character. */
int diff;
ULONG nextoffset;
- int count; /* How many `important' tables did we find? */
+ int count; /* How many `important' tables did we find? */
ptr = font->offset_table + 12;
nextoffset=0;
@@ -703,32 +717,32 @@
** statistics in tables[].
*/
for(x=0; x < 9; x++ )
- {
- do {
- diff = strncmp( (char*)ptr, table_names[x], 4 );
+ {
+ do {
+ diff = strncmp( (char*)ptr, table_names[x], 4 );
- if( diff > 0 ) /* If we are past it. */
- {
- tables[x].length = 0;
- diff = 0;
- }
- else if( diff < 0 ) /* If we haven't hit it yet. */
- {
- ptr += 16;
- }
- else if( diff == 0 ) /* Here it is! */
- {
- tables[x].newoffset = nextoffset;
- tables[x].checksum = getULONG( ptr + 4 );
- tables[x].oldoffset = getULONG( ptr + 8 );
- tables[x].length = getULONG( ptr + 12 );
- nextoffset += ( ((tables[x].length + 3) / 4) * 4 );
- count++;
- ptr += 16;
- }
- } while(diff != 0);
+ if( diff > 0 ) /* If we are past it. */
+ {
+ tables[x].length = 0;
+ diff = 0;
+ }
+ else if( diff < 0 ) /* If we haven't hit it yet. */
+ {
+ ptr += 16;
+ }
+ else if( diff == 0 ) /* Here it is! */
+ {
+ tables[x].newoffset = nextoffset;
+ tables[x].checksum = getULONG( ptr + 4 );
+ tables[x].oldoffset = getULONG( ptr + 8 );
+ tables[x].length = getULONG( ptr + 12 );
+ nextoffset += ( ((tables[x].length + 3) / 4) * 4 );
+ count++;
+ ptr += 16;
+ }
+ } while(diff != 0);
- } /* end of for loop which passes over the table directory */
+ } /* end of for loop which passes over the table directory */
/* Begin the sfnts array. */
sfnts_start(stream);
@@ -737,95 +751,95 @@
/* Start by copying the TrueType version number. */
ptr = font->offset_table;
for(x=0; x < 4; x++)
- {
- sfnts_pputBYTE( stream, *(ptr++) );
- }
+ {
+ sfnts_pputBYTE( stream, *(ptr++) );
+ }
/* Now, generate those silly numTables numbers. */
- sfnts_pputUSHORT(stream, count); /* number of tables */
+ sfnts_pputUSHORT(stream, count); /* number of tables */
if( count == 9 )
- {
- sfnts_pputUSHORT(stream, 7); /* searchRange */
- sfnts_pputUSHORT(stream, 3); /* entrySelector */
- sfnts_pputUSHORT(stream, 81); /* rangeShift */
- }
+ {
+ sfnts_pputUSHORT(stream, 7); /* searchRange */
+ sfnts_pputUSHORT(stream, 3); /* entrySelector */
+ sfnts_pputUSHORT(stream, 81); /* rangeShift */
+ }
#ifdef DEBUG_TRUETYPE
else
- {
- debug("only %d tables selected",count);
- }
+ {
+ debug("only %d tables selected",count);
+ }
#endif
/* Now, emmit the table directory. */
for(x=0; x < 9; x++)
- {
- if( tables[x].length == 0 ) /* Skip missing tables */
- continue;
+ {
+ if( tables[x].length == 0 ) /* Skip missing tables */
+ continue;
- /* Name */
- sfnts_pputBYTE( stream, table_names[x][0] );
- sfnts_pputBYTE( stream, table_names[x][1] );
- sfnts_pputBYTE( stream, table_names[x][2] );
- sfnts_pputBYTE( stream, table_names[x][3] );
+ /* Name */
+ sfnts_pputBYTE( stream, table_names[x][0] );
+ sfnts_pputBYTE( stream, table_names[x][1] );
+ sfnts_pputBYTE( stream, table_names[x][2] );
+ sfnts_pputBYTE( stream, table_names[x][3] );
- /* Checksum */
- sfnts_pputULONG( stream, tables[x].checksum );
+ /* Checksum */
+ sfnts_pputULONG( stream, tables[x].checksum );
- /* Offset */
- sfnts_pputULONG( stream, tables[x].newoffset + 12 + (count * 16) );
+ /* Offset */
+ sfnts_pputULONG( stream, tables[x].newoffset + 12 + (count * 16) );
- /* Length */
- sfnts_pputULONG( stream, tables[x].length );
- }
+ /* Length */
+ sfnts_pputULONG( stream, tables[x].length );
+ }
/* Now, send the tables */
for(x=0; x < 9; x++)
- {
- if( tables[x].length == 0 ) /* skip tables that aren't there */
- continue;
+ {
+ if( tables[x].length == 0 ) /* skip tables that aren't there */
+ continue;
- #ifdef DEBUG_TRUETYPE
- debug("emmiting table '%s'",table_names[x]);
- #endif
+ #ifdef DEBUG_TRUETYPE
+ debug("emmiting table '%s'",table_names[x]);
+ #endif
- /* 'glyf' table gets special treatment */
- if( strcmp(table_names[x],"glyf")==0 )
- {
- sfnts_glyf_table(stream,font,tables[x].oldoffset,tables[x].length);
- }
- else /* Other tables may not exceed */
- { /* 65535 bytes in length. */
- if( tables[x].length > 65535 )
- throw TTException("TrueType font has a table which is too long");
+ /* 'glyf' table gets special treatment */
+ if( strcmp(table_names[x],"glyf")==0 )
+ {
+ sfnts_glyf_table(stream,font,tables[x].oldoffset,tables[x].length);
+ }
+ else /* Other tables may not exceed */
+ { /* 65535 bytes in length. */
+ if( tables[x].length > 65535 )
+ throw TTException("TrueType font has a table which is too long");
- /* Start new string if necessary. */
- sfnts_new_table(stream, tables[x].length);
+ /* Start new string if necessary. */
+ sfnts_new_table(stream, tables[x].length);
- /* Seek to proper position in the file. */
- fseek( font->file, tables[x].oldoffset, SEEK_SET );
+ /* Seek to proper position in the file. */
+ fseek( font->file, tables[x].oldoffset, SEEK_SET );
- /* Copy the bytes of the table. */
- for( y=0; y < tables[x].length; y++ )
- {
- if( (c = fgetc(font->file)) == EOF )
- throw TTException("TrueType font may be corrupt (reason 7)");
+ /* Copy the bytes of the table. */
+ for( y=0; y < tables[x].length; y++ )
+ {
+ if( (c = fgetc(font->file)) == EOF )
+ throw TTException("TrueType font may be corrupt (reason 7)");
- sfnts_pputBYTE(stream, c);
- }
- }
+ sfnts_pputBYTE(stream, c);
+ }
+ }
- /* Padd it out to a four byte boundary. */
- y=tables[x].length;
- while( (y % 4) != 0 )
- {
- sfnts_pputBYTE(stream, 0);
- y++;
- #ifdef DEBUG_TRUETYPE_INLINE
- puts("\n% pad byte:\n");
- #endif
- }
+ /* Padd it out to a four byte boundary. */
+ y=tables[x].length;
+ while( (y % 4) != 0 )
+ {
+ sfnts_pputBYTE(stream, 0);
+ y++;
+ #ifdef DEBUG_TRUETYPE_INLINE
+ puts("\n% pad byte:\n");
+ #endif
+ }
- } /* End of loop for all tables */
+ } /* End of loop for all tables */
/* Close the array. */
sfnts_end_string(stream);
@@ -893,32 +907,32 @@
GlyphIndex = (int)getUSHORT( font->post_table + 34 + (charindex * 2) );
- if( GlyphIndex <= 257 ) /* If a standard Apple name, */
- {
- return Apple_CharStrings[GlyphIndex];
- }
- else /* Otherwise, use one */
- { /* of the pascal strings. */
- GlyphIndex -= 258;
+ if( GlyphIndex <= 257 ) /* If a standard Apple name, */
+ {
+ return Apple_CharStrings[GlyphIndex];
+ }
+ else /* Otherwise, use one */
+ { /* of the pascal strings. */
+ GlyphIndex -= 258;
- /* Set pointer to start of Pascal strings. */
- ptr = (char*)(font->post_table + 34 + (font->numGlyphs * 2));
+ /* Set pointer to start of Pascal strings. */
+ ptr = (char*)(font->post_table + 34 + (font->numGlyphs * 2));
- len = (ULONG)*(ptr++); /* Step thru the strings */
- while(GlyphIndex--) /* until we get to the one */
- { /* that we want. */
- ptr += len;
- len = (ULONG)*(ptr++);
- }
+ len = (ULONG)*(ptr++); /* Step thru the strings */
+ while(GlyphIndex--) /* until we get to the one */
+ { /* that we want. */
+ ptr += len;
+ len = (ULONG)*(ptr++);
+ }
- if( len >= sizeof(temp) )
- throw TTException("TrueType font file contains a very long PostScript name");
+ if( len >= sizeof(temp) )
+ throw TTException("TrueType font file contains a very long PostScript name");
- strncpy(temp,ptr,len); /* Copy the pascal string into */
- temp[len]=(char)NULL; /* a buffer and make it ASCIIz. */
+ strncpy(temp,ptr,len); /* Copy the pascal string into */
+ temp[len]=(char)NULL; /* a buffer and make it ASCIIz. */
- return temp;
- }
+ return temp;
+ }
} /* end of ttfont_CharStrings_getname() */
/*
@@ -932,28 +946,28 @@
post_format = getFixed( font->post_table );
if( post_format.whole != 2 || post_format.fraction != 0 )
- throw TTException("TrueType fontdoes not have a format 2.0 'post' table");
+ throw TTException("TrueType fontdoes not have a format 2.0 'post' table");
/* Emmit the start of the PostScript code to define the dictionary. */
stream.printf("/CharStrings %d dict dup begin\n", glyph_ids.size());
/* Emmit one key-value pair for each glyph. */
for(std::vector<int>::const_iterator i = glyph_ids.begin();
- i != glyph_ids.end(); ++i)
- {
- if(font->target_type == PS_TYPE_42) /* type 42 */
- {
- stream.printf("/%s %d def\n",ttfont_CharStrings_getname(font, *i), *i);
- }
- else /* type 3 */
- {
- stream.printf("/%s{",ttfont_CharStrings_getname(font, *i));
+ i != glyph_ids.end(); ++i)
+ {
+ if(font->target_type == PS_TYPE_42) /* type 42 */
+ {
+ stream.printf("/%s %d def\n",ttfont_CharStrings_getname(font, *i), *i);
+ }
+ else /* type 3 */
+ {
+ stream.printf("/%s{",ttfont_CharStrings_getname(font, *i));
- tt_type3_charproc(stream, font, *i);
+ tt_type3_charproc(stream, font, *i);
- stream.putline("}_d"); /* "} bind def" */
- }
- }
+ stream.putline("}_d"); /* "} bind def" */
+ }
+ }
stream.putline("end readonly def");
} /* end of ttfont_CharStrings() */
@@ -967,27 +981,27 @@
/* If we are generating a type 3 font, we need to provide */
/* a BuildGlyph and BuildChar proceedures. */
if( font->target_type == PS_TYPE_3 )
- {
- stream.put_char('\n');
+ {
+ stream.put_char('\n');
- stream.putline("/BuildGlyph");
- stream.putline(" {exch begin"); /* start font dictionary */
- stream.putline(" CharStrings exch");
- stream.putline(" 2 copy known not{pop /.notdef}if");
- stream.putline(" true 3 1 roll get exec");
- stream.putline(" end}_d");
+ stream.putline("/BuildGlyph");
+ stream.putline(" {exch begin"); /* start font dictionary */
+ stream.putline(" CharStrings exch");
+ stream.putline(" 2 copy known not{pop /.notdef}if");
+ stream.putline(" true 3 1 roll get exec");
+ stream.putline(" end}_d");
- stream.put_char('\n');
+ stream.put_char('\n');
- /* This proceedure is for compatiblity with */
- /* level 1 interpreters. */
- stream.putline("/BuildChar {");
- stream.putline(" 1 index /Encoding get exch get");
- stream.putline(" 1 index /BuildGlyph get exec");
- stream.putline("}_d");
+ /* This proceedure is for compatiblity with */
+ /* level 1 interpreters. */
+ stream.putline("/BuildChar {");
+ stream.putline(" 1 index /Encoding get exch get");
+ stream.putline(" 1 index /BuildGlyph get exec");
+ stream.putline("}_d");
- stream.put_char('\n');
- }
+ stream.put_char('\n');
+ }
/* If we are generating a type 42 font, we need to check to see */
/* if this PostScript interpreter understands type 42 fonts. If */
@@ -997,90 +1011,90 @@
/* generated by a Macintosh. That is where the TrueType interpreter */
/* setup instructions and part of BuildGlyph came from. */
else if( font->target_type == PS_TYPE_42 )
- {
- stream.put_char('\n');
+ {
+ stream.put_char('\n');
- /* If we have no "resourcestatus" command, or FontType 42 */
- /* is unknown, leave "true" on the stack. */
- stream.putline("systemdict/resourcestatus known");
- stream.putline(" {42 /FontType resourcestatus");
- stream.putline(" {pop pop false}{true}ifelse}");
- stream.putline(" {true}ifelse");
+ /* If we have no "resourcestatus" command, or FontType 42 */
+ /* is unknown, leave "true" on the stack. */
+ stream.putline("systemdict/resourcestatus known");
+ stream.putline(" {42 /FontType resourcestatus");
+ stream.putline(" {pop pop false}{true}ifelse}");
+ stream.putline(" {true}ifelse");
- /* If true, execute code to produce an error message if */
- /* we can't find Apple's TrueDict in VM. */
- stream.putline("{/TrueDict where{pop}{(%%[ Error: no TrueType rasterizer ]%%)= flush}ifelse");
+ /* If true, execute code to produce an error message if */
+ /* we can't find Apple's TrueDict in VM. */
+ stream.putline("{/TrueDict where{pop}{(%%[ Error: no TrueType rasterizer ]%%)= flush}ifelse");
- /* Since we are expected to use Apple's TrueDict TrueType */
- /* reasterizer, change the font type to 3. */
- stream.putline("/FontType 3 def");
+ /* Since we are expected to use Apple's TrueDict TrueType */
+ /* reasterizer, change the font type to 3. */
+ stream.putline("/FontType 3 def");
- /* Define a string to hold the state of the Apple */
- /* TrueType interpreter. */
- stream.putline(" /TrueState 271 string def");
+ /* Define a string to hold the state of the Apple */
+ /* TrueType interpreter. */
+ stream.putline(" /TrueState 271 string def");
- /* It looks like we get information about the resolution */
- /* of the printer and store it in the TrueState string. */
- stream.putline(" TrueDict begin sfnts save");
- stream.putline(" 72 0 matrix defaultmatrix dtransform dup");
- stream.putline(" mul exch dup mul add sqrt cvi 0 72 matrix");
- stream.putline(" defaultmatrix dtransform dup mul exch dup");
- stream.putline(" mul add sqrt cvi 3 -1 roll restore");
- stream.putline(" TrueState initer end");
+ /* It looks like we get information about the resolution */
+ /* of the printer and store it in the TrueState string. */
+ stream.putline(" TrueDict begin sfnts save");
+ stream.putline(" 72 0 matrix defaultmatrix dtransform dup");
+ stream.putline(" mul exch dup mul add sqrt cvi 0 72 matrix");
+ stream.putline(" defaultmatrix dtransform dup mul exch dup");
+ stream.putline(" mul add sqrt cvi 3 -1 roll restore");
+ stream.putline(" TrueState initer end");
- /* This BuildGlyph procedure will look the name up in the */
- /* CharStrings array, and then check to see if what it gets */
- /* is a procedure. If it is, it executes it, otherwise, it */
- /* lets the TrueType rasterizer loose on it. */
+ /* This BuildGlyph procedure will look the name up in the */
+ /* CharStrings array, and then check to see if what it gets */
+ /* is a procedure. If it is, it executes it, otherwise, it */
+ /* lets the TrueType rasterizer loose on it. */
- /* When this proceedure is executed the stack contains */
- /* the font dictionary and the character name. We */
- /* exchange arguments and move the dictionary to the */
- /* dictionary stack. */
- stream.putline(" /BuildGlyph{exch begin");
- /* stack: charname */
+ /* When this proceedure is executed the stack contains */
+ /* the font dictionary and the character name. We */
+ /* exchange arguments and move the dictionary to the */
+ /* dictionary stack. */
+ stream.putline(" /BuildGlyph{exch begin");
+ /* stack: charname */
- /* Put two copies of CharStrings on the stack and consume */
- /* one testing to see if the charname is defined in it, */
- /* leave the answer on the stack. */
- stream.putline(" CharStrings dup 2 index known");
- /* stack: charname CharStrings bool */
+ /* Put two copies of CharStrings on the stack and consume */
+ /* one testing to see if the charname is defined in it, */
+ /* leave the answer on the stack. */
+ stream.putline(" CharStrings dup 2 index known");
+ /* stack: charname CharStrings bool */
- /* Exchange the CharStrings dictionary and the charname, */
- /* but if the answer was false, replace the character name */
- /* with ".notdef". */
- stream.putline(" {exch}{exch pop /.notdef}ifelse");
- /* stack: CharStrings charname */
+ /* Exchange the CharStrings dictionary and the charname, */
+ /* but if the answer was false, replace the character name */
+ /* with ".notdef". */
+ stream.putline(" {exch}{exch pop /.notdef}ifelse");
+ /* stack: CharStrings charname */
- /* Get the value from the CharStrings dictionary and see */
- /* if it is executable. */
- stream.putline(" get dup xcheck");
- /* stack: CharStrings_entry */
+ /* Get the value from the CharStrings dictionary and see */
+ /* if it is executable. */
+ stream.putline(" get dup xcheck");
+ /* stack: CharStrings_entry */
- /* If is a proceedure. Execute according to RBIIp 277-278. */
- stream.putline(" {currentdict systemdict begin begin exec end end}");
+ /* If is a proceedure. Execute according to RBIIp 277-278. */
+ stream.putline(" {currentdict systemdict begin begin exec end end}");
- /* Is a TrueType character index, let the rasterizer at it. */
- stream.putline(" {TrueDict begin /bander load cvlit exch TrueState render end}");
+ /* Is a TrueType character index, let the rasterizer at it. */
+ stream.putline(" {TrueDict begin /bander load cvlit exch TrueState render end}");
- stream.putline(" ifelse");
+ stream.putline(" ifelse");
- /* Pop the font's dictionary off the stack. */
- stream.putline(" end}bind def");
+ /* Pop the font's dictionary off the stack. */
+ stream.putline(" end}bind def");
- /* This is the level 1 compatibility BuildChar procedure. */
- /* See RBIIp 281. */
- stream.putline(" /BuildChar{");
- stream.putline(" 1 index /Encoding get exch get");
- stream.putline(" 1 index /BuildGlyph get exec");
- stream.putline(" }bind def");
+ /* This is the level 1 compatibility BuildChar procedure. */
+ /* See RBIIp 281. */
+ stream.putline(" /BuildChar{");
+ stream.putline(" 1 index /Encoding get exch get");
+ stream.putline(" 1 index /BuildGlyph get exec");
+ stream.putline(" }bind def");
- /* Here we close the condition which is true */
- /* if the printer has no built-in TrueType */
- /* rasterizer. */
- stream.putline("}if");
- stream.put_char('\n');
- } /* end of if Type 42 not understood. */
+ /* Here we close the condition which is true */
+ /* if the printer has no built-in TrueType */
+ /* rasterizer. */
+ stream.putline("}if");
+ stream.put_char('\n');
+ } /* end of if Type 42 not understood. */
stream.putline("FontName currentdict end definefont pop");
/* stream.putline("%%EOF"); */
@@ -1102,7 +1116,7 @@
/* Open the font file */
if( (font.file = fopen(filename,"rb")) == (FILE*)NULL )
- throw TTException("Failed to open TrueType font");
+ throw TTException("Failed to open TrueType font");
/* Allocate space for the unvarying part of the offset table. */
assert(font.offset_table == NULL);
@@ -1110,7 +1124,7 @@
/* Read the first part of the offset table. */
if( fread( font.offset_table, sizeof(BYTE), 12, font.file ) != 12 )
- throw TTException("TrueType font may be corrupt (reason 1)");
+ throw TTException("TrueType font may be corrupt (reason 1)");
/* Determine how many directory entries there are. */
font.numTables = getUSHORT( font.offset_table + 4 );
@@ -1123,7 +1137,7 @@
/* Read the rest of the table directory. */
if( fread( font.offset_table + 12, sizeof(BYTE), (font.numTables*16), font.file ) != (font.numTables*16) )
- throw TTException("TrueType font may be corrupt (reason 2)");
+ throw TTException("TrueType font may be corrupt (reason 2)");
/* Extract information from the "Offset" table. */
font.TTVersion = getFixed( font.offset_table );
@@ -1131,21 +1145,21 @@
/* Load the "head" table and extract information from it. */
ptr = GetTable(&font, "head");
try {
- font.MfrRevision = getFixed( ptr + 4 ); /* font revision number */
+ font.MfrRevision = getFixed( ptr + 4 ); /* font revision number */
font.unitsPerEm = getUSHORT( ptr + 18 );
font.HUPM = font.unitsPerEm / 2;
#ifdef DEBUG_TRUETYPE
debug("unitsPerEm=%d",(int)font.unitsPerEm);
#endif
- font.llx = topost2( getFWord( ptr + 36 ) ); /* bounding box info */
+ font.llx = topost2( getFWord( ptr + 36 ) ); /* bounding box info */
font.lly = topost2( getFWord( ptr + 38 ) );
font.urx = topost2( getFWord( ptr + 40 ) );
font.ury = topost2( getFWord( ptr + 42 ) );
- font.indexToLocFormat = getSHORT( ptr + 50 ); /* size of 'loca' data */
+ font.indexToLocFormat = getSHORT( ptr + 50 ); /* size of 'loca' data */
if(font.indexToLocFormat != 0 && font.indexToLocFormat != 1)
- throw TTException("TrueType font is unusable because indexToLocFormat != 0");
+ throw TTException("TrueType font is unusable because indexToLocFormat != 0");
if( getSHORT(ptr+52) != 0 )
- throw TTException("TrueType font is unusable because glyphDataFormat != 0");
+ throw TTException("TrueType font is unusable because glyphDataFormat != 0");
} catch (TTException& ) {
free(ptr);
throw;
@@ -1164,34 +1178,34 @@
/* have the 'loca' and 'glyf' tables arround while */
/* we are generating the CharStrings. */
if(font.target_type == PS_TYPE_3 || font.target_type == PDF_TYPE_3)
- {
- BYTE *ptr; /* We need only one value */
- ptr = GetTable(&font, "hhea");
- font.numberOfHMetrics = getUSHORT(ptr + 34);
- free(ptr);
+ {
+ BYTE *ptr; /* We need only one value */
+ ptr = GetTable(&font, "hhea");
+ font.numberOfHMetrics = getUSHORT(ptr + 34);
+ free(ptr);
- assert(font.loca_table == NULL);
- font.loca_table = GetTable(&font,"loca");
- assert(font.glyf_table == NULL);
- font.glyf_table = GetTable(&font,"glyf");
- assert(font.hmtx_table == NULL);
- font.hmtx_table = GetTable(&font,"hmtx");
+ assert(font.loca_table == NULL);
+ font.loca_table = GetTable(&font,"loca");
+ assert(font.glyf_table == NULL);
+ font.glyf_table = GetTable(&font,"glyf");
+ assert(font.hmtx_table == NULL);
+ font.hmtx_table = GetTable(&font,"hmtx");
}
if (glyph_ids.size() == 0) {
- glyph_ids.clear();
- glyph_ids.reserve(font.numGlyphs);
- for (int x = 0; x < font.numGlyphs; ++x) {
- glyph_ids.push_back(x);
- }
+ glyph_ids.clear();
+ glyph_ids.reserve(font.numGlyphs);
+ for (int x = 0; x < font.numGlyphs; ++x) {
+ glyph_ids.push_back(x);
+ }
} else if (font.target_type == PS_TYPE_3) {
- ttfont_add_glyph_dependencies(&font, glyph_ids);
+ ttfont_add_glyph_dependencies(&font, glyph_ids);
}
} /* end of insert_ttfont() */
void insert_ttfont(const char *filename, TTStreamWriter& stream,
- font_type_enum target_type, std::vector<int>& glyph_ids)
+ font_type_enum target_type, std::vector<int>& glyph_ids)
{
struct TTFONT font;
@@ -1201,7 +1215,7 @@
ttfont_header(stream, &font);
/* Define the encoding. */
- ttfont_encoding(stream);
+ ttfont_encoding(stream, &font, glyph_ids, target_type);
/* Insert FontInfo dictionary. */
ttfont_FontInfo(stream, &font);
@@ -1224,10 +1238,10 @@
public:
void write(const char* a) {
- oss << a;
+ oss << a;
}
std::string str() {
- return oss.str();
+ return oss.str();
}
};
@@ -1237,11 +1251,11 @@
read_font(filename, PDF_TYPE_3, glyph_ids, font);
for (std::vector<int>::const_iterator i = glyph_ids.begin();
- i != glyph_ids.end(); ++i) {
- StringStreamWriter writer;
- tt_type3_charproc(writer, &font, *i);
- const char* name = ttfont_CharStrings_getname(&font, *i);
- dict.add_pair(name, writer.str().c_str());
+ i != glyph_ids.end(); ++i) {
+ StringStreamWriter writer;
+ tt_type3_charproc(writer, &font, *i);
+ const char* name = ttfont_CharStrings_getname(&font, *i);
+ dict.add_pair(name, writer.str().c_str());
}
}
@@ -1263,7 +1277,7 @@
TTFONT::~TTFONT() {
if (file)
- fclose(file);
+ fclose(file);
free(PostName);
free(FullName);
free(FamilyName);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2010-02-08 17:51:02
|
Revision: 8121
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8121&view=rev
Author: jdh2358
Date: 2010-02-08 17:50:27 +0000 (Mon, 08 Feb 2010)
Log Message:
-----------
added Ariels csd patch for proper scaling at the dc component
Modified Paths:
--------------
branches/v0_99_maint/doc/faq/installing_faq.rst
branches/v0_99_maint/doc/glossary/index.rst
branches/v0_99_maint/doc/users/installing.rst
branches/v0_99_maint/lib/matplotlib/mlab.py
Modified: branches/v0_99_maint/doc/faq/installing_faq.rst
===================================================================
--- branches/v0_99_maint/doc/faq/installing_faq.rst 2010-02-08 17:11:38 UTC (rev 8120)
+++ branches/v0_99_maint/doc/faq/installing_faq.rst 2010-02-08 17:50:27 UTC (rev 8121)
@@ -146,11 +146,11 @@
others in web application servers to dynamically serve up graphs.
To support all of these use cases, matplotlib can target different
-outputs, and each of these capabililities is called a backend (the
+outputs, and each of these capabililities is called a backend; the
"frontend" is the user facing code, ie the plotting code, whereas the
"backend" does all the dirty work behind the scenes to make the
figure. There are two types of backends: user interface backends (for
-use in pygtk, wxpython, tkinter, qt or fltk) and hardcopy backends to
+use in pygtk, wxpython, tkinter, qt, macosx, or fltk) and hardcopy backends to
make image files (PNG, SVG, PDF, PS).
There are a two primary ways to configure your backend. One is to set
@@ -183,10 +183,10 @@
renderer for user interfaces is ``Agg`` which uses the `antigrain
<http://antigrain.html>`_ C++ library to make a raster (pixel) image
of the figure. All of the user interfaces can be used with agg
-rendering, eg ``WXAgg``, ``GTKAgg``, ``QTAgg``, ``TkAgg``. In
-addition, some of the user interfaces support other rendering engines.
-For example, with GTK, you can also select GDK rendering (backend
-``GTK``) or Cairo rendering (backend ``GTKCairo``).
+rendering, eg ``WXAgg``, ``GTKAgg``, ``QTAgg``, ``TkAgg``,
+``CocoaAgg``. In addition, some of the user interfaces support other
+rendering engines. For example, with GTK, you can also select GDK
+rendering (backend ``GTK``) or Cairo rendering (backend ``GTKCairo``).
For the rendering engines, one can also distinguish between `vector
<http://en.wikipedia.org/wiki/Vector_graphics>`_ or `raster
@@ -238,6 +238,7 @@
QtAgg Agg rendering to a :term:`Qt` canvas (requires PyQt_)
Qt4Agg Agg rendering to a :term:`Qt4` canvas (requires PyQt4_)
FLTKAgg Agg rendering to a :term:`FLTK` canvas (requires pyFLTK_)
+macosx Cocoa rendering in OSX windows
============ ================================================================
.. _`Anti-Grain Geometry`: http://www.antigrain.com/
Modified: branches/v0_99_maint/doc/glossary/index.rst
===================================================================
--- branches/v0_99_maint/doc/glossary/index.rst 2010-02-08 17:11:38 UTC (rev 8120)
+++ branches/v0_99_maint/doc/glossary/index.rst 2010-02-08 17:50:27 UTC (rev 8121)
@@ -14,6 +14,11 @@
Cairo
The `Cairo graphics <http://cairographics.org>`_ engine
+
+ dateutil
+ The `dateutil <http://labix.org/python-dateutil>`_ library
+ provides extensions to the standard datetime module
+
EPS
Encapsulated Postscript (`EPS <http://en.wikipedia.org/wiki/Encapsulated_PostScript>`_)
@@ -86,6 +91,14 @@
language widely used for scripting, application development, web
application servers, scientific computing and more.
+
+ pytz
+ `pytz <http://pytz.sourceforge.net/>`_ provides the Olson tz
+ database in Python. it allows accurate and cross platform
+ timezone calculations and solves the issue of ambiguous times at
+ the end of daylight savings
+
+
Qt
`Qt <http://trolltech.com/products/qt/>`__ is a cross-platform
application framework for desktop and embedded development.
Modified: branches/v0_99_maint/doc/users/installing.rst
===================================================================
--- branches/v0_99_maint/doc/users/installing.rst 2010-02-08 17:11:38 UTC (rev 8120)
+++ branches/v0_99_maint/doc/users/installing.rst 2010-02-08 17:50:27 UTC (rev 8121)
@@ -44,11 +44,30 @@
matplotlib requires numpy version 1.1 or later. Although it is not a
requirement to use matplotlib, we strongly encourage you to install
`ipython <http://ipython.scipy.org/dist>`_, which is an interactive
-shell for python that is matplotlib aware. Once you have ipython,
-numpy and matplotlib installed, in ipython's "pylab" mode you have a
-matlab-like environment that automatically handles most of the
-configuration details for you, so you can get up and running quickly::
+shell for python that is matplotlib aware.
+Next we need to get matplotlib installed. We provide prebuilt
+binaries for OS X and Windows on the matplotlib `download
+<http://sourceforge.net/projects/matplotlib/files/>`_ page. Click on
+the latest release of the "matplotlib" package, choose your python
+version (2.5 or 2.6) and your platform (macosx or win32) and you
+should be good to go. If you have any problems, please check the
+:ref:`installing-faq`, google around a little bit, and post a question
+the `mailing list
+<http://sourceforge.net/project/showfiles.php?group_id=80706>`_. If
+you are on debian/unbuntu linux, it suffices to do::
+
+ > sudo apt-get install python-matplotlib
+
+Instructions for installing our OSX binaries are found in the FAQ
+:ref:`install_osx_binaries`.
+
+
+Once you have ipython, numpy and matplotlib installed, in ipython's
+"pylab" mode you have a matlab-like environment that automatically
+handles most of the configuration details for you, so you can get up
+and running quickly::
+
johnh@flag:~> ipython -pylab
Python 2.4.5 (#4, Apr 12 2008, 09:09:16)
IPython 0.9.0 -- An enhanced Interactive Python.
@@ -60,20 +79,6 @@
In [2]: hist(x, 100)
-And a *voila*, a figure pops up. But we are putting the cart ahead of
-the horse -- first we need to get matplotlib installed. We provide
-prebuilt binaries for OS X and Windows on the matplotlib `download
-<http://sourceforge.net/projects/matplotlib/files/>`_ page. Click on
-the latest release of the "matplotlib" package, choose your python
-version (2.4 or 2.5) and your platform (macosx or win32) and you
-should be good to go. If you have any problems, please check the
-:ref:`installing-faq`, google around a little bit, and post a question
-the `mailing list
-<http://sourceforge.net/project/showfiles.php?group_id=80706>`_.
-
-Instructions for installing our OSX binaries are found in the FAQ
-ref:`install_osx_binaries`.
-
Note that when testing matplotlib installations from the interactive
python console, there are some issues relating to user interface
toolkits and interactive settings that are discussed in
@@ -85,9 +90,9 @@
======================
If you are interested perhaps in contributing to matplotlib
-development, or just like to build everything yourself, it is not
-difficult to build matplotlib from source. Grab the latest *tar.gz*
-release file from `sourceforge
+development, running the latest greatest code, or just like to
+build everything yourself, it is not difficult to build matplotlib
+from source. Grab the latest *tar.gz* release file from `sourceforge
<http://sourceforge.net/project/showfiles.php?group_id=80706>`_, or if
you want to develop matplotlib or just need the latest bugfixed
version, grab the latest svn version :ref:`install-svn`.
@@ -173,17 +178,17 @@
agg template source statically, so it will not affect anything on
your system outside of matplotlib.
-pytz 2007g or later
+:term:`pytz` 2007g or later
timezone handling for python datetime objects. By default,
matplotlib will install pytz if it isn't already installed on your
- system. To override the default, use setup.cfg to force or
+ system. To override the default, use :file:`setup.cfg to force or
prevent installation of pytz.
-dateutil 1.1 or later
- extensions to python datetime handling. By
- default, matplotlib will install dateutil if it isn't already
- installed on your system. To override the default, use setup.cfg
- to force or prevent installation of dateutil.
+:term:`dateutil` 1.1 or later
+ provides extensions to python datetime handling. By default, matplotlib
+ will install dateutil if it isn't already installed on your
+ system. To override the default, use :file:`setup.cfg` to force
+ or prevent installation of dateutil.
Modified: branches/v0_99_maint/lib/matplotlib/mlab.py
===================================================================
--- branches/v0_99_maint/lib/matplotlib/mlab.py 2010-02-08 17:11:38 UTC (rev 8120)
+++ branches/v0_99_maint/lib/matplotlib/mlab.py 2010-02-08 17:50:27 UTC (rev 8121)
@@ -273,10 +273,18 @@
Pxy[:,i] = np.conjugate(fx[:numFreqs]) * fy[:numFreqs]
# Scale the spectrum by the norm of the window to compensate for
- # windowing loss; see Bendat & Piersol Sec 11.5.2. Also include
- # scaling factors for one-sided densities and dividing by the sampling
- # frequency, if desired.
- Pxy *= scaling_factor / (np.abs(windowVals)**2).sum()
+ # windowing loss; see Bendat & Piersol Sec 11.5.2.
+ Pxy *= 1 / (np.abs(windowVals)**2).sum()
+
+ # Also include scaling factors for one-sided densities and dividing by the
+ # sampling frequency, if desired. Scale everything, except the DC component
+ # and the NFFT/2 component:
+ Pxy[1:-1] *= scaling_factor
+
+ #But do scale those components by Fs, if required
+ if scale_by_freq:
+ Pxy[[0,-1]] /= Fs
+
t = 1./Fs * (ind + NFFT / 2.)
freqs = float(Fs) / pad_to * np.arange(numFreqs)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2010-02-08 17:11:44
|
Revision: 8120
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8120&view=rev
Author: leejjoon
Date: 2010-02-08 17:11:38 +0000 (Mon, 08 Feb 2010)
Log Message:
-----------
update examples/api/demo_affine_image.py
Modified Paths:
--------------
trunk/matplotlib/examples/api/demo_affine_image.py
Modified: trunk/matplotlib/examples/api/demo_affine_image.py
===================================================================
--- trunk/matplotlib/examples/api/demo_affine_image.py 2010-02-08 16:54:31 UTC (rev 8119)
+++ trunk/matplotlib/examples/api/demo_affine_image.py 2010-02-08 17:11:38 UTC (rev 8120)
@@ -30,24 +30,37 @@
if 1:
- ax = plt.subplot(111)
+
+ # image rotation
+
+ ax1 = plt.subplot(121)
Z = get_image()
- im = imshow_affine(ax, Z, interpolation='nearest', cmap=cm.jet,
- origin='lower',
- extent=[-2, 4, -3, 2], clip_on=True)
+ im1 = imshow_affine(ax1, Z, interpolation='nearest', cmap=cm.jet,
+ origin='lower',
+ extent=[-2, 4, -3, 2], clip_on=True)
- trans_data2 = mtransforms.Affine2D().rotate_deg(30) + ax.transData
- im.set_transform(trans_data2)
+ trans_data2 = mtransforms.Affine2D().rotate_deg(30) + ax1.transData
+ im1.set_transform(trans_data2)
# display intended extent of the image
- x1, x2, y1, y2 = im.get_extent()
+ x1, x2, y1, y2 = im1.get_extent()
x3, y3 = x2, y1
- ax.plot([x1, x2, x2, x1, x1], [y1, y1, y2, y2, y1], "r--", lw=3,
- transform=trans_data2)
+ ax1.plot([x1, x2, x2, x1, x1], [y1, y1, y2, y2, y1], "r--", lw=3,
+ transform=trans_data2)
- ax.set_xlim(-3, 5)
- ax.set_ylim(-4, 4)
+ ax1.set_xlim(-3, 5)
+ ax1.set_ylim(-4, 4)
+
+ # image skew
+
+ ax2 = plt.subplot(122)
+ im2 = ax2.imshow(Z, interpolation='nearest', cmap=cm.jet,
+ origin='lower',
+ extent=[-2, 4, -3, 2], clip_on=True)
+ im2._image_skew_coordinate = (3, -2)
+
+
plt.show()
#plt.savefig("demo_affine_image")
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2010-02-08 16:54:37
|
Revision: 8119
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8119&view=rev
Author: leejjoon
Date: 2010-02-08 16:54:31 +0000 (Mon, 08 Feb 2010)
Log Message:
-----------
issue a warning when _image_skew_coordinate is set for backends that do not support an affine transform of images
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/image.py
Modified: trunk/matplotlib/lib/matplotlib/image.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/image.py 2010-02-08 16:54:26 UTC (rev 8118)
+++ trunk/matplotlib/lib/matplotlib/image.py 2010-02-08 16:54:31 UTC (rev 8119)
@@ -305,6 +305,9 @@
if self._check_unsampled_image(renderer):
self._draw_unsampled_image(renderer, gc)
else:
+ if self._image_skew_coordinate is not None:
+ warnings.warn("Image will not be shown correctly with this backend.")
+
im = self.make_image(renderer.get_image_magnification())
if im is None:
return
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2010-02-08 16:54:32
|
Revision: 8118
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8118&view=rev
Author: leejjoon
Date: 2010-02-08 16:54:26 +0000 (Mon, 08 Feb 2010)
Log Message:
-----------
RendererAgg.draw_image supports affine transform
Modified Paths:
--------------
trunk/matplotlib/examples/api/demo_affine_image.py
trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
trunk/matplotlib/src/_backend_agg.cpp
Modified: trunk/matplotlib/examples/api/demo_affine_image.py
===================================================================
--- trunk/matplotlib/examples/api/demo_affine_image.py 2010-02-08 16:00:23 UTC (rev 8117)
+++ trunk/matplotlib/examples/api/demo_affine_image.py 2010-02-08 16:54:26 UTC (rev 8118)
@@ -3,7 +3,7 @@
"""
For the backends that supports draw_image with optional affine
-transform (e.g., ps backend), the image of the output should
+transform (e.g., agg, ps backend), the image of the output should
have its boundary matches the red rectangles.
"""
@@ -33,7 +33,8 @@
ax = plt.subplot(111)
Z = get_image()
im = imshow_affine(ax, Z, interpolation='nearest', cmap=cm.jet,
- origin='lower', extent=[-2, 4, -3, 2])
+ origin='lower',
+ extent=[-2, 4, -3, 2], clip_on=True)
trans_data2 = mtransforms.Affine2D().rotate_deg(30) + ax.transData
im.set_transform(trans_data2)
@@ -48,4 +49,5 @@
ax.set_xlim(-3, 5)
ax.set_ylim(-4, 4)
- plt.savefig("demo_affine_image")
+ plt.show()
+ #plt.savefig("demo_affine_image")
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2010-02-08 16:00:23 UTC (rev 8117)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2010-02-08 16:54:26 UTC (rev 8118)
@@ -261,6 +261,12 @@
# with the Agg backend
return True
+ def option_scale_image(self):
+ """
+ agg backend support arbitrary scaling of image.
+ """
+ return True
+
def restore_region(self, region, bbox=None, xy=None):
"""
restore the saved region. if bbox (instance of BboxBase, or
Modified: trunk/matplotlib/src/_backend_agg.cpp
===================================================================
--- trunk/matplotlib/src/_backend_agg.cpp 2010-02-08 16:00:23 UTC (rev 8117)
+++ trunk/matplotlib/src/_backend_agg.cpp 2010-02-08 16:54:26 UTC (rev 8118)
@@ -814,55 +814,99 @@
RendererAgg::draw_image(const Py::Tuple& args) {
_VERBOSE("RendererAgg::draw_image");
- args.verify_length(4);
+ args.verify_length(4, 7); // 7 if affine matrix if given
GCAgg gc(args[0], dpi);
- double x = mpl_round(Py::Float(args[1]));
- double y = mpl_round(Py::Float(args[2]));
Image *image = static_cast<Image*>(args[3].ptr());
bool has_clippath = false;
+ agg::trans_affine affine_trans;
+ bool has_affine = false;
+ double x, y, w, h;
+
+ if (args.size() == 7) {
+ has_affine = true;
+ x = Py::Float(args[1]);
+ y = Py::Float(args[2]);
+ w = Py::Float(args[4]);
+ h = Py::Float(args[5]);
+ affine_trans = py_to_agg_transformation_matrix(args[6].ptr());
+ } else {
+ x = mpl_round(Py::Float(args[1]));
+ y = mpl_round(Py::Float(args[2]));
+ }
+
+
theRasterizer.reset_clipping();
rendererBase.reset_clipping(true);
+ set_clipbox(gc.cliprect, theRasterizer);
has_clippath = render_clippath(gc.clippath, gc.clippath_trans);
Py::Tuple empty;
image->flipud_out(empty);
pixfmt pixf(*(image->rbufOut));
- if (has_clippath) {
+ if (has_affine | has_clippath) {
agg::trans_affine mtx;
- mtx *= agg::trans_affine_translation((int)x, (int)(height-(y+image->rowsOut)));
+ agg::path_storage rect;
- agg::path_storage rect;
+ if (has_affine) {
+ mtx *= agg::trans_affine_scaling(1, -1);
+ mtx *= agg::trans_affine_translation(0, image->rowsOut);
+ mtx *= agg::trans_affine_scaling(w/(image->colsOut), h/(image->rowsOut));
+ mtx *= agg::trans_affine_translation(x, y);
+ mtx *= affine_trans;
+ mtx *= agg::trans_affine_scaling(1.0, -1.0);
+ mtx *= agg::trans_affine_translation(0.0, (double) height);
+ } else {
+ mtx *= agg::trans_affine_translation((int)x, (int)(height-(y+image->rowsOut)));
+ }
+
rect.move_to(0, 0);
rect.line_to(image->colsOut, 0);
rect.line_to(image->colsOut, image->rowsOut);
rect.line_to(0, image->rowsOut);
rect.line_to(0, 0);
+
agg::conv_transform<agg::path_storage> rect2(rect, mtx);
agg::trans_affine inv_mtx(mtx);
inv_mtx.invert();
+
typedef agg::span_allocator<agg::rgba8> color_span_alloc_type;
- typedef agg::pixfmt_amask_adaptor<pixfmt, alpha_mask_type> pixfmt_amask_type;
- typedef agg::renderer_base<pixfmt_amask_type> amask_ren_type;
typedef agg::image_accessor_clip<agg::pixfmt_rgba32> image_accessor_type;
typedef agg::span_interpolator_linear<> interpolator_type;
typedef agg::span_image_filter_rgba_nn<image_accessor_type, interpolator_type> image_span_gen_type;
- typedef agg::renderer_scanline_aa<amask_ren_type, color_span_alloc_type, image_span_gen_type> renderer_type;
+
color_span_alloc_type sa;
image_accessor_type ia(pixf, agg::rgba8(0, 0, 0, 0));
interpolator_type interpolator(inv_mtx);
image_span_gen_type image_span_generator(ia, interpolator);
- pixfmt_amask_type pfa(pixFmt, alphaMask);
- amask_ren_type r(pfa);
- renderer_type ri(r, sa, image_span_generator);
- theRasterizer.add_path(rect2);
- agg::render_scanlines(theRasterizer, slineP8, ri);
+
+ if (has_clippath) {
+ typedef agg::pixfmt_amask_adaptor<pixfmt, alpha_mask_type> pixfmt_amask_type;
+ typedef agg::renderer_base<pixfmt_amask_type> amask_ren_type;
+ typedef agg::renderer_scanline_aa<amask_ren_type, color_span_alloc_type, image_span_gen_type> renderer_type_alpha;
+
+ pixfmt_amask_type pfa(pixFmt, alphaMask);
+ amask_ren_type r(pfa);
+ renderer_type_alpha ri(r, sa, image_span_generator);
+
+ theRasterizer.add_path(rect2);
+ agg::render_scanlines(theRasterizer, slineP8, ri);
+ } else {
+ typedef agg::renderer_base<pixfmt> ren_type;
+ typedef agg::renderer_scanline_aa<ren_type, color_span_alloc_type, image_span_gen_type> renderer_type;
+ ren_type r(pixFmt);
+ renderer_type ri(r, sa, image_span_generator);
+
+ theRasterizer.add_path(rect2);
+ agg::render_scanlines(theRasterizer, slineP8, ri);
+ }
+
} else {
set_clipbox(gc.cliprect, rendererBase);
rendererBase.blend_from(pixf, 0, (int)x, (int)(height-(y+image->rowsOut)));
@@ -873,6 +917,9 @@
return Py::Object();
}
+
+
+
template<class path_t>
void RendererAgg::_draw_path(path_t& path, bool has_clippath,
const facepair_t& face, const GCAgg& gc) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2010-02-08 16:00:31
|
Revision: 8117
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8117&view=rev
Author: mdboom
Date: 2010-02-08 16:00:23 +0000 (Mon, 08 Feb 2010)
Log Message:
-----------
Merged revisions 8092,8116 via svnmerge from
https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_99_maint
........
r8092 | leejjoon | 2010-01-18 19:26:16 -0500 (Mon, 18 Jan 2010) | 1 line
update annotate documentation to explain *annotation_clip* parameter
........
r8116 | mdboom | 2010-02-08 10:57:45 -0500 (Mon, 08 Feb 2010) | 1 line
Fix for libpng-1.4 compatibility
........
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/text.py
trunk/matplotlib/src/_png.cpp
Property Changed:
----------------
trunk/matplotlib/
trunk/matplotlib/doc/pyplots/README
trunk/matplotlib/doc/sphinxext/gen_gallery.py
trunk/matplotlib/doc/sphinxext/gen_rst.py
trunk/matplotlib/examples/misc/multiprocess.py
trunk/matplotlib/examples/mplot3d/contour3d_demo.py
trunk/matplotlib/examples/mplot3d/contourf3d_demo.py
trunk/matplotlib/examples/mplot3d/polys3d_demo.py
trunk/matplotlib/examples/mplot3d/scatter3d_demo.py
trunk/matplotlib/examples/mplot3d/surface3d_demo.py
trunk/matplotlib/examples/mplot3d/wire3d_demo.py
trunk/matplotlib/lib/matplotlib/sphinxext/mathmpl.py
trunk/matplotlib/lib/matplotlib/sphinxext/only_directives.py
trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py
trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_spines/spines_axes_positions.png
Property changes on: trunk/matplotlib
___________________________________________________________________
Modified: svnmerge-integrated
- /branches/mathtex:1-7263 /branches/v0_99_maint:1-8070
+ /branches/mathtex:1-7263 /branches/v0_99_maint:1-8116
Modified: svn:mergeinfo
- /branches/v0_91_maint:5753-5771
/branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070
+ /branches/v0_91_maint:5753-5771
/branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116
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,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/doc/pyplots/README:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070
+ /branches/v0_98_5_maint/doc/pyplots/README:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/doc/pyplots/README:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116
Property changes on: trunk/matplotlib/doc/sphinxext/gen_gallery.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/_templates/gen_gallery.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py:6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/doc/sphinxext/gen_gallery.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070
+ /branches/v0_91_maint/doc/_templates/gen_gallery.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py:6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/doc/sphinxext/gen_gallery.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116
Property changes on: trunk/matplotlib/doc/sphinxext/gen_rst.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/examples/gen_rst.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_rst.py:6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/doc/sphinxext/gen_rst.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070
+ /branches/v0_91_maint/doc/examples/gen_rst.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_rst.py:6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/doc/sphinxext/gen_rst.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116
Property changes on: trunk/matplotlib/examples/misc/multiprocess.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/misc/log.py:5753-5771
/branches/v0_98_5_maint/examples/misc/log.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/misc/multiprocess.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070
+ /branches/v0_91_maint/examples/misc/log.py:5753-5771
/branches/v0_98_5_maint/examples/misc/log.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/misc/multiprocess.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116
Property changes on: trunk/matplotlib/examples/mplot3d/contour3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/contour.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/contour.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/contour3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070
+ /branches/v0_91_maint/examples/mplot3d/contour.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/contour.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/contour3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116
Property changes on: trunk/matplotlib/examples/mplot3d/contourf3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/contourf.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/contourf.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/contourf3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070
+ /branches/v0_91_maint/examples/mplot3d/contourf.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/contourf.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/contourf3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116
Property changes on: trunk/matplotlib/examples/mplot3d/polys3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/polys.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/polys.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/polys3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070
+ /branches/v0_91_maint/examples/mplot3d/polys.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/polys.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/polys3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116
Property changes on: trunk/matplotlib/examples/mplot3d/scatter3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/scatter.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/scatter.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/scatter3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070
+ /branches/v0_91_maint/examples/mplot3d/scatter.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/scatter.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/scatter3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116
Property changes on: trunk/matplotlib/examples/mplot3d/surface3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/surface.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/surface.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/surface3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070
+ /branches/v0_91_maint/examples/mplot3d/surface.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/surface.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/surface3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116
Property changes on: trunk/matplotlib/examples/mplot3d/wire3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/wire.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/wire.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/wire3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070
+ /branches/v0_91_maint/examples/mplot3d/wire.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/wire.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/wire3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116
Property changes on: trunk/matplotlib/lib/matplotlib/sphinxext/mathmpl.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/sphinxext/mathmpl.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/mathmpl.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/lib/matplotlib/sphinxext/mathmpl.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070
+ /branches/v0_91_maint/doc/sphinxext/mathmpl.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/mathmpl.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/lib/matplotlib/sphinxext/mathmpl.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116
Property changes on: trunk/matplotlib/lib/matplotlib/sphinxext/only_directives.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/sphinxext/only_directives.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/only_directives.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/lib/matplotlib/sphinxext/only_directives.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070
+ /branches/v0_91_maint/doc/sphinxext/only_directives.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/only_directives.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/lib/matplotlib/sphinxext/only_directives.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116
Property changes on: trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/sphinxext/plot_directive.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/plot_directive.py:6920-6925,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/lib/matplotlib/sphinxext/plot_directive.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070
+ /branches/v0_91_maint/doc/sphinxext/plot_directive.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/plot_directive.py:6920-6925,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/lib/matplotlib/sphinxext/plot_directive.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116
Property changes on: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_spines/spines_axes_positions.png
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_99_maint/lib/matplotlib/tests/baseline_images/test_spines/spines_axes_positions.png:7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070
+ /branches/v0_99_maint/lib/matplotlib/tests/baseline_images/test_spines/spines_axes_positions.png:7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116
Modified: trunk/matplotlib/lib/matplotlib/text.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/text.py 2010-02-08 15:57:45 UTC (rev 8116)
+++ trunk/matplotlib/lib/matplotlib/text.py 2010-02-08 16:00:23 UTC (rev 8117)
@@ -1668,6 +1668,14 @@
# 5 points below the top border
xy=(10,-5), xycoords='axes points'
+
+ The *annotation_clip* attribute contols the visibility of the
+ annotation when it goes outside the axes area. If True, the
+ annotation will only be drawn when the *xy* is inside the
+ axes. If False, the annotation will always be drawn regardless
+ of its position. The default is *None*, which behave as True
+ only if *xycoords* is"data".
+
Additional kwargs are Text properties:
%(Text)s
Modified: trunk/matplotlib/src/_png.cpp
===================================================================
--- trunk/matplotlib/src/_png.cpp 2010-02-08 15:57:45 UTC (rev 8116)
+++ trunk/matplotlib/src/_png.cpp 2010-02-08 16:00:23 UTC (rev 8117)
@@ -336,7 +336,11 @@
//free the png memory
png_read_end(png_ptr, info_ptr);
+#ifndef png_infopp_NULL
+ png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
+#else
png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);
+#endif
if (close_file) {
fclose(fp);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2010-02-08 15:57:52
|
Revision: 8116
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8116&view=rev
Author: mdboom
Date: 2010-02-08 15:57:45 +0000 (Mon, 08 Feb 2010)
Log Message:
-----------
Fix for libpng-1.4 compatibility
Modified Paths:
--------------
branches/v0_99_maint/src/_png.cpp
Modified: branches/v0_99_maint/src/_png.cpp
===================================================================
--- branches/v0_99_maint/src/_png.cpp 2010-02-06 23:54:14 UTC (rev 8115)
+++ branches/v0_99_maint/src/_png.cpp 2010-02-08 15:57:45 UTC (rev 8116)
@@ -130,12 +130,12 @@
png_init_io(png_ptr, fp);
} else {
png_set_write_fn(png_ptr, (void*)py_fileobj.ptr(),
- &write_png_data, &flush_png_data);
+ &write_png_data, &flush_png_data);
}
png_set_IHDR(png_ptr, info_ptr,
- width, height, 8,
- PNG_COLOR_TYPE_RGB_ALPHA, PNG_INTERLACE_NONE,
- PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
+ width, height, 8,
+ PNG_COLOR_TYPE_RGB_ALPHA, PNG_INTERLACE_NONE,
+ PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
// Save the dpi of the image in the file
if (args.size() == 5) {
@@ -181,7 +181,7 @@
args.verify_length(1);
std::string fname = Py::String(args[0]);
- png_byte header[8]; // 8 is the maximum size that can be checked
+ png_byte header[8]; // 8 is the maximum size that can be checked
FILE *fp = fopen(fname.c_str(), "rb");
if (!fp)
@@ -272,25 +272,29 @@
for (png_uint_32 y = 0; y < height; y++) {
png_byte* row = row_pointers[y];
- for (png_uint_32 x = 0; x < width; x++) {
- size_t offset = y*A->strides[0] + x*A->strides[1];
- if (bit_depth == 16) {
- png_uint_16* ptr = &reinterpret_cast<png_uint_16*> (row)[x * dimensions[2]];
+ for (png_uint_32 x = 0; x < width; x++) {
+ size_t offset = y*A->strides[0] + x*A->strides[1];
+ if (bit_depth == 16) {
+ png_uint_16* ptr = &reinterpret_cast<png_uint_16*> (row)[x * dimensions[2]];
for (png_uint_32 p = 0; p < (png_uint_32)dimensions[2]; p++)
- *(float*)(A->data + offset + p*A->strides[2]) = (float)(ptr[p]) / max_value;
- } else {
- png_byte* ptr = &(row[x * dimensions[2]]);
- for (png_uint_32 p = 0; p < (png_uint_32)dimensions[2]; p++)
- {
- *(float*)(A->data + offset + p*A->strides[2]) = (float)(ptr[p]) / max_value;
- }
- }
+ *(float*)(A->data + offset + p*A->strides[2]) = (float)(ptr[p]) / max_value;
+ } else {
+ png_byte* ptr = &(row[x * dimensions[2]]);
+ for (png_uint_32 p = 0; p < (png_uint_32)dimensions[2]; p++)
+ {
+ *(float*)(A->data + offset + p*A->strides[2]) = (float)(ptr[p]) / max_value;
+ }
+ }
}
}
//free the png memory
png_read_end(png_ptr, info_ptr);
+#ifndef png_infopp_NULL
+ png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
+#else
png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);
+#endif
fclose(fp);
for (row = 0; row < height; row++)
delete [] row_pointers[row];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2010-02-06 23:54:21
|
Revision: 8115
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8115&view=rev
Author: efiring
Date: 2010-02-06 23:54:14 +0000 (Sat, 06 Feb 2010)
Log Message:
-----------
Added gnu0 platform to setupext.py (Benjamin Drung)
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/setupext.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2010-02-06 23:52:34 UTC (rev 8114)
+++ trunk/matplotlib/CHANGELOG 2010-02-06 23:54:14 UTC (rev 8115)
@@ -1,3 +1,7 @@
+2010-02-06 Added setup.cfg "basedirlist" option to override setting
+ in setupext.py "basedir" dictionary; added "gnu0"
+ platform requested by Benjamin Drung. - EF
+
2010-02-06 Added 'xy' scaling option to EllipseCollection. - EF
2010-02-03 Made plot_directive use a custom PlotWarning category, so that
Modified: trunk/matplotlib/setupext.py
===================================================================
--- trunk/matplotlib/setupext.py 2010-02-06 23:52:34 UTC (rev 8114)
+++ trunk/matplotlib/setupext.py 2010-02-06 23:54:14 UTC (rev 8115)
@@ -1,8 +1,10 @@
"""
Some helper functions for building the C extensions
-you may need to edit basedir to point to the default location of your
-required libs, eg, png, z, freetype
+You may need to use the "basedirlist" option in setup.cfg to point
+to the location of your required libs, eg, png, z, freetype,
+overriding the settings hard-coded in the "basedir" directory
+below.
DARWIN
@@ -71,6 +73,7 @@
'gnukfreebsd6' : ['/usr/local', '/usr'],
'gnukfreebsd7' : ['/usr/local', '/usr'],
'gnukfreebsd8' : ['/usr/local', '/usr'],
+ 'gnu0' : ['/usr'],
'aix5' : ['/usr/local'],
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2010-02-06 23:52:40
|
Revision: 8114
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8114&view=rev
Author: leejjoon
Date: 2010-02-06 23:52:34 +0000 (Sat, 06 Feb 2010)
Log Message:
-----------
add Colorbar.set_ticks and Colorbar.set_ticklabels
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/colorbar.py
Modified: trunk/matplotlib/lib/matplotlib/colorbar.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/colorbar.py 2010-02-06 23:44:28 UTC (rev 8113)
+++ trunk/matplotlib/lib/matplotlib/colorbar.py 2010-02-06 23:52:34 UTC (rev 8114)
@@ -18,6 +18,7 @@
is a thin wrapper over :meth:`~matplotlib.figure.Figure.colorbar`.
'''
+import warnings
import numpy as np
import matplotlib as mpl
@@ -207,6 +208,7 @@
filled=True,
):
self.ax = ax
+ self._patch_ax()
if cmap is None: cmap = cm.get_cmap()
if norm is None: norm = colors.Normalize()
self.alpha = alpha
@@ -239,6 +241,13 @@
# The rest is in a method so we can recalculate when clim changes.
self.draw_all()
+ def _patch_ax(self):
+ def _warn(*args, **kw):
+ warnings.warn("Use the colorbar set_ticks() method instead.")
+
+ self.ax.set_xticks = _warn
+ self.ax.set_yticks = _warn
+
def draw_all(self):
'''
Calculate any free parameters based on the current cmap and norm,
@@ -253,6 +262,50 @@
self._add_solids(X, Y, C)
self._set_label()
+ def update_ticks(self):
+ """
+ Force the update of the ticks and ticklabels. This must be
+ called whenever the tick locator and/or tick formatter changes.
+ """
+ ax = self.ax
+ ticks, ticklabels, offset_string = self._ticker()
+ if self.orientation == 'vertical':
+ ax.xaxis.set_ticks([])
+ ax.yaxis.set_label_position('right')
+ ax.yaxis.set_ticks_position('right')
+ ax.yaxis.set_ticks(ticks)
+ ax.set_yticklabels(ticklabels)
+ ax.yaxis.get_major_formatter().set_offset_string(offset_string)
+
+ else:
+ ax.yaxis.set_ticks([])
+ ax.xaxis.set_label_position('bottom')
+ ax.xaxis.set_ticks(ticks)
+ ax.set_xticklabels(ticklabels)
+ ax.xaxis.get_major_formatter().set_offset_string(offset_string)
+
+ def set_ticks(self, ticks, update_ticks=True):
+ """
+ set tick locations. Tick locations are updated immediately unless update_ticks is
+ *False*. To manually update the ticks, call *update_ticks* method explicitly.
+ """
+ self.locator = ticker.FixedLocator(ticks, nbins=len(ticks))
+ if update_ticks:
+ self.update_ticks()
+
+ def set_ticklabels(self, ticklabels, update_ticks=True):
+ """
+ set tick labels. Tick labels are updated immediately unless update_ticks is
+ *False*. To manually update the ticks, call *update_ticks* method explicitly.
+ """
+ if isinstance(self.locator, ticker.FixedLocator):
+ self.formatter = ticker.FixedFormatter(ticklabels)
+ if update_ticks:
+ self.update_ticks()
+ else:
+ warnings.warn("set_ticks() must have been called.")
+
+
def _config_axes(self, X, Y):
'''
Make an axes patch and outline.
@@ -275,22 +328,10 @@
linewidth=0.01,
zorder=-1)
ax.add_artist(self.patch)
- ticks, ticklabels, offset_string = self._ticker()
- if self.orientation == 'vertical':
- ax.set_xticks([])
- ax.yaxis.set_label_position('right')
- ax.yaxis.set_ticks_position('right')
- ax.set_yticks(ticks)
- ax.set_yticklabels(ticklabels)
- ax.yaxis.get_major_formatter().set_offset_string(offset_string)
- else:
- ax.set_yticks([])
- ax.xaxis.set_label_position('bottom')
- ax.set_xticks(ticks)
- ax.set_xticklabels(ticklabels)
- ax.xaxis.get_major_formatter().set_offset_string(offset_string)
+ self.update_ticks()
+
def _set_label(self):
if self.orientation == 'vertical':
self.ax.set_ylabel(self._label, **self._labelkw)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2010-02-06 23:44:34
|
Revision: 8113
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8113&view=rev
Author: efiring
Date: 2010-02-06 23:44:28 +0000 (Sat, 06 Feb 2010)
Log Message:
-----------
Let setup.cfg customize the base directory for libs and includes
Modified Paths:
--------------
trunk/matplotlib/setup.cfg.template
trunk/matplotlib/setupext.py
Modified: trunk/matplotlib/setup.cfg.template
===================================================================
--- trunk/matplotlib/setup.cfg.template 2010-02-06 22:30:12 UTC (rev 8112)
+++ trunk/matplotlib/setup.cfg.template 2010-02-06 23:44:28 UTC (rev 8113)
@@ -4,6 +4,11 @@
[egg_info]
tag_svn_revision = 1
+[directories]
+# Uncomment to override the default basedir in setupext.py.
+# This can be a single directory or a space-delimited list of directories.
+#basedirlist = /usr
+
[status]
# To suppress display of the dependencies and their versions
# at the top of the build log, uncomment the following line:
Modified: trunk/matplotlib/setupext.py
===================================================================
--- trunk/matplotlib/setupext.py 2010-02-06 22:30:12 UTC (rev 8112)
+++ trunk/matplotlib/setupext.py 2010-02-06 23:44:28 UTC (rev 8113)
@@ -119,7 +119,8 @@
'build_macosx': 'auto',
'build_image': True,
'build_windowing': True,
- 'backend': None}
+ 'backend': None,
+ 'basedirlist': None}
defines = [
('PY_ARRAY_UNIQUE_SYMBOL', 'MPL_ARRAY_API'),
@@ -161,7 +162,16 @@
try: options['backend'] = config.get("rc_options", "backend")
except: pass
+ try: options['basedirlist'] = config.get("directories", "basedirlist")
+ except: pass
+# For get_base_flags:
+if options['basedirlist']:
+ basedirlist = options['basedirlist'].split()
+else:
+ basedirlist = basedir[sys.platform]
+print "basedirlist is:", basedirlist
+
if options['display_status']:
def print_line(char='='):
print char * 76
@@ -331,10 +341,10 @@
def add_base_flags(module):
incdirs = filter(os.path.exists,
- [os.path.join(p, 'include') for p in basedir[sys.platform] ])
+ [os.path.join(p, 'include') for p in basedirlist ])
libdirs = filter(os.path.exists,
- [os.path.join(p, 'lib') for p in basedir[sys.platform] ]+
- [os.path.join(p, 'lib64') for p in basedir[sys.platform] ] )
+ [os.path.join(p, 'lib') for p in basedirlist ]+
+ [os.path.join(p, 'lib64') for p in basedirlist ] )
module.include_dirs.extend(incdirs)
module.include_dirs.append('.')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2010-02-06 22:30:18
|
Revision: 8112
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8112&view=rev
Author: leejjoon
Date: 2010-02-06 22:30:12 +0000 (Sat, 06 Feb 2010)
Log Message:
-----------
a minor fix of blocking_input.py
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/blocking_input.py
Modified: trunk/matplotlib/lib/matplotlib/blocking_input.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/blocking_input.py 2010-02-06 21:24:21 UTC (rev 8111)
+++ trunk/matplotlib/lib/matplotlib/blocking_input.py 2010-02-06 22:30:12 UTC (rev 8112)
@@ -161,6 +161,10 @@
'''
event = self.events[-1]
+ if event.key is None:
+ # at least in mac os X gtk backend some key returns None.
+ return
+
key = event.key.lower()
if key in ['backspace', 'delete']:
@@ -382,10 +386,6 @@
broken contour - once humpty-dumpty is broken, he can't be put
back together. In inline mode, this does nothing.
"""
- # Remove this last event - not too important for clabel use
- # since clabel normally doesn't have a maximum number of
- # events, but best for cleanliness sake.
- BlockingInput.pop(self)
if self.inline:
pass
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2010-02-06 21:24:33
|
Revision: 8111
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8111&view=rev
Author: efiring
Date: 2010-02-06 21:24:21 +0000 (Sat, 06 Feb 2010)
Log Message:
-----------
Modified EllipseCollection for closer compatibility with Ellipse patch.
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/doc/api/api_changes.rst
trunk/matplotlib/lib/matplotlib/collections.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2010-02-04 04:58:51 UTC (rev 8110)
+++ trunk/matplotlib/CHANGELOG 2010-02-06 21:24:21 UTC (rev 8111)
@@ -1,3 +1,5 @@
+2010-02-06 Added 'xy' scaling option to EllipseCollection. - EF
+
2010-02-03 Made plot_directive use a custom PlotWarning category, so that
warnings can be turned into fatal errors easily if desired. - FP
Modified: trunk/matplotlib/doc/api/api_changes.rst
===================================================================
--- trunk/matplotlib/doc/api/api_changes.rst 2010-02-04 04:58:51 UTC (rev 8110)
+++ trunk/matplotlib/doc/api/api_changes.rst 2010-02-06 21:24:21 UTC (rev 8111)
@@ -10,6 +10,19 @@
Changes beyond 0.99.x
=====================
+* The :class:'~matplotlib.collections.EllipseCollection' has been
+ changed in two ways:
+
+ + There is a new *units* option, 'xy', that scales the ellipse with
+ the data units. This matches the :class:'~matplotlib.patches.Ellipse`
+ scaling.
+
+ + The *height* and *width* kwargs have been changed to specify
+ the height and width, again for consistency with
+ :class:'~matplotlib.patches.Ellipse`, and to better match
+ their names; previously they specified the half-height and
+ half-width.
+
* There is a new rc parameter ``axes.color_cycle``, and the color
cycle is now independent of the rc parameter ``lines.color``.
:func:`matplotlib.Axes.set_default_color_cycle` is deprecated.
Modified: trunk/matplotlib/lib/matplotlib/collections.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/collections.py 2010-02-04 04:58:51 UTC (rev 8110)
+++ trunk/matplotlib/lib/matplotlib/collections.py 2010-02-06 21:24:21 UTC (rev 8111)
@@ -918,77 +918,79 @@
def __init__(self, widths, heights, angles, units='points', **kwargs):
"""
*widths*: sequence
- half-lengths of first axes (e.g., semi-major axis lengths)
+ lengths of first axes (e.g., major axis lengths)
*heights*: sequence
- half-lengths of second axes
+ lengths of second axes
*angles*: sequence
angles of first axes, degrees CCW from the X-axis
- *units*: ['points' | 'inches' | 'dots' | 'width' | 'height' | 'x' | 'y']
+ *units*: ['points' | 'inches' | 'dots' | 'width' | 'height'
+ | 'x' | 'y' | 'xy']
units in which majors and minors are given; 'width' and 'height'
refer to the dimensions of the axes, while 'x' and 'y'
- refer to the *offsets* data units.
+ refer to the *offsets* data units. 'xy' differs from all
+ others in that the angle as plotted varies with the
+ aspect ratio, and equals the specified angle only when
+ the aspect ratio is unity. Hence it behaves the same
+ as the :class:`~matplotlib.patches.Ellipse` with
+ axes.transData as its transform.
Additional kwargs inherited from the base :class:`Collection`:
%(Collection)s
"""
Collection.__init__(self,**kwargs)
- self._widths = np.asarray(widths).ravel()
- self._heights = np.asarray(heights).ravel()
+ self._widths = 0.5 * np.asarray(widths).ravel()
+ self._heights = 0.5 * np.asarray(heights).ravel()
self._angles = np.asarray(angles).ravel() *(np.pi/180.0)
self._units = units
self.set_transform(transforms.IdentityTransform())
self._transforms = []
self._paths = [mpath.Path.unit_circle()]
- self._initialized = False
-
- def _init(self):
- def on_dpi_change(fig):
- self._transforms = []
- self.figure.callbacks.connect('dpi_changed', on_dpi_change)
- self._initialized = True
-
- def set_transforms(self):
- if not self._initialized:
- self._init()
+ def _set_transforms(self):
+ """
+ Calculate transforms immediately before drawing.
+ """
self._transforms = []
ax = self.axes
fig = self.figure
- if self._units in ('x', 'y'):
- if self._units == 'x':
- dx0 = ax.viewLim.width
- dx1 = ax.bbox.width
- else:
- dx0 = ax.viewLim.height
- dx1 = ax.bbox.height
- sc = dx1/dx0
+
+ if self._units == 'xy':
+ sc = 1
+ elif self._units == 'x':
+ sc = ax.bbox.width / ax.viewLim.width
+ elif self._units == 'y':
+ sc = ax.bbox.height / ax.viewLim.height
+ elif self._units == 'inches':
+ sc = fig.dpi
+ elif self._units == 'points':
+ sc = fig.dpi / 72.0
+ elif self._units == 'width':
+ sc = ax.bbox.width
+ elif self._units == 'height':
+ sc = ax.bbox.height
+ elif self._units == 'dots':
+ sc = 1.0
else:
- if self._units == 'inches':
- sc = fig.dpi
- elif self._units == 'points':
- sc = fig.dpi / 72.0
- elif self._units == 'width':
- sc = ax.bbox.width
- elif self._units == 'height':
- sc = ax.bbox.height
- elif self._units == 'dots':
- sc = 1.0
- else:
- raise ValueError('unrecognized units: %s' % self._units)
+ raise ValueError('unrecognized units: %s' % self._units)
_affine = transforms.Affine2D
for x, y, a in zip(self._widths, self._heights, self._angles):
trans = _affine().scale(x * sc, y * sc).rotate(a)
self._transforms.append(trans)
+ if self._units == 'xy':
+ m = ax.transData.get_affine().get_matrix().copy()
+ m[:2, 2:] = 0
+ self.set_transform(_affine(m))
+
+
def draw(self, renderer):
- if True: ###not self._transforms:
- self.set_transforms()
- return Collection.draw(self, renderer)
+ self._set_transforms()
+ Collection.draw(self, renderer)
class PatchCollection(Collection):
"""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|