You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(115) |
Aug
(120) |
Sep
(137) |
Oct
(170) |
Nov
(461) |
Dec
(263) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(120) |
Feb
(74) |
Mar
(35) |
Apr
(74) |
May
(245) |
Jun
(356) |
Jul
(240) |
Aug
(115) |
Sep
(78) |
Oct
(225) |
Nov
(98) |
Dec
(271) |
| 2009 |
Jan
(132) |
Feb
(84) |
Mar
(74) |
Apr
(56) |
May
(90) |
Jun
(79) |
Jul
(83) |
Aug
(296) |
Sep
(214) |
Oct
(76) |
Nov
(82) |
Dec
(66) |
| 2010 |
Jan
(46) |
Feb
(58) |
Mar
(51) |
Apr
(77) |
May
(58) |
Jun
(126) |
Jul
(128) |
Aug
(64) |
Sep
(50) |
Oct
(44) |
Nov
(48) |
Dec
(54) |
| 2011 |
Jan
(68) |
Feb
(52) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <jd...@us...> - 2009-08-31 02:42:55
|
Revision: 7610
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7610&view=rev
Author: jdh2358
Date: 2009-08-31 02:42:44 +0000 (Mon, 31 Aug 2009)
Log Message:
-----------
make the buildbot point to devbb
Modified Paths:
--------------
trunk/matplotlib/test/_buildbot_mac_sage.sh
Modified: trunk/matplotlib/test/_buildbot_mac_sage.sh
===================================================================
--- trunk/matplotlib/test/_buildbot_mac_sage.sh 2009-08-31 02:33:21 UTC (rev 7609)
+++ trunk/matplotlib/test/_buildbot_mac_sage.sh 2009-08-31 02:42:44 UTC (rev 7610)
@@ -3,6 +3,7 @@
rm -rf ${HOME}/.matplotlib/*
rm -rf build
+export PATH=${HOME}/dev/bin:$PATH
export PYTHON=${HOME}/dev/bin/python
export PREFIX=${HOME}/devbb
export PYTHONPATH=${PREFIX}/lib/python2.6/site-packages:${HOME}/dev/lib/python2.6/site-packages
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2009-08-31 02:33:28
|
Revision: 7609
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7609&view=rev
Author: jdh2358
Date: 2009-08-31 02:33:21 +0000 (Mon, 31 Aug 2009)
Log Message:
-----------
update make.osx to find the local freetype etc
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
trunk/matplotlib/make.osx
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2009-08-31 00:38:43 UTC (rev 7608)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2009-08-31 02:33:21 UTC (rev 7609)
@@ -140,9 +140,9 @@
# space) in the following call to draw_text_image).
font.set_text(s, 0, flags=LOAD_FORCE_AUTOHINT)
font.draw_glyphs_to_bitmap()
+
+ #print x, y, int(x), int(y), s
- #print x, y, int(x), int(y)
-
self._renderer.draw_text_image(font.get_image(), int(x), int(y) + 1, angle, gc)
def get_text_width_height_descent(self, s, prop, ismath):
Modified: trunk/matplotlib/make.osx
===================================================================
--- trunk/matplotlib/make.osx 2009-08-31 00:38:43 UTC (rev 7608)
+++ trunk/matplotlib/make.osx 2009-08-31 02:33:21 UTC (rev 7609)
@@ -10,10 +10,7 @@
## You shouldn't need to configure past this point
-CFLAGS="-Os -arch ppc -arch i386 -I{$PREFIX}/include"
-
-LDFLAGS="-arch ppc -arch i386 -L${PREFIX}/lib"
-
+PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig"
CFLAGS_DEPS="-arch i386 -arch ppc -I${PREFIX}/include -I${PREFIX}/include/freetype2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk"
LDFLAGS_DEPS="-arch i386 -arch ppc -L${PREFIX}/lib -syslibroot,/Developer/SDKs/MacOSX10.4u.sdk"
@@ -32,7 +29,7 @@
zlib:
- unset PKG_CONFIG_PATH &&\
+ export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} &&\
rm -rf zlib-${ZLIBVERSION} &&\
tar xvfz zlib-${ZLIBVERSION}.tar.gz &&\
cd zlib-${ZLIBVERSION} &&\
@@ -44,7 +41,7 @@
unset MACOSX_DEPLOYMENT_TARGET
png: zlib
- unset PKG_CONFIG_PATH &&\
+ export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} &&\
rm -rf libpng-${PNGVERSION} &&\
tar xvfj libpng-${PNGVERSION}.tar.bz2
cd libpng-${PNGVERSION} &&\
@@ -58,7 +55,7 @@
freetype: zlib
- unset PKG_CONFIG_PATH &&\
+ export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} &&\
rm -rf ${FREETYPEVERSION} &&\
tar xvfj freetype-${FREETYPEVERSION}.tar.bz2 &&\
cd freetype-${FREETYPEVERSION} &&\
@@ -75,13 +72,17 @@
echo 'all done'
mpl_build:
+ export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} &&\
export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} &&\
export CFLAGS=${CFLAGS_DEPS} &&\
export LDFLAGS=${LDFLAGS_DEPS} &&\
python setup.py build
mpl_install:
+ export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} &&\
export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} &&\
export CFLAGS=${CFLAGS_DEPS} &&\
export LDFLAGS=${LDFLAGS_DEPS} &&\
+ export LD_LIBRARY_PATH=${PREFIX}/lib &&\
+ export DYLD_LIBRARY_PATH=${PREFIX}/lib &&\
python setup.py install --prefix=${PREFIX}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2009-08-31 00:38:49
|
Revision: 7608
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7608&view=rev
Author: leejjoon
Date: 2009-08-31 00:38:43 +0000 (Mon, 31 Aug 2009)
Log Message:
-----------
Merged revisions 7607 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_99_maint
........
r7607 | leejjoon | 2009-08-30 20:32:12 -0400 (Sun, 30 Aug 2009) | 1 line
fix sf bug #2839919
........
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/legend.py
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Modified: svnmerge-integrated
- /branches/mathtex:1-7263 /branches/v0_98_5_maint:1-7253 /branches/v0_99_maint:1-7600
+ /branches/mathtex:1-7263 /branches/v0_98_5_maint:1-7253 /branches/v0_99_maint:1-7607
Modified: trunk/matplotlib/lib/matplotlib/legend.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/legend.py 2009-08-31 00:32:12 UTC (rev 7607)
+++ trunk/matplotlib/lib/matplotlib/legend.py 2009-08-31 00:38:43 UTC (rev 7608)
@@ -591,8 +591,9 @@
# We calculate number of lows in each column. The first
# (num_largecol) columns will have (nrows+1) rows, and remaing
# (num_smallcol) columns will have (nrows) rows.
- nrows, num_largecol = divmod(len(handleboxes), self._ncol)
- num_smallcol = self._ncol-num_largecol
+ ncol = min(self._ncol, len(handleboxes))
+ nrows, num_largecol = divmod(len(handleboxes), ncol)
+ num_smallcol = ncol-num_largecol
# starting index of each column and number of rows in it.
largecol = safezip(range(0, num_largecol*(nrows+1), (nrows+1)),
@@ -860,3 +861,4 @@
return ox, oy
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2009-08-31 00:32:24
|
Revision: 7607
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7607&view=rev
Author: leejjoon
Date: 2009-08-31 00:32:12 +0000 (Mon, 31 Aug 2009)
Log Message:
-----------
fix sf bug #2839919
Modified Paths:
--------------
branches/v0_99_maint/lib/matplotlib/legend.py
Modified: branches/v0_99_maint/lib/matplotlib/legend.py
===================================================================
--- branches/v0_99_maint/lib/matplotlib/legend.py 2009-08-30 20:26:05 UTC (rev 7606)
+++ branches/v0_99_maint/lib/matplotlib/legend.py 2009-08-31 00:32:12 UTC (rev 7607)
@@ -587,8 +587,9 @@
# We calculate number of lows in each column. The first
# (num_largecol) columns will have (nrows+1) rows, and remaing
# (num_smallcol) columns will have (nrows) rows.
- nrows, num_largecol = divmod(len(handleboxes), self._ncol)
- num_smallcol = self._ncol-num_largecol
+ ncol = min(self._ncol, len(handleboxes))
+ nrows, num_largecol = divmod(len(handleboxes), ncol)
+ num_smallcol = ncol-num_largecol
# starting index of each column and number of rows in it.
largecol = safezip(range(0, num_largecol*(nrows+1), (nrows+1)),
@@ -849,3 +850,4 @@
return ox, oy
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2009-08-30 20:26:16
|
Revision: 7606
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7606&view=rev
Author: leejjoon
Date: 2009-08-30 20:26:05 +0000 (Sun, 30 Aug 2009)
Log Message:
-----------
add TextPath class in text.py. Update demo_text_path.py
Modified Paths:
--------------
trunk/matplotlib/examples/pylab_examples/demo_text_path.py
trunk/matplotlib/lib/matplotlib/text.py
Modified: trunk/matplotlib/examples/pylab_examples/demo_text_path.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/demo_text_path.py 2009-08-30 18:30:29 UTC (rev 7605)
+++ trunk/matplotlib/examples/pylab_examples/demo_text_path.py 2009-08-30 20:26:05 UTC (rev 7606)
@@ -4,147 +4,54 @@
import matplotlib.pyplot as plt
from matplotlib.image import BboxImage
import numpy as np
-from matplotlib.transforms import Affine2D, IdentityTransform
+from matplotlib.transforms import IdentityTransform
-import matplotlib.font_manager as font_manager
-from matplotlib.ft2font import FT2Font, KERNING_DEFAULT, LOAD_NO_HINTING
-from matplotlib.font_manager import FontProperties
-from matplotlib.path import Path
import matplotlib.patches as mpatches
from matplotlib.offsetbox import AnnotationBbox,\
AnchoredOffsetbox, AuxTransformBox
-#from matplotlib.offsetbox import
-
from matplotlib.cbook import get_sample_data
+from matplotlib.text import TextPath
-class TextPatch(mpatches.PathPatch):
- FONT_SCALE = 100.
+class PathClippedImagePatch(mpatches.PathPatch):
+ """
+ The given image is used to draw the face of the patch. Internally,
+ it uses BboxImage whose clippath set to the path of the patch.
- def __init__(self, xy, s, size=None, prop=None, bbox_image=None,
- *kl, **kwargs):
- if prop is None:
- prop = FontProperties()
-
- if size is None:
- size = prop.get_size_in_points()
-
- self._xy = xy
- self.set_size(size)
-
- self.text_path = self.text_get_path(prop, s)
-
- mpatches.PathPatch.__init__(self, self.text_path, *kl, **kwargs)
-
+ FIXME : The result is currently dpi dependent.
+ """
+ def __init__(self, path, bbox_image, **kwargs):
+ mpatches.PathPatch.__init__(self, path, **kwargs)
+ self._facecolor = "none"
self._init_bbox_image(bbox_image)
-
+ def set_facecolor(self, color):
+ pass
+
def _init_bbox_image(self, im):
- if im is None:
- self.bbox_image = None
- else:
- bbox_image = BboxImage(self.get_window_extent,
- norm = None,
- origin=None,
- )
- bbox_image.set_transform(IdentityTransform())
+ bbox_image = BboxImage(self.get_window_extent,
+ norm = None,
+ origin=None,
+ )
+ bbox_image.set_transform(IdentityTransform())
- bbox_image.set_data(im)
- self.bbox_image = bbox_image
+ bbox_image.set_data(im)
+ self.bbox_image = bbox_image
def draw(self, renderer=None):
- if self.bbox_image is not None:
- # the clip path must be updated every draw. any solution? -JJ
- self.bbox_image.set_clip_path(self.text_path, self.get_transform())
- self.bbox_image.draw(renderer)
+ # the clip path must be updated every draw. any solution? -JJ
+ self.bbox_image.set_clip_path(self._path, self.get_transform())
+ self.bbox_image.draw(renderer)
mpatches.PathPatch.draw(self, renderer)
- def set_size(self, size):
- self._size = size
-
- def get_size(self):
- return self._size
-
- def get_patch_transform(self):
- tr = Affine2D().scale(self._size/self.FONT_SCALE, self._size/self.FONT_SCALE)
- return tr.translate(*self._xy)
-
- def glyph_char_path(self, glyph, currx=0.):
-
- verts, codes = [], []
- for step in glyph.path:
- if step[0] == 0: # MOVE_TO
- verts.append((step[1], step[2]))
- codes.append(Path.MOVETO)
- elif step[0] == 1: # LINE_TO
- verts.append((step[1], step[2]))
- codes.append(Path.LINETO)
- elif step[0] == 2: # CURVE3
- verts.extend([(step[1], step[2]),
- (step[3], step[4])])
- codes.extend([Path.CURVE3, Path.CURVE3])
- elif step[0] == 3: # CURVE4
- verts.extend([(step[1], step[2]),
- (step[3], step[4]),
- (step[5], step[6])])
- codes.extend([Path.CURVE4, Path.CURVE4, Path.CURVE4])
- elif step[0] == 4: # ENDPOLY
- verts.append((0, 0,))
- codes.append(Path.CLOSEPOLY)
-
- verts = [(x+currx, y) for (x,y) in verts]
-
- return verts, codes
-
-
- def text_get_path(self, prop, s):
-
- fname = font_manager.findfont(prop)
- font = FT2Font(str(fname))
-
- font.set_size(self.FONT_SCALE, 72)
-
- cmap = font.get_charmap()
- lastgind = None
-
- currx = 0
-
- verts, codes = [], []
-
- for c in s:
-
- ccode = ord(c)
- gind = cmap.get(ccode)
- if gind is None:
- ccode = ord('?')
- gind = 0
- glyph = font.load_char(ccode, flags=LOAD_NO_HINTING)
-
-
- if lastgind is not None:
- kern = font.get_kerning(lastgind, gind, KERNING_DEFAULT)
- else:
- kern = 0
- currx += (kern / 64.0) #/ (self.FONT_SCALE)
-
- verts1, codes1 = self.glyph_char_path(glyph, currx)
- verts.extend(verts1)
- codes.extend(codes1)
-
-
- currx += (glyph.linearHoriAdvance / 65536.0) #/ (self.FONT_SCALE)
- lastgind = gind
-
- return Path(verts, codes)
-
if 1:
fig = plt.figure(1)
@@ -156,11 +63,13 @@
from matplotlib._png import read_png
fn = get_sample_data("lena.png", asfileobj=False)
arr = read_png(fn)
- p = TextPatch((0, 0), "!?", size=150, fc="none", ec="k",
- bbox_image=arr,
- transform=IdentityTransform())
- p.set_clip_on(False)
+ text_path = TextPath((0, 0), "!?", size=150)
+ p = PathClippedImagePatch(text_path, arr, ec="k",
+ transform=IdentityTransform())
+
+ #p.set_clip_on(False)
+
# make offset box
offsetbox = AuxTransformBox(IdentityTransform())
offsetbox.add_artist(p)
@@ -176,21 +85,21 @@
ax = plt.subplot(212)
- shadow1 = TextPatch((3, -2), "TextPath", size=70, fc="none", ec="0.6", lw=3,
- transform=IdentityTransform())
- shadow2 = TextPatch((3, -2), "TextPath", size=70, fc="0.3", ec="none",
- transform=IdentityTransform())
-
arr = np.arange(256).reshape(1,256)/256.
- text_path = TextPatch((0, 0), "TextPath", size=70, fc="none", ec="none", lw=1,
- bbox_image=arr,
- transform=IdentityTransform())
+ text_path = TextPath((0, 0), "TextPath", size=70)
+ text_patch = PathClippedImagePatch(text_path, arr, ec="none",
+ transform=IdentityTransform())
+
+ shadow1 = mpatches.Shadow(text_patch, 3, -2, props=dict(fc="none", ec="0.6", lw=3))
+ shadow2 = mpatches.Shadow(text_patch, 3, -2, props=dict(fc="0.3", ec="none"))
+
+
# make offset box
offsetbox = AuxTransformBox(IdentityTransform())
offsetbox.add_artist(shadow1)
offsetbox.add_artist(shadow2)
- offsetbox.add_artist(text_path)
+ offsetbox.add_artist(text_patch)
# place the anchored offset box using AnnotationBbox
ab = AnnotationBbox(offsetbox, (0.5, 0.5),
@@ -198,16 +107,13 @@
boxcoords="offset points",
box_alignment=(0.5,0.5),
)
+ #text_path.set_size(10)
-
ax.add_artist(ab)
ax.set_xlim(0, 1)
ax.set_ylim(0, 1)
-
-
-
plt.draw()
plt.show()
Modified: trunk/matplotlib/lib/matplotlib/text.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/text.py 2009-08-30 18:30:29 UTC (rev 7605)
+++ trunk/matplotlib/lib/matplotlib/text.py 2009-08-30 20:26:05 UTC (rev 7606)
@@ -23,6 +23,11 @@
import matplotlib.nxutils as nxutils
+from matplotlib.path import Path
+import matplotlib.font_manager as font_manager
+from matplotlib.ft2font import FT2Font, KERNING_DEFAULT, LOAD_NO_HINTING
+
+
def _process_text_args(override, fontdict=None, **kwargs):
"Return an override dict. See :func:`~pyplot.text' docstring for info"
@@ -1764,3 +1769,174 @@
docstring.interpd.update(Annotation=Annotation.__init__.__doc__)
+
+class TextPath(Path):
+ """
+ Create a path from the text.
+ """
+
+ # TODO : math text is currently not supported, but it would not be easy.
+
+ FONT_SCALE = 100.
+
+ def __init__(self, xy, s, size=None, prop=None,
+ _interpolation_steps=1,
+ *kl, **kwargs):
+ """
+ Create a path from the text. No support for TeX yet. Note that
+ it simply is a path, not an artist. You need to use the
+ PathPatch (or other artists) to draw this path onto the
+ canvas.
+
+ xy : position of the text.
+ s : text
+ size : font size
+ prop : font property
+ """
+
+
+ if prop is None:
+ prop = FontProperties()
+
+ if size is None:
+ size = prop.get_size_in_points()
+
+
+ self._xy = xy
+ self.set_size(size)
+
+ self._cached_vertices = None
+
+ self._vertices, self._codes = self.text_get_vertices_codes(prop, s)
+
+ self.should_simplify = False
+ self.simplify_threshold = rcParams['path.simplify_threshold']
+ self.has_nonfinite = False
+ self._interpolation_steps = _interpolation_steps
+
+
+ def set_size(self, size):
+ """
+ set the size of the text
+ """
+ self._size = size
+ self._invalid = True
+
+ def get_size(self):
+ """
+ get the size of the text
+ """
+ return self._size
+
+ def _get_vertices(self):
+ """
+ Return the cached path after updating it if necessary.
+ """
+ self._revalidate_path()
+ return self._cached_vertices
+
+ def _get_codes(self):
+ """
+ Return the codes
+ """
+ return self._codes
+
+ vertices = property(_get_vertices)
+ codes = property(_get_codes)
+
+ def _revalidate_path(self):
+ """
+ update the path if necessary.
+
+ The path for the text is initially create with the font size
+ of FONT_SCALE, and this path is rescaled to other size when
+ necessary.
+
+ """
+ if self._invalid or \
+ (self._cached_vertices is None):
+ tr = Affine2D().scale(self._size/self.FONT_SCALE,
+ self._size/self.FONT_SCALE).translate(*self._xy)
+ self._cached_vertices = tr.transform(self._vertices)
+ self._invalid = False
+
+
+ def glyph_char_path(self, glyph, currx=0.):
+ """
+ convert the glyph to vertices and codes. Mostly copied from
+ backend_svg.py.
+ """
+ verts, codes = [], []
+ for step in glyph.path:
+ if step[0] == 0: # MOVE_TO
+ verts.append((step[1], step[2]))
+ codes.append(Path.MOVETO)
+ elif step[0] == 1: # LINE_TO
+ verts.append((step[1], step[2]))
+ codes.append(Path.LINETO)
+ elif step[0] == 2: # CURVE3
+ verts.extend([(step[1], step[2]),
+ (step[3], step[4])])
+ codes.extend([Path.CURVE3, Path.CURVE3])
+ elif step[0] == 3: # CURVE4
+ verts.extend([(step[1], step[2]),
+ (step[3], step[4]),
+ (step[5], step[6])])
+ codes.extend([Path.CURVE4, Path.CURVE4, Path.CURVE4])
+ elif step[0] == 4: # ENDPOLY
+ verts.append((0, 0,))
+ codes.append(Path.CLOSEPOLY)
+
+ verts = [(x+currx, y) for (x,y) in verts]
+
+ return verts, codes
+
+
+ def text_get_vertices_codes(self, prop, s):
+ """
+ convert the string *s* to vertices and codes using the
+ provided font property *prop*. Mostly copied from
+ backend_svg.py.
+ """
+
+ fname = font_manager.findfont(prop)
+ font = FT2Font(str(fname))
+
+ font.set_size(self.FONT_SCALE, 72)
+
+ cmap = font.get_charmap()
+ lastgind = None
+
+ currx = 0
+
+ verts, codes = [], []
+
+
+ # I'm not sure if I get kernings right. Needs to be verified. -JJL
+
+ for c in s:
+
+ ccode = ord(c)
+ gind = cmap.get(ccode)
+ if gind is None:
+ ccode = ord('?')
+ gind = 0
+ glyph = font.load_char(ccode, flags=LOAD_NO_HINTING)
+
+
+ if lastgind is not None:
+ kern = font.get_kerning(lastgind, gind, KERNING_DEFAULT)
+ else:
+ kern = 0
+ currx += (kern / 64.0) #/ (self.FONT_SCALE)
+
+ verts1, codes1 = self.glyph_char_path(glyph, currx)
+ verts.extend(verts1)
+ codes.extend(codes1)
+
+
+ currx += (glyph.linearHoriAdvance / 65536.0) #/ (self.FONT_SCALE)
+ lastgind = gind
+
+ return verts, codes
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2009-08-30 19:13:04
|
Revision: 7605
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7605&view=rev
Author: astraw
Date: 2009-08-30 18:30:29 +0000 (Sun, 30 Aug 2009)
Log Message:
-----------
buildbot: prevent DirectoryUpload failure when all tests pass
Modified Paths:
--------------
trunk/matplotlib/test/_buildbot_test_postmortem.py
Modified: trunk/matplotlib/test/_buildbot_test_postmortem.py
===================================================================
--- trunk/matplotlib/test/_buildbot_test_postmortem.py 2009-08-30 18:05:43 UTC (rev 7604)
+++ trunk/matplotlib/test/_buildbot_test_postmortem.py 2009-08-30 18:30:29 UTC (rev 7605)
@@ -75,6 +75,7 @@
if 1:
if os.path.exists(target_dir):
shutil.rmtree(target_dir)
+ os.makedirs( target_dir ) # prevent buildbot DirectoryUpload failure
os.chdir('test')
for fpath in get_recursive_filelist(roots):
# only images
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2009-08-30 18:50:35
|
Revision: 7603
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7603&view=rev
Author: jdh2358
Date: 2009-08-30 17:55:08 +0000 (Sun, 30 Aug 2009)
Log Message:
-----------
fix formatter4 unit test and image
Modified Paths:
--------------
trunk/matplotlib/test/test_matplotlib/TestAxes.py
trunk/matplotlib/test/test_matplotlib/baseline/TestAxes/formatter_ticker_004.png
Modified: trunk/matplotlib/test/test_matplotlib/TestAxes.py
===================================================================
--- trunk/matplotlib/test/test_matplotlib/TestAxes.py 2009-08-30 16:29:30 UTC (rev 7602)
+++ trunk/matplotlib/test/test_matplotlib/TestAxes.py 2009-08-30 17:55:08 UTC (rev 7603)
@@ -86,6 +86,7 @@
fname = self.outFile( "formatter_ticker_004.png" )
ax.plot( xdata, ydata2, color='green', xunits="hour" )
+ ax.set_xlabel( "x-label 004" )
fig.savefig( fname )
self.checkImage( fname )
Modified: trunk/matplotlib/test/test_matplotlib/baseline/TestAxes/formatter_ticker_004.png
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2009-08-30 18:05:49
|
Revision: 7604
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7604&view=rev
Author: jdh2358
Date: 2009-08-30 18:05:43 +0000 (Sun, 30 Aug 2009)
Log Message:
-----------
updated baseline empty datetime
Modified Paths:
--------------
trunk/matplotlib/test/test_matplotlib/baseline/TestAxes/empty_datetime.png
Modified: trunk/matplotlib/test/test_matplotlib/baseline/TestAxes/empty_datetime.png
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2009-08-30 16:29:43
|
Revision: 7602
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7602&view=rev
Author: jdh2358
Date: 2009-08-30 16:29:30 +0000 (Sun, 30 Aug 2009)
Log Message:
-----------
removed known failure decorator for sf bug 2846058
Modified Paths:
--------------
trunk/matplotlib/test/test_matplotlib/TestAxes.py
Modified: trunk/matplotlib/test/test_matplotlib/TestAxes.py
===================================================================
--- trunk/matplotlib/test/test_matplotlib/TestAxes.py 2009-08-30 16:25:46 UTC (rev 7601)
+++ trunk/matplotlib/test/test_matplotlib/TestAxes.py 2009-08-30 16:29:30 UTC (rev 7602)
@@ -58,7 +58,6 @@
self.checkImage( fname )
#--------------------------------------------------------------------
- @knownfailureif(True, "Fails due to SF bug 2846058")
def test_formatter_ticker( self ):
"""Test Some formatter and ticker issues."""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2009-08-30 16:25:54
|
Revision: 7601
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7601&view=rev
Author: jdh2358
Date: 2009-08-30 16:25:46 +0000 (Sun, 30 Aug 2009)
Log Message:
-----------
Merged revisions 7598,7600 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_99_maint
........
r7598 | jdh2358 | 2009-08-30 08:35:12 -0500 (Sun, 30 Aug 2009) | 1 line
applied Gael's ginput patch
........
r7600 | jdh2358 | 2009-08-30 11:22:38 -0500 (Sun, 30 Aug 2009) | 1 line
some unit cleanup; fix sf bug 2846058
........
Modified Paths:
--------------
trunk/matplotlib/examples/units/annotate_with_units.py
trunk/matplotlib/examples/units/bar_demo2.py
trunk/matplotlib/examples/units/radian_demo.py
trunk/matplotlib/lib/matplotlib/axes.py
trunk/matplotlib/lib/matplotlib/blocking_input.py
trunk/matplotlib/lib/matplotlib/collections.py
trunk/matplotlib/lib/matplotlib/figure.py
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Modified: svnmerge-integrated
- /branches/mathtex:1-7263 /branches/v0_98_5_maint:1-7253 /branches/v0_99_maint:1-7590
+ /branches/mathtex:1-7263 /branches/v0_98_5_maint:1-7253 /branches/v0_99_maint:1-7600
Modified: trunk/matplotlib/examples/units/annotate_with_units.py
===================================================================
--- trunk/matplotlib/examples/units/annotate_with_units.py 2009-08-30 16:22:38 UTC (rev 7600)
+++ trunk/matplotlib/examples/units/annotate_with_units.py 2009-08-30 16:25:46 UTC (rev 7601)
@@ -1,8 +1,7 @@
-
-import pylab
+import matplotlib.pyplot as plt
from basic_units import cm
-fig = pylab.figure()
+fig = plt.figure()
ax = fig.add_subplot(111)
@@ -23,5 +22,5 @@
ax.set_xlim(0*cm, 4*cm)
ax.set_ylim(0*cm, 4*cm)
-pylab.show()
+plt.show()
Modified: trunk/matplotlib/examples/units/bar_demo2.py
===================================================================
--- trunk/matplotlib/examples/units/bar_demo2.py 2009-08-30 16:22:38 UTC (rev 7600)
+++ trunk/matplotlib/examples/units/bar_demo2.py 2009-08-30 16:25:46 UTC (rev 7601)
@@ -25,11 +25,11 @@
ax3 = fig.add_subplot(2,2,3)
ax3.bar(cms, cms, bottom=bottom, width=width, xunits=inch, yunits=cm)
-ax3.set_xlim(3, 6) # scalars are interpreted in current units
+ax3.set_xlim(2, 6) # scalars are interpreted in current units
ax4 = fig.add_subplot(2,2,4)
ax4.bar(cms, cms, bottom=bottom, width=width, xunits=inch, yunits=inch)
#fig.savefig('simple_conversion_plot.png')
-ax4.set_xlim(3*cm, 6*cm) # cm are converted to inches
+ax4.set_xlim(2*cm, 6*cm) # cm are converted to inches
show()
Modified: trunk/matplotlib/examples/units/radian_demo.py
===================================================================
--- trunk/matplotlib/examples/units/radian_demo.py 2009-08-30 16:22:38 UTC (rev 7600)
+++ trunk/matplotlib/examples/units/radian_demo.py 2009-08-30 16:25:46 UTC (rev 7601)
@@ -7,15 +7,15 @@
from basic_units import radians, degrees, cos
from matplotlib.pyplot import figure, show
-x = np.arange(0, 15, 0.01) * radians
+x = [val*radians for val in np.arange(0, 15, 0.01)]
fig = figure()
fig.subplots_adjust(hspace=0.3)
ax = fig.add_subplot(211)
-ax.plot(x, cos(x), xunits=radians)
+line1, = ax.plot(x, cos(x), xunits=radians)
ax = fig.add_subplot(212)
-ax.plot(x, cos(x), xunits=degrees)
+line2, = ax.plot(x, cos(x), xunits=degrees)
show()
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2009-08-30 16:22:38 UTC (rev 7600)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2009-08-30 16:25:46 UTC (rev 7601)
@@ -203,11 +203,25 @@
if self.axes.xaxis is not None and self.axes.yaxis is not None:
bx = self.axes.xaxis.update_units(x)
by = self.axes.yaxis.update_units(y)
- if bx:
- x = self.axes.convert_xunits(x)
- if by:
- y = self.axes.convert_yunits(y)
+ if self.command!='plot':
+ # the Line2D class can handle unitized data, with
+ # support for post hoc unit changes etc. Other mpl
+ # artists, eg Polygon which _process_plot_var_args
+ # also serves on calls to fill, cannot. So this is a
+ # hack to say: if you are not "plot", which is
+ # creating Line2D, then convert the data now to
+ # floats. If you are plot, pass the raw data through
+ # to Line2D which will handle the conversion. So
+ # polygons will not support post hoc conversions of
+ # the unit type since they are not storing the orig
+ # data. Hopefully we can rationalize this at a later
+ # date - JDH
+ if bx:
+ x = self.axes.convert_xunits(x)
+ if by:
+ y = self.axes.convert_yunits(y)
+
x = np.atleast_1d(x) #like asanyarray, but converts scalar to array
y = np.atleast_1d(y)
if x.shape[0] != y.shape[0]:
@@ -4270,10 +4284,14 @@
if self.xaxis is not None:
left = self.convert_xunits( left )
width = self.convert_xunits( width )
+ if xerr is not None:
+ xerr = self.convert_xunits( xerr )
if self.yaxis is not None:
bottom = self.convert_yunits( bottom )
height = self.convert_yunits( height )
+ if yerr is not None:
+ yerr = self.convert_yunits( yerr )
if align == 'edge':
pass
Modified: trunk/matplotlib/lib/matplotlib/blocking_input.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/blocking_input.py 2009-08-30 16:22:38 UTC (rev 7600)
+++ trunk/matplotlib/lib/matplotlib/blocking_input.py 2009-08-30 16:25:46 UTC (rev 7601)
@@ -17,9 +17,6 @@
Note: Subclass of BlockingMouseInput. Used by clabel
"""
-import time
-import numpy as np
-
from matplotlib import path, verbose
from matplotlib.cbook import is_sequence_of_strings
@@ -151,7 +148,7 @@
button = event.button
if button == self.button_pop:
- self.mouse_event_pop(event,-1)
+ self.mouse_event_pop(event)
elif button == self.button_stop:
self.mouse_event_stop(event)
else:
@@ -162,7 +159,7 @@
Process a key click event. This maps certain keys to appropriate
mouse click events.
'''
-
+
event = self.events[-1]
key = event.key.lower()
Modified: trunk/matplotlib/lib/matplotlib/collections.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/collections.py 2009-08-30 16:22:38 UTC (rev 7600)
+++ trunk/matplotlib/lib/matplotlib/collections.py 2009-08-30 16:25:46 UTC (rev 7601)
@@ -819,7 +819,9 @@
def set_segments(self, segments):
if segments is None: return
_segments = []
+
for seg in segments:
+
if not np.ma.isMaskedArray(seg):
seg = np.asarray(seg, np.float_)
_segments.append(seg)
Modified: trunk/matplotlib/lib/matplotlib/figure.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/figure.py 2009-08-30 16:22:38 UTC (rev 7600)
+++ trunk/matplotlib/lib/matplotlib/figure.py 2009-08-30 16:25:46 UTC (rev 7601)
@@ -12,12 +12,11 @@
"""
import numpy as np
-import time
import artist
from artist import Artist, allow_rasterization
from axes import Axes, SubplotBase, subplot_class_factory
-from cbook import flatten, allequal, Stack, iterable, dedent
+from cbook import flatten, allequal, Stack, iterable
import _image
import colorbar as cbar
from image import FigureImage
@@ -1118,6 +1117,12 @@
Right clicking cancels last input.
+ The buttons used for the various actions (adding points, removing
+ points, terminating the inputs) can be overriden via the
+ arguments *mouse_add*, *mouse_pop* and *mouse_stop*, that give
+ the associated mouse button: 1 for left, 2 for middle, 3 for
+ right.
+
The keyboard can also be used to select points in case your mouse
does not have one or more of the buttons. The delete and backspace
keys act like right clicking (i.e., remove last point), the enter key
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2009-08-30 16:22:47
|
Revision: 7600
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7600&view=rev
Author: jdh2358
Date: 2009-08-30 16:22:38 +0000 (Sun, 30 Aug 2009)
Log Message:
-----------
some unit cleanup; fix sf bug 2846058
Modified Paths:
--------------
branches/v0_99_maint/examples/units/annotate_with_units.py
branches/v0_99_maint/examples/units/bar_demo2.py
branches/v0_99_maint/examples/units/radian_demo.py
branches/v0_99_maint/lib/matplotlib/axes.py
branches/v0_99_maint/lib/matplotlib/collections.py
Modified: branches/v0_99_maint/examples/units/annotate_with_units.py
===================================================================
--- branches/v0_99_maint/examples/units/annotate_with_units.py 2009-08-30 15:43:39 UTC (rev 7599)
+++ branches/v0_99_maint/examples/units/annotate_with_units.py 2009-08-30 16:22:38 UTC (rev 7600)
@@ -1,8 +1,7 @@
-
-import pylab
+import matplotlib.pyplot as plt
from basic_units import cm
-fig = pylab.figure()
+fig = plt.figure()
ax = fig.add_subplot(111)
@@ -23,5 +22,5 @@
ax.set_xlim(0*cm, 4*cm)
ax.set_ylim(0*cm, 4*cm)
-pylab.show()
+plt.show()
Modified: branches/v0_99_maint/examples/units/bar_demo2.py
===================================================================
--- branches/v0_99_maint/examples/units/bar_demo2.py 2009-08-30 15:43:39 UTC (rev 7599)
+++ branches/v0_99_maint/examples/units/bar_demo2.py 2009-08-30 16:22:38 UTC (rev 7600)
@@ -25,11 +25,11 @@
ax3 = fig.add_subplot(2,2,3)
ax3.bar(cms, cms, bottom=bottom, width=width, xunits=inch, yunits=cm)
-ax3.set_xlim(3, 6) # scalars are interpreted in current units
+ax3.set_xlim(2, 6) # scalars are interpreted in current units
ax4 = fig.add_subplot(2,2,4)
ax4.bar(cms, cms, bottom=bottom, width=width, xunits=inch, yunits=inch)
#fig.savefig('simple_conversion_plot.png')
-ax4.set_xlim(3*cm, 6*cm) # cm are converted to inches
+ax4.set_xlim(2*cm, 6*cm) # cm are converted to inches
show()
Modified: branches/v0_99_maint/examples/units/radian_demo.py
===================================================================
--- branches/v0_99_maint/examples/units/radian_demo.py 2009-08-30 15:43:39 UTC (rev 7599)
+++ branches/v0_99_maint/examples/units/radian_demo.py 2009-08-30 16:22:38 UTC (rev 7600)
@@ -7,15 +7,15 @@
from basic_units import radians, degrees, cos
from matplotlib.pyplot import figure, show
-x = np.arange(0, 15, 0.01) * radians
+x = [val*radians for val in np.arange(0, 15, 0.01)]
fig = figure()
fig.subplots_adjust(hspace=0.3)
ax = fig.add_subplot(211)
-ax.plot(x, cos(x), xunits=radians)
+line1, = ax.plot(x, cos(x), xunits=radians)
ax = fig.add_subplot(212)
-ax.plot(x, cos(x), xunits=degrees)
+line2, = ax.plot(x, cos(x), xunits=degrees)
show()
Modified: branches/v0_99_maint/lib/matplotlib/axes.py
===================================================================
--- branches/v0_99_maint/lib/matplotlib/axes.py 2009-08-30 15:43:39 UTC (rev 7599)
+++ branches/v0_99_maint/lib/matplotlib/axes.py 2009-08-30 16:22:38 UTC (rev 7600)
@@ -203,11 +203,25 @@
if self.axes.xaxis is not None and self.axes.yaxis is not None:
bx = self.axes.xaxis.update_units(x)
by = self.axes.yaxis.update_units(y)
- if bx:
- x = self.axes.convert_xunits(x)
- if by:
- y = self.axes.convert_yunits(y)
+ if self.command!='plot':
+ # the Line2D class can handle unitized data, with
+ # support for post hoc unit changes etc. Other mpl
+ # artists, eg Polygon which _process_plot_var_args
+ # also serves on calls to fill, cannot. So this is a
+ # hack to say: if you are not "plot", which is
+ # creating Line2D, then convert the data now to
+ # floats. If you are plot, pass the raw data through
+ # to Line2D which will handle the conversion. So
+ # polygons will not support post hoc conversions of
+ # the unit type since they are not storing the orig
+ # data. Hopefully we can rationalize this at a later
+ # date - JDH
+ if bx:
+ x = self.axes.convert_xunits(x)
+ if by:
+ y = self.axes.convert_yunits(y)
+
x = np.atleast_1d(x) #like asanyarray, but converts scalar to array
y = np.atleast_1d(y)
if x.shape[0] != y.shape[0]:
@@ -4255,10 +4269,14 @@
if self.xaxis is not None:
left = self.convert_xunits( left )
width = self.convert_xunits( width )
+ if xerr is not None:
+ xerr = self.convert_xunits( xerr )
if self.yaxis is not None:
bottom = self.convert_yunits( bottom )
height = self.convert_yunits( height )
+ if yerr is not None:
+ yerr = self.convert_yunits( yerr )
if align == 'edge':
pass
Modified: branches/v0_99_maint/lib/matplotlib/collections.py
===================================================================
--- branches/v0_99_maint/lib/matplotlib/collections.py 2009-08-30 15:43:39 UTC (rev 7599)
+++ branches/v0_99_maint/lib/matplotlib/collections.py 2009-08-30 16:22:38 UTC (rev 7600)
@@ -931,7 +931,9 @@
def set_segments(self, segments):
if segments is None: return
_segments = []
+
for seg in segments:
+
if not np.ma.isMaskedArray(seg):
seg = np.asarray(seg, np.float_)
_segments.append(seg)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2009-08-30 15:43:47
|
Revision: 7599
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7599&view=rev
Author: astraw
Date: 2009-08-30 15:43:39 +0000 (Sun, 30 Aug 2009)
Log Message:
-----------
buildbot: delete build directory when re-building
Modified Paths:
--------------
trunk/matplotlib/test/_buildbot_mac_sage.sh
Modified: trunk/matplotlib/test/_buildbot_mac_sage.sh
===================================================================
--- trunk/matplotlib/test/_buildbot_mac_sage.sh 2009-08-30 13:35:12 UTC (rev 7598)
+++ trunk/matplotlib/test/_buildbot_mac_sage.sh 2009-08-30 15:43:39 UTC (rev 7599)
@@ -1,6 +1,7 @@
#!/bin/bash
set -e
rm -rf ${HOME}/.matplotlib/*
+rm -rf build
export PYTHON=${HOME}/dev/bin/python
export PREFIX=${HOME}/devbb
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2009-08-30 13:35:26
|
Revision: 7598
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7598&view=rev
Author: jdh2358
Date: 2009-08-30 13:35:12 +0000 (Sun, 30 Aug 2009)
Log Message:
-----------
applied Gael's ginput patch
Modified Paths:
--------------
branches/v0_99_maint/lib/matplotlib/blocking_input.py
branches/v0_99_maint/lib/matplotlib/figure.py
Modified: branches/v0_99_maint/lib/matplotlib/blocking_input.py
===================================================================
--- branches/v0_99_maint/lib/matplotlib/blocking_input.py 2009-08-30 10:33:01 UTC (rev 7597)
+++ branches/v0_99_maint/lib/matplotlib/blocking_input.py 2009-08-30 13:35:12 UTC (rev 7598)
@@ -17,9 +17,6 @@
Note: Subclass of BlockingMouseInput. Used by clabel
"""
-import time
-import numpy as np
-
from matplotlib import path, verbose
from matplotlib.cbook import is_sequence_of_strings
@@ -151,7 +148,7 @@
button = event.button
if button == self.button_pop:
- self.mouse_event_pop(event,-1)
+ self.mouse_event_pop(event)
elif button == self.button_stop:
self.mouse_event_stop(event)
else:
@@ -162,7 +159,7 @@
Process a key click event. This maps certain keys to appropriate
mouse click events.
'''
-
+
event = self.events[-1]
key = event.key.lower()
Modified: branches/v0_99_maint/lib/matplotlib/figure.py
===================================================================
--- branches/v0_99_maint/lib/matplotlib/figure.py 2009-08-30 10:33:01 UTC (rev 7597)
+++ branches/v0_99_maint/lib/matplotlib/figure.py 2009-08-30 13:35:12 UTC (rev 7598)
@@ -12,7 +12,6 @@
"""
import numpy as np
-import time
import artist
from artist import Artist, allow_rasterization
@@ -1105,6 +1104,12 @@
Right clicking cancels last input.
+ The buttons used for the various actions (adding points, removing
+ points, terminating the inputs) can be overriden via the
+ arguments *mouse_add*, *mouse_pop* and *mouse_stop*, that give
+ the associated mouse button: 1 for left, 2 for middle, 3 for
+ right.
+
The keyboard can also be used to select points in case your mouse
does not have one or more of the buttons. The delete and backspace
keys act like right clicking (i.e., remove last point), the enter key
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jo...@us...> - 2009-08-30 10:33:12
|
Revision: 7597
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7597&view=rev
Author: jouni
Date: 2009-08-30 10:33:01 +0000 (Sun, 30 Aug 2009)
Log Message:
-----------
Improve multipage pdf documentation
Modified Paths:
--------------
trunk/matplotlib/doc/api/index_backend_api.rst
trunk/matplotlib/doc/faq/howto_faq.rst
trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
trunk/matplotlib/lib/matplotlib/figure.py
Added Paths:
-----------
trunk/matplotlib/doc/api/backend_pdf_api.rst
Added: trunk/matplotlib/doc/api/backend_pdf_api.rst
===================================================================
--- trunk/matplotlib/doc/api/backend_pdf_api.rst (rev 0)
+++ trunk/matplotlib/doc/api/backend_pdf_api.rst 2009-08-30 10:33:01 UTC (rev 7597)
@@ -0,0 +1,7 @@
+
+:mod:`matplotlib.backends.backend_pdf`
+======================================
+
+.. automodule:: matplotlib.backends.backend_pdf
+ :members:
+ :show-inheritance:
Modified: trunk/matplotlib/doc/api/index_backend_api.rst
===================================================================
--- trunk/matplotlib/doc/api/index_backend_api.rst 2009-08-30 06:29:58 UTC (rev 7596)
+++ trunk/matplotlib/doc/api/index_backend_api.rst 2009-08-30 10:33:01 UTC (rev 7597)
@@ -8,5 +8,6 @@
backend_gtkagg_api.rst
backend_qt4agg_api.rst
backend_wxagg_api.rst
+ backend_pdf_api.rst
dviread.rst
type1font.rst
Modified: trunk/matplotlib/doc/faq/howto_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/howto_faq.rst 2009-08-30 06:29:58 UTC (rev 7596)
+++ trunk/matplotlib/doc/faq/howto_faq.rst 2009-08-30 10:33:01 UTC (rev 7597)
@@ -68,6 +68,35 @@
ax.set_xlabel('volts', alpha=0.5)
+.. _howto-multipage:
+
+Save multiple plots in one pdf file
+-----------------------------------
+
+Many image file formats can only have one image per file, but some
+formats support multi-page files. Currently only the pdf backend has
+support for this. To make a multi-page pdf file, first initialize the
+file::
+
+ from matplotlib.backends.backend_pdf import PdfPages
+ pp = PdfPages('multipage.pdf')
+
+You can give the :class:`~matplotlib.backends.backend_pdf.PdfPages`
+object to :func:`~matplotlib.pyplot.savefig`, but you have to specify
+the format::
+
+ savefig(pp, format='pdf')
+
+A simpler way is to call
+:meth:`PdfPages.savefig <matplotlib.backends.backend_pdf.PdfPages.savefig>`::
+
+ pp.savefig()
+
+Finally, the multipage pdf object has to be closed::
+
+ pp.close()
+
+
.. _howto-subplots-adjust:
Move the edge of an axes to make room for tick labels
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2009-08-30 06:29:58 UTC (rev 7596)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2009-08-30 10:33:01 UTC (rev 7597)
@@ -348,7 +348,7 @@
self.compressobj = None
class PdfFile(object):
- """PDF file with one page."""
+ """PDF file object."""
def __init__(self, filename):
self.nextObject = 1 # next free object id
@@ -1923,18 +1923,18 @@
"""
A multi-page PDF file.
- Use like this:
+ Use like this::
- # Initialize:
- pdf_pages = PdfPages('foo.pdf')
+ # Initialize:
+ pp = PdfPages('foo.pdf')
- # As many times as you like, create a figure fig, then either:
- fig.savefig(pdf_pages, format='pdf') # note the format argument!
- # or:
- pdf_pages.savefig(fig)
+ # As many times as you like, create a figure fig, then either:
+ fig.savefig(pp, format='pdf') # note the format argument!
+ # or:
+ pp.savefig(fig)
- # Once you are done, remember to close the object:
- pdf_pages.close()
+ # Once you are done, remember to close the object:
+ pp.close()
(In reality PdfPages is a thin wrapper around PdfFile, in order to
avoid confusion when using savefig and forgetting the format
Modified: trunk/matplotlib/lib/matplotlib/figure.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/figure.py 2009-08-30 06:29:58 UTC (rev 7596)
+++ trunk/matplotlib/lib/matplotlib/figure.py 2009-08-30 10:33:01 UTC (rev 7597)
@@ -981,10 +981,14 @@
Arguments:
*fname*:
- A string containing a path to a filename, or a Python file-like object.
+ A string containing a path to a filename, or a Python file-like object,
+ or possibly some backend-dependent object such as
+ :class:`~matplotlib.backends.backend_pdf.PdfPages`.
If *format* is *None* and *fname* is a string, the output
format is deduced from the extension of the filename.
+ If *fname* is not a string, remember to specify *format* to
+ ensure that the correct backend is used.
Keyword arguments:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2009-08-30 06:30:05
|
Revision: 7596
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7596&view=rev
Author: efiring
Date: 2009-08-30 06:29:58 +0000 (Sun, 30 Aug 2009)
Log Message:
-----------
New version of empty_datetime.png; it is not clear what caused the change,
but the new version is nicer, so let's hope it is produced consistently now.
The difference is that there is no x ticklabel on the far left.
Modified Paths:
--------------
trunk/matplotlib/test/test_matplotlib/baseline/TestAxes/empty_datetime.png
Modified: trunk/matplotlib/test/test_matplotlib/baseline/TestAxes/empty_datetime.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...> - 2009-08-30 04:44:38
|
Revision: 7595
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7595&view=rev
Author: astraw
Date: 2009-08-30 04:44:28 +0000 (Sun, 30 Aug 2009)
Log Message:
-----------
testing: add support for KnownFailures
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/setup.py
trunk/matplotlib/test/mplTest/MplNosePlugin.py
trunk/matplotlib/test/run-mpl-test.py
trunk/matplotlib/test/test_matplotlib/TestAxes.py
Added Paths:
-----------
trunk/matplotlib/lib/matplotlib/testing/
trunk/matplotlib/lib/matplotlib/testing/__init__.py
trunk/matplotlib/lib/matplotlib/testing/decorators.py
trunk/matplotlib/lib/matplotlib/testing/noseclasses.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2009-08-30 04:44:11 UTC (rev 7594)
+++ trunk/matplotlib/CHANGELOG 2009-08-30 04:44:28 UTC (rev 7595)
@@ -1,3 +1,7 @@
+2009-08-29 Added matplotlib.testing package, which contains a Nose
+ plugin and a decorator that lets tests be marked as
+ KnownFailures - ADS
+
2009-08-20 Added scaled dict to AutoDateFormatter for customized
scales - JDH
Added: trunk/matplotlib/lib/matplotlib/testing/decorators.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/testing/decorators.py (rev 0)
+++ trunk/matplotlib/lib/matplotlib/testing/decorators.py 2009-08-30 04:44:28 UTC (rev 7595)
@@ -0,0 +1,24 @@
+from matplotlib.testing.noseclasses import KnownFailureTest
+import sys
+
+def knownfailureif(fail_condition, msg=None):
+ # based on numpy.testing.dec.knownfailureif
+ if msg is None:
+ msg = 'Test known to fail'
+ def known_fail_decorator(f):
+ # Local import to avoid a hard nose dependency and only incur the
+ # import time overhead at actual test-time.
+ import nose
+ def failer(*args, **kwargs):
+ try:
+ # Always run the test (to generate images).
+ result = f(*args, **kwargs)
+ except:
+ if fail_condition:
+ raise KnownFailureTest(msg)
+ else:
+ raise
+ # Fixme: Should raise KnownFailureDidNotFail if fail_condition==True?
+ return result
+ return nose.tools.make_decorator(f)(failer)
+ return known_fail_decorator
Added: trunk/matplotlib/lib/matplotlib/testing/noseclasses.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/testing/noseclasses.py (rev 0)
+++ trunk/matplotlib/lib/matplotlib/testing/noseclasses.py 2009-08-30 04:44:28 UTC (rev 7595)
@@ -0,0 +1,41 @@
+import os
+from nose.plugins.errorclass import ErrorClass, ErrorClassPlugin
+
+class KnownFailureTest(Exception):
+ '''Raise this exception to mark a test as a known failing test.'''
+ pass
+
+class KnownFailure(ErrorClassPlugin):
+ '''Plugin that installs a KNOWNFAIL error class for the
+ KnownFailureClass exception. When KnownFailureTest is raised,
+ the exception will be logged in the knownfail attribute of the
+ result, 'K' or 'KNOWNFAIL' (verbose) will be output, and the
+ exception will not be counted as an error or failure.
+
+ This is based on numpy.testing.noseclasses.KnownFailure.
+ '''
+ enabled = True
+ knownfail = ErrorClass(KnownFailureTest,
+ label='KNOWNFAIL',
+ isfailure=False)
+
+ def options(self, parser, env=os.environ):
+ env_opt = 'NOSE_WITHOUT_KNOWNFAIL'
+ parser.add_option('--no-knownfail', action='store_true',
+ dest='noKnownFail', default=env.get(env_opt, False),
+ help='Disable special handling of KnownFailureTest '
+ 'exceptions')
+
+ def configure(self, options, conf):
+ if not self.can_configure:
+ return
+ self.conf = conf
+ disable = getattr(options, 'noKnownFail', False)
+ if disable:
+ self.enabled = False
+
+ def addError( self, test, err ):
+ # Fixme (Really weird): if I don't leave empty method here,
+ # nose gets confused and KnownFails become testing errors when
+ # using the MplNosePlugin and MplTestCase.
+ pass
Modified: trunk/matplotlib/setup.py
===================================================================
--- trunk/matplotlib/setup.py 2009-08-30 04:44:11 UTC (rev 7594)
+++ trunk/matplotlib/setup.py 2009-08-30 04:44:28 UTC (rev 7595)
@@ -50,6 +50,7 @@
'matplotlib',
'matplotlib.backends',
'matplotlib.projections',
+ 'matplotlib.testing',
# 'matplotlib.toolkits',
'mpl_toolkits',
'mpl_toolkits.mplot3d',
Modified: trunk/matplotlib/test/mplTest/MplNosePlugin.py
===================================================================
--- trunk/matplotlib/test/mplTest/MplNosePlugin.py 2009-08-30 04:44:11 UTC (rev 7594)
+++ trunk/matplotlib/test/mplTest/MplNosePlugin.py 2009-08-30 04:44:28 UTC (rev 7595)
@@ -12,6 +12,7 @@
from path_utils import *
import directories as dirs
from MplTestCase import MplTestCase
+from matplotlib.testing.noseclasses import KnownFailureTest
#=======================================================================
@@ -48,7 +49,8 @@
TEST_ERRORED = -1
TEST_FAILED = 0
- TEST_PASSED = 1
+ TEST_KNOWN_FAILED = 1
+ TEST_PASSED = 2
#--------------------------------------------------------------------
# Some 'property' functions
@@ -148,7 +150,11 @@
err : 3-tuple
sys.exc_info() tuple
"""
- self.testResults.append( (test, self.TEST_ERRORED, err) )
+ (type, value, traceback) = err
+ if isinstance(value,KnownFailureTest):
+ self.testResults.append( (test, self.TEST_KNOWN_FAILED, err) )
+ else:
+ self.testResults.append( (test, self.TEST_ERRORED, err) )
#--------------------------------------------------------------------
def addFailure( self, test, err ):
Modified: trunk/matplotlib/test/run-mpl-test.py
===================================================================
--- trunk/matplotlib/test/run-mpl-test.py 2009-08-30 04:44:11 UTC (rev 7594)
+++ trunk/matplotlib/test/run-mpl-test.py 2009-08-30 04:44:28 UTC (rev 7595)
@@ -44,6 +44,7 @@
import nose
from mplTest import MplNosePlugin, path_utils
+from matplotlib.testing.noseclasses import KnownFailure
if '--clean' in args:
# perform the cleaning process and exit
@@ -90,7 +91,7 @@
### Run nose
success = nose.run( argv = args,
- plugins = [ MplNosePlugin() ] )
+ plugins = [ MplNosePlugin(), KnownFailure() ] )
### do other stuff here
Modified: trunk/matplotlib/test/test_matplotlib/TestAxes.py
===================================================================
--- trunk/matplotlib/test/test_matplotlib/TestAxes.py 2009-08-30 04:44:11 UTC (rev 7594)
+++ trunk/matplotlib/test/test_matplotlib/TestAxes.py 2009-08-30 04:44:28 UTC (rev 7595)
@@ -3,6 +3,7 @@
#=======================================================================
from mplTest import MplTestCase, units
+from matplotlib.testing.decorators import knownfailureif
#=======================================================================
# Add import modules below.
@@ -57,6 +58,7 @@
self.checkImage( fname )
#--------------------------------------------------------------------
+ @knownfailureif(True, "Fails due to SF bug 2846058")
def test_formatter_ticker( self ):
"""Test Some formatter and ticker issues."""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2009-08-30 04:44:22
|
Revision: 7594
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7594&view=rev
Author: astraw
Date: 2009-08-30 04:44:11 +0000 (Sun, 30 Aug 2009)
Log Message:
-----------
buildbot: wipe build directory to ensure clean rebuilds
Modified Paths:
--------------
trunk/matplotlib/test/_buildbot_install.py
Modified: trunk/matplotlib/test/_buildbot_install.py
===================================================================
--- trunk/matplotlib/test/_buildbot_install.py 2009-08-30 04:44:03 UTC (rev 7593)
+++ trunk/matplotlib/test/_buildbot_install.py 2009-08-30 04:44:11 UTC (rev 7594)
@@ -10,6 +10,11 @@
if os.path.exists(TARGET):
shutil.rmtree(TARGET)
+if 1:
+ build_path = 'build'
+ if os.path.exists(build_path):
+ shutil.rmtree(build_path)
+
check_call('virtualenv %s'%(TARGET,))
TARGET_py = os.path.join(TARGET,'bin','python')
check_call('%s setup.py install'%TARGET_py)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2009-08-30 04:44:15
|
Revision: 7593
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7593&view=rev
Author: astraw
Date: 2009-08-30 04:44:03 +0000 (Sun, 30 Aug 2009)
Log Message:
-----------
fix typo
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/cbook.py
Modified: trunk/matplotlib/lib/matplotlib/cbook.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/cbook.py 2009-08-30 04:43:54 UTC (rev 7592)
+++ trunk/matplotlib/lib/matplotlib/cbook.py 2009-08-30 04:44:03 UTC (rev 7593)
@@ -910,7 +910,7 @@
def get_recursive_filelist(args):
"""
- Recurs all the files and dirs in *args* ignoring symbolic links
+ Recurse all the files and dirs in *args* ignoring symbolic links
and return the files as a list of strings
"""
files = []
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2009-08-30 04:44:05
|
Revision: 7592
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7592&view=rev
Author: astraw
Date: 2009-08-30 04:43:54 +0000 (Sun, 30 Aug 2009)
Log Message:
-----------
testing: use standard nose mechanism for printing test name
Modified Paths:
--------------
trunk/matplotlib/test/_buildbot_test.py
trunk/matplotlib/test/mplTest/MplNosePlugin.py
Modified: trunk/matplotlib/test/_buildbot_test.py
===================================================================
--- trunk/matplotlib/test/_buildbot_test.py 2009-08-30 03:45:21 UTC (rev 7591)
+++ trunk/matplotlib/test/_buildbot_test.py 2009-08-30 04:43:54 UTC (rev 7592)
@@ -13,5 +13,5 @@
TARGET_py = os.path.join(TARGET,'bin','python')
check_call('%s -c "import shutil,matplotlib; x=matplotlib.get_configdir(); shutil.rmtree(x)"'%TARGET_py)
-check_call('%s run-mpl-test.py --all --keep-failed'%TARGET_py,
+check_call('%s run-mpl-test.py --verbose --all --keep-failed'%TARGET_py,
cwd='test')
Modified: trunk/matplotlib/test/mplTest/MplNosePlugin.py
===================================================================
--- trunk/matplotlib/test/mplTest/MplNosePlugin.py 2009-08-30 03:45:21 UTC (rev 7591)
+++ trunk/matplotlib/test/mplTest/MplNosePlugin.py 2009-08-30 04:43:54 UTC (rev 7592)
@@ -702,10 +702,6 @@
rmdir( self.outputDir )
mkdir( self.outputDir, recursive = True )
- # sys.stdout.write( "%s\n %s \n" % (test.id(), test.shortDescription()) )
- print "%s" % (test.id())
- print " %s" % (test.shortDescription())
-
#--------------------------------------------------------------------
def stopContext( self, context ):
"""Called after the tests in a context have run and the context has been
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2009-08-30 03:45:34
|
Revision: 7591
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7591&view=rev
Author: jdh2358
Date: 2009-08-30 03:45:21 +0000 (Sun, 30 Aug 2009)
Log Message:
-----------
Merged revisions 7589 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_99_maint
........
r7589 | jdh2358 | 2009-08-29 22:40:08 -0500 (Sat, 29 Aug 2009) | 1 line
added minor kwarg to get_?ticklines and applied ginpu patch
........
Modified Paths:
--------------
trunk/matplotlib/doc/users/license.rst
trunk/matplotlib/lib/matplotlib/blocking_input.py
trunk/matplotlib/lib/matplotlib/figure.py
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Modified: svnmerge-integrated
- /branches/mathtex:1-7263 /branches/v0_98_5_maint:1-7253 /branches/v0_99_maint:1-7584
+ /branches/mathtex:1-7263 /branches/v0_98_5_maint:1-7253 /branches/v0_99_maint:1-7590
Modified: trunk/matplotlib/doc/users/license.rst
===================================================================
--- trunk/matplotlib/doc/users/license.rst 2009-08-30 03:44:06 UTC (rev 7590)
+++ trunk/matplotlib/doc/users/license.rst 2009-08-30 03:45:21 UTC (rev 7591)
@@ -28,7 +28,7 @@
derivative works, distribute, and otherwise use matplotlib |version|
alone or in any derivative version, provided, however, that JDH's
License Agreement and JDH's notice of copyright, i.e., "Copyright (c)
-2002-2008 John D. Hunter; All Rights Reserved" are retained in
+2002-2009 John D. Hunter; All Rights Reserved" are retained in
matplotlib |version| alone or in any derivative version prepared by
Licensee.
Modified: trunk/matplotlib/lib/matplotlib/blocking_input.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/blocking_input.py 2009-08-30 03:44:06 UTC (rev 7590)
+++ trunk/matplotlib/lib/matplotlib/blocking_input.py 2009-08-30 03:45:21 UTC (rev 7591)
@@ -114,15 +114,25 @@
Class that creates a callable object to retrieve mouse clicks in a
blocking way.
- This class will also retrieve keyboard clicks and treat them like
+ This class will also retrieve keyboard clicks and treat them like
appropriate mouse clicks (delete and backspace are like mouse button 3,
enter is like mouse button 2 and all others are like mouse button 1).
"""
- def __init__(self, fig):
+
+ button_add = 1
+ button_pop = 3
+ button_stop = 2
+
+ def __init__(self, fig, mouse_add=1, mouse_pop=3, mouse_stop=2):
BlockingInput.__init__(self, fig=fig,
eventslist=('button_press_event',
'key_press_event') )
+ self.button_add = mouse_add
+ self.button_pop = mouse_pop
+ self.button_stop= mouse_stop
+
+
def post_event(self):
"""
This will be called to process events
@@ -133,19 +143,19 @@
self.key_event()
else:
self.mouse_event()
-
+
def mouse_event(self):
'''Process a mouse click event'''
event = self.events[-1]
button = event.button
- if button == 3:
- self.button3(event)
- elif button == 2:
- self.button2(event)
+ if button == self.button_pop:
+ self.mouse_event_pop(event,-1)
+ elif button == self.button_stop:
+ self.mouse_event_stop(event)
else:
- self.button1(event)
+ self.mouse_event_add(event)
def key_event(self):
'''
@@ -154,16 +164,16 @@
'''
event = self.events[-1]
- key = event.key
+ key = event.key.lower()
- if key == 'backspace' or key == 'delete':
- self.button3(event)
- elif key == 'enter':
- self.button2(event)
+ if key in ['backspace', 'delete']:
+ self.mouse_event_pop(event)
+ elif key in ['escape', 'enter']: # on windows XP and wxAgg, the enter key doesn't seem to register
+ self.mouse_event_stop(event)
else:
- self.button1(event)
+ self.mouse_event_add(event)
- def button1( self, event ):
+ def mouse_event_add( self, event ):
"""
Will be called for any event involving a button other than
button 2 or 3. This will add a click if it is inside axes.
@@ -171,34 +181,34 @@
if event.inaxes:
self.add_click(event)
else: # If not a valid click, remove from event list
- BlockingInput.pop(self)
+ BlockingInput.pop(self,-1)
- def button2( self, event ):
+ def mouse_event_stop( self, event ):
"""
Will be called for any event involving button 2.
Button 2 ends blocking input.
"""
# Remove last event just for cleanliness
- BlockingInput.pop(self)
+ BlockingInput.pop(self,-1)
# This will exit even if not in infinite mode. This is
# consistent with matlab and sometimes quite useful, but will
# require the user to test how many points were actually
# returned before using data.
- self.fig.canvas.stop_event_loop()
+ self.fig.canvas.stop_event_loop(event)
- def button3( self, event ):
+ def mouse_event_pop( self, event ):
"""
Will be called for any event involving button 3.
Button 3 removes the last click.
"""
# Remove this last event
- BlockingInput.pop(self)
+ BlockingInput.pop(self,-1)
# Now remove any existing clicks if possible
if len(self.events)>0:
- self.pop()
+ self.pop(event,-1)
def add_click(self,event):
"""
@@ -211,11 +221,23 @@
# If desired plot up click
if self.show_clicks:
+
+ # make sure we don't mess with the axes zoom
+ xlim = event.inaxes.get_xlim()
+ ylim = event.inaxes.get_ylim()
+
+ # plot the clicks
self.marks.extend(
event.inaxes.plot([event.xdata,], [event.ydata,], 'r+') )
+
+ # before we draw, make sure to reset the limits
+ event.inaxes.set_xlim(xlim)
+ event.inaxes.set_ylim(ylim)
self.fig.canvas.draw()
- def pop_click(self,index=-1):
+
+
+ def pop_click(self,event,index=-1):
"""
This removes a click from the list of clicks. Defaults to
removing the last click.
@@ -223,25 +245,49 @@
self.clicks.pop(index)
if self.show_clicks:
+
+ # make sure we don't mess with the axes zoom
+ xlim = event.inaxes.get_xlim()
+ ylim = event.inaxes.get_ylim()
+
mark = self.marks.pop(index)
mark.remove()
+
+ # before we draw, make sure to reset the limits
+ event.inaxes.set_xlim(xlim)
+ event.inaxes.set_ylim(ylim)
self.fig.canvas.draw()
+ # NOTE: I do NOT understand why the above 3 lines does not work
+ # for the keyboard backspace event on windows XP wxAgg.
+ # maybe event.inaxes here is a COPY of the actual axes?
- def pop(self,index=-1):
+
+ def pop(self,event,index=-1):
"""
This removes a click and the associated event from the object.
Defaults to removing the last click, but any index can be
supplied.
"""
- self.pop_click(index)
+ self.pop_click(event,index)
BlockingInput.pop(self,index)
- def cleanup(self):
+ def cleanup(self,event=None):
# clean the figure
if self.show_clicks:
+ if event:
+ # make sure we don't mess with the axes zoom
+ xlim = event.inaxes.get_xlim()
+ ylim = event.inaxes.get_ylim()
+
for mark in self.marks:
mark.remove()
self.marks = []
+
+ if event:
+ # before we draw, make sure to reset the limits
+ event.inaxes.set_xlim(xlim)
+ event.inaxes.set_ylim(ylim)
+
self.fig.canvas.draw()
# Call base class to remove callbacks
Modified: trunk/matplotlib/lib/matplotlib/figure.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/figure.py 2009-08-30 03:44:06 UTC (rev 7590)
+++ trunk/matplotlib/lib/matplotlib/figure.py 2009-08-30 03:45:21 UTC (rev 7591)
@@ -1095,11 +1095,12 @@
ax.update_params()
ax.set_position(ax.figbox)
- def ginput(self, n=1, timeout=30, show_clicks=True):
+ def ginput(self, n=1, timeout=30, show_clicks=True, mouse_add=1, mouse_pop=3, mouse_stop=2):
"""
call signature::
- ginput(self, n=1, timeout=30, show_clicks=True)
+ ginput(self, n=1, timeout=30, show_clicks=True,
+ mouse_add=1, mouse_pop=3, mouse_stop=2)
Blocking call to interact with the figure.
@@ -1120,7 +1121,9 @@
manager) selects a point.
"""
- blocking_mouse_input = BlockingMouseInput(self)
+ blocking_mouse_input = BlockingMouseInput(self, mouse_add =mouse_add,
+ mouse_pop =mouse_pop,
+ mouse_stop=mouse_stop)
return blocking_mouse_input(n=n, timeout=timeout,
show_clicks=show_clicks)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2009-08-30 03:44:12
|
Revision: 7590
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7590&view=rev
Author: jdh2358
Date: 2009-08-30 03:44:06 +0000 (Sun, 30 Aug 2009)
Log Message:
-----------
sync before merge
Modified Paths:
--------------
trunk/matplotlib/make.osx
Modified: trunk/matplotlib/make.osx
===================================================================
--- trunk/matplotlib/make.osx 2009-08-30 03:40:08 UTC (rev 7589)
+++ trunk/matplotlib/make.osx 2009-08-30 03:44:06 UTC (rev 7590)
@@ -5,7 +5,7 @@
PYTHON=python${PYVERSION}
ZLIBVERSION=1.2.3
PNGVERSION=1.2.33
-FREETYPEVERSION=2.3.7
+FREETYPEVERSION=2.3.5
MACOSX_DEPLOYMENT_TARGET=10.4
## You shouldn't need to configure past this point
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2009-08-30 03:40:21
|
Revision: 7589
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7589&view=rev
Author: jdh2358
Date: 2009-08-30 03:40:08 +0000 (Sun, 30 Aug 2009)
Log Message:
-----------
added minor kwarg to get_?ticklines and applied ginpu patch
Modified Paths:
--------------
branches/v0_99_maint/doc/users/license.rst
branches/v0_99_maint/lib/matplotlib/blocking_input.py
branches/v0_99_maint/lib/matplotlib/figure.py
Modified: branches/v0_99_maint/doc/users/license.rst
===================================================================
--- branches/v0_99_maint/doc/users/license.rst 2009-08-30 01:04:11 UTC (rev 7588)
+++ branches/v0_99_maint/doc/users/license.rst 2009-08-30 03:40:08 UTC (rev 7589)
@@ -28,7 +28,7 @@
derivative works, distribute, and otherwise use matplotlib |version|
alone or in any derivative version, provided, however, that JDH's
License Agreement and JDH's notice of copyright, i.e., "Copyright (c)
-2002-2008 John D. Hunter; All Rights Reserved" are retained in
+2002-2009 John D. Hunter; All Rights Reserved" are retained in
matplotlib |version| alone or in any derivative version prepared by
Licensee.
Modified: branches/v0_99_maint/lib/matplotlib/blocking_input.py
===================================================================
--- branches/v0_99_maint/lib/matplotlib/blocking_input.py 2009-08-30 01:04:11 UTC (rev 7588)
+++ branches/v0_99_maint/lib/matplotlib/blocking_input.py 2009-08-30 03:40:08 UTC (rev 7589)
@@ -114,15 +114,25 @@
Class that creates a callable object to retrieve mouse clicks in a
blocking way.
- This class will also retrieve keyboard clicks and treat them like
+ This class will also retrieve keyboard clicks and treat them like
appropriate mouse clicks (delete and backspace are like mouse button 3,
enter is like mouse button 2 and all others are like mouse button 1).
"""
- def __init__(self, fig):
+
+ button_add = 1
+ button_pop = 3
+ button_stop = 2
+
+ def __init__(self, fig, mouse_add=1, mouse_pop=3, mouse_stop=2):
BlockingInput.__init__(self, fig=fig,
eventslist=('button_press_event',
'key_press_event') )
+ self.button_add = mouse_add
+ self.button_pop = mouse_pop
+ self.button_stop= mouse_stop
+
+
def post_event(self):
"""
This will be called to process events
@@ -133,19 +143,19 @@
self.key_event()
else:
self.mouse_event()
-
+
def mouse_event(self):
'''Process a mouse click event'''
event = self.events[-1]
button = event.button
- if button == 3:
- self.button3(event)
- elif button == 2:
- self.button2(event)
+ if button == self.button_pop:
+ self.mouse_event_pop(event,-1)
+ elif button == self.button_stop:
+ self.mouse_event_stop(event)
else:
- self.button1(event)
+ self.mouse_event_add(event)
def key_event(self):
'''
@@ -154,16 +164,16 @@
'''
event = self.events[-1]
- key = event.key
+ key = event.key.lower()
- if key == 'backspace' or key == 'delete':
- self.button3(event)
- elif key == 'enter':
- self.button2(event)
+ if key in ['backspace', 'delete']:
+ self.mouse_event_pop(event)
+ elif key in ['escape', 'enter']: # on windows XP and wxAgg, the enter key doesn't seem to register
+ self.mouse_event_stop(event)
else:
- self.button1(event)
+ self.mouse_event_add(event)
- def button1( self, event ):
+ def mouse_event_add( self, event ):
"""
Will be called for any event involving a button other than
button 2 or 3. This will add a click if it is inside axes.
@@ -171,34 +181,34 @@
if event.inaxes:
self.add_click(event)
else: # If not a valid click, remove from event list
- BlockingInput.pop(self)
+ BlockingInput.pop(self,-1)
- def button2( self, event ):
+ def mouse_event_stop( self, event ):
"""
Will be called for any event involving button 2.
Button 2 ends blocking input.
"""
# Remove last event just for cleanliness
- BlockingInput.pop(self)
+ BlockingInput.pop(self,-1)
# This will exit even if not in infinite mode. This is
# consistent with matlab and sometimes quite useful, but will
# require the user to test how many points were actually
# returned before using data.
- self.fig.canvas.stop_event_loop()
+ self.fig.canvas.stop_event_loop(event)
- def button3( self, event ):
+ def mouse_event_pop( self, event ):
"""
Will be called for any event involving button 3.
Button 3 removes the last click.
"""
# Remove this last event
- BlockingInput.pop(self)
+ BlockingInput.pop(self,-1)
# Now remove any existing clicks if possible
if len(self.events)>0:
- self.pop()
+ self.pop(event,-1)
def add_click(self,event):
"""
@@ -211,11 +221,23 @@
# If desired plot up click
if self.show_clicks:
+
+ # make sure we don't mess with the axes zoom
+ xlim = event.inaxes.get_xlim()
+ ylim = event.inaxes.get_ylim()
+
+ # plot the clicks
self.marks.extend(
event.inaxes.plot([event.xdata,], [event.ydata,], 'r+') )
+
+ # before we draw, make sure to reset the limits
+ event.inaxes.set_xlim(xlim)
+ event.inaxes.set_ylim(ylim)
self.fig.canvas.draw()
- def pop_click(self,index=-1):
+
+
+ def pop_click(self,event,index=-1):
"""
This removes a click from the list of clicks. Defaults to
removing the last click.
@@ -223,25 +245,49 @@
self.clicks.pop(index)
if self.show_clicks:
+
+ # make sure we don't mess with the axes zoom
+ xlim = event.inaxes.get_xlim()
+ ylim = event.inaxes.get_ylim()
+
mark = self.marks.pop(index)
mark.remove()
+
+ # before we draw, make sure to reset the limits
+ event.inaxes.set_xlim(xlim)
+ event.inaxes.set_ylim(ylim)
self.fig.canvas.draw()
+ # NOTE: I do NOT understand why the above 3 lines does not work
+ # for the keyboard backspace event on windows XP wxAgg.
+ # maybe event.inaxes here is a COPY of the actual axes?
- def pop(self,index=-1):
+
+ def pop(self,event,index=-1):
"""
This removes a click and the associated event from the object.
Defaults to removing the last click, but any index can be
supplied.
"""
- self.pop_click(index)
+ self.pop_click(event,index)
BlockingInput.pop(self,index)
- def cleanup(self):
+ def cleanup(self,event=None):
# clean the figure
if self.show_clicks:
+ if event:
+ # make sure we don't mess with the axes zoom
+ xlim = event.inaxes.get_xlim()
+ ylim = event.inaxes.get_ylim()
+
for mark in self.marks:
mark.remove()
self.marks = []
+
+ if event:
+ # before we draw, make sure to reset the limits
+ event.inaxes.set_xlim(xlim)
+ event.inaxes.set_ylim(ylim)
+
self.fig.canvas.draw()
# Call base class to remove callbacks
Modified: branches/v0_99_maint/lib/matplotlib/figure.py
===================================================================
--- branches/v0_99_maint/lib/matplotlib/figure.py 2009-08-30 01:04:11 UTC (rev 7588)
+++ branches/v0_99_maint/lib/matplotlib/figure.py 2009-08-30 03:40:08 UTC (rev 7589)
@@ -1086,11 +1086,12 @@
ax.update_params()
ax.set_position(ax.figbox)
- def ginput(self, n=1, timeout=30, show_clicks=True):
+ def ginput(self, n=1, timeout=30, show_clicks=True, mouse_add=1, mouse_pop=3, mouse_stop=2):
"""
call signature::
- ginput(self, n=1, timeout=30, show_clicks=True)
+ ginput(self, n=1, timeout=30, show_clicks=True,
+ mouse_add=1, mouse_pop=3, mouse_stop=2)
Blocking call to interact with the figure.
@@ -1111,7 +1112,9 @@
manager) selects a point.
"""
- blocking_mouse_input = BlockingMouseInput(self)
+ blocking_mouse_input = BlockingMouseInput(self, mouse_add =mouse_add,
+ mouse_pop =mouse_pop,
+ mouse_stop=mouse_stop)
return blocking_mouse_input(n=n, timeout=timeout,
show_clicks=show_clicks)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2009-08-30 01:04:27
|
Revision: 7588
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7588&view=rev
Author: jswhit
Date: 2009-08-30 01:04:11 +0000 (Sun, 30 Aug 2009)
Log Message:
-----------
workaround for contourf bug (mask regions outside map)
Modified Paths:
--------------
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2009-08-30 00:08:34 UTC (rev 7587)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2009-08-30 01:04:11 UTC (rev 7588)
@@ -2831,9 +2831,17 @@
region (see examples/contour_demo.py).""")
# mask for points outside projection limb.
xymask = np.logical_or(np.greater(x,1.e20),np.greater(y,1.e20))
+ # mask outside projection region (workaround for contourf bug?)
+ epsx = 0.1*(self.xmax-self.xmin)
+ epsy = 0.1*(self.ymax-self.ymin)
+ outsidemask = np.logical_or(np.logical_or(x > self.xmax+epsx,\
+ x < self.xmin-epsy),\
+ np.logical_or(y > self.ymax+epsy,\
+ y < self.ymin-epsy))
data = ma.asarray(data)
- # combine with data mask.
- mask = np.logical_or(ma.getmaskarray(data),xymask)
+ # combine masks.
+ mask = \
+ np.logical_or(outsidemask,np.logical_or(ma.getmaskarray(data),xymask))
data = ma.masked_array(data,mask=mask)
# allow callers to override the hold state by passing hold=True|False
b = ax.ishold()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2009-08-30 00:08:45
|
Revision: 7587
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7587&view=rev
Author: astraw
Date: 2009-08-30 00:08:34 +0000 (Sun, 30 Aug 2009)
Log Message:
-----------
testing: add missing import and add SF bug ID
Modified Paths:
--------------
trunk/matplotlib/test/test_matplotlib/TestAxes.py
Modified: trunk/matplotlib/test/test_matplotlib/TestAxes.py
===================================================================
--- trunk/matplotlib/test/test_matplotlib/TestAxes.py 2009-08-30 00:03:25 UTC (rev 7586)
+++ trunk/matplotlib/test/test_matplotlib/TestAxes.py 2009-08-30 00:08:34 UTC (rev 7587)
@@ -2,7 +2,7 @@
"""The Axes unit-test class implementation."""
#=======================================================================
-from mplTest import MplTestCase
+from mplTest import MplTestCase, units
#=======================================================================
# Add import modules below.
@@ -88,6 +88,8 @@
fig.savefig( fname )
self.checkImage( fname )
+ # See SF bug 2846058
+ # https://sourceforge.net/tracker/?func=detail&aid=2846058&group_id=80706&atid=560720
fname = self.outFile( "formatter_ticker_005.png" )
ax.set_xlabel( "x-label 005" )
ax.autoscale_view()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2009-08-30 00:03:38
|
Revision: 7586
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7586&view=rev
Author: astraw
Date: 2009-08-30 00:03:25 +0000 (Sun, 30 Aug 2009)
Log Message:
-----------
remove 'import *' usage
Modified Paths:
--------------
trunk/matplotlib/test/test_matplotlib/TestAxes.py
Modified: trunk/matplotlib/test/test_matplotlib/TestAxes.py
===================================================================
--- trunk/matplotlib/test/test_matplotlib/TestAxes.py 2009-08-29 18:14:28 UTC (rev 7585)
+++ trunk/matplotlib/test/test_matplotlib/TestAxes.py 2009-08-30 00:03:25 UTC (rev 7586)
@@ -2,7 +2,7 @@
"""The Axes unit-test class implementation."""
#=======================================================================
-from mplTest import *
+from mplTest import MplTestCase
#=======================================================================
# Add import modules below.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|