SF.net SVN: matplotlib: [3829] trunk/matplotlib/lib/matplotlib/backends/ backend_pdf.py
Revision: 3829 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3829&view=rev Author: mdboom Date: 2007-09-11 05:46:27 -0700 (Tue, 11 Sep 2007) Log Message: --- Fix bug in PDF clip routine that resulted in the cryptic error message "There are too many arguments" in Adobe Acrobat. Modified Paths: -- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py === --- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2007-09-10 20:55:29 UTC (rev 3828) +++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2007-09-11 12:46:27 UTC (rev 3829) @@ -1833,7 +1833,7 @@ cmds.extend(self.pop()) # Unless we hit the right one, set the clip polygon if (self._cliprect, self._clippath) != (cliprect, clippath): -cmds.append(self.push()) +cmds.extend(self.push()) if self._cliprect != cliprect: cmds.extend([t for t in cliprect] + [Op.rectangle, Op.clip, Op.endpath]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [3830] branches/transforms
Revision: 3830
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3830&view=rev
Author: mdboom
Date: 2007-09-11 10:56:13 -0700 (Tue, 11 Sep 2007)
Log Message:
---
Just marking a milestone -- about to totally rip things up again.
Modified Paths:
--
branches/transforms/lib/matplotlib/affine.py
branches/transforms/lib/matplotlib/artist.py
branches/transforms/lib/matplotlib/axes.py
branches/transforms/lib/matplotlib/backend_bases.py
branches/transforms/lib/matplotlib/backends/backend_agg.py
branches/transforms/lib/matplotlib/backends/backend_tkagg.py
branches/transforms/lib/matplotlib/bbox.py
branches/transforms/lib/matplotlib/figure.py
branches/transforms/lib/matplotlib/lines.py
branches/transforms/lib/matplotlib/patches.py
branches/transforms/lib/matplotlib/text.py
branches/transforms/src/_backend_agg.cpp
Modified: branches/transforms/lib/matplotlib/affine.py
===
--- branches/transforms/lib/matplotlib/affine.py2007-09-11 12:46:27 UTC
(rev 3829)
+++ branches/transforms/lib/matplotlib/affine.py2007-09-11 17:56:13 UTC
(rev 3830)
@@ -58,10 +58,8 @@
self.mtx = matrix
def __repr__(self):
- return repr(self.mtx)
-
-def __str__(self):
- return str(self.mtx)
+ return "Affine2D(%s)" % repr(self.mtx)
+__str__ = __repr__
[EMAIL PROTECTED]
def from_values(a, b, c, d, e, f):
@@ -156,8 +154,8 @@
class BlendedAffine2D(Affine2D):
def __init__(self, x_transform, y_transform):
- assert isinstance(x_transform, Affine2D)
- assert isinstance(y_transform, Affine2D)
+# assert isinstance(x_transform, Affine2D)
+# assert isinstance(y_transform, Affine2D)
assert x_transform.is_separable()
assert y_transform.is_separable()
x_mtx = x_transform.mtx
Modified: branches/transforms/lib/matplotlib/artist.py
===
--- branches/transforms/lib/matplotlib/artist.py2007-09-11 12:46:27 UTC
(rev 3829)
+++ branches/transforms/lib/matplotlib/artist.py2007-09-11 17:56:13 UTC
(rev 3830)
@@ -138,6 +138,7 @@
ACCEPTS: a matplotlib.transform transformation instance
"""
+ print "set_transform", t
self._transform = t
self._transformSet = True
self.pchanged()
Modified: branches/transforms/lib/matplotlib/axes.py
===
--- branches/transforms/lib/matplotlib/axes.py 2007-09-11 12:46:27 UTC (rev
3829)
+++ branches/transforms/lib/matplotlib/axes.py 2007-09-11 17:56:13 UTC (rev
3830)
@@ -10,9 +10,9 @@
from matplotlib import artist as martist
from matplotlib import affine as maffine
-from matplotlib import bbox as mbbox
from matplotlib import agg
from matplotlib import axis as maxis
+from matplotlib import bbox as mbbox
from matplotlib import cbook
from matplotlib import collections as mcoll
from matplotlib import colors as mcolors
@@ -33,9 +33,9 @@
iterable = cbook.iterable
is_string_like = cbook.is_string_like
+Wrapper = cbook.Wrapper
-
def delete_masked_points(*args):
"""
Find all masked points in a set of arguments, and return
@@ -437,7 +437,6 @@
1 : 'log',
}
-
def __str__(self):
return
"Axes(%g,%g;%gx%g)"%(self._position[0].get(),self._position[1].get(),
self._position[2].get(),self._position[3].get())
@@ -535,7 +534,6 @@
if self.yaxis is not None:
self._ycid = self.yaxis.callbacks.connect('units finalize',
self.relim)
-
def get_window_extent(self, *args, **kwargs):
'get the axes bounding box in display space; args and kwargs are empty'
return self.bbox
@@ -655,16 +653,16 @@
bottom = 0.0
top = 1.0
-
-
self.viewLim = Bbox.from_lbrt(left, bottom, right, top)
-self.dataLim = Bbox.unit()
-
+ self.dataLim = Bbox.unit()
+
self.transData = maffine.get_bbox_transform(
self.viewLim, self.bbox)
self.transAxes = maffine.get_bbox_transform(
-Bbox.unit(), self.bbox)
+self.dataLim, self.bbox)
+ print "_set_lim_and_transforms", self.viewLim, self.transData,
self.dataLim, self.transAxes, self.bbox
+
# MGDTODO
# if self._sharex:
# self.transData.set_funcx(self._sharex.transData.get_funcx())
@@ -677,7 +675,8 @@
if original:
return self._originalPosition[:]
else:
-return [val.get() for val in self._position]
+return self._position[:]
+ # return [val.get() for val in self._position]
def set_position(self, pos, which='both'):
"""
@@ -699,10 +698,13 @@
# # Change values within self._position--don't replace
SF.net SVN: matplotlib: [3831] branches/transforms
Revision: 3831
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3831&view=rev
Author: mdboom
Date: 2007-09-11 10:57:47 -0700 (Tue, 11 Sep 2007)
Log Message:
---
Merged revisions 3824-3830 via svnmerge from
http://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib
r3825 | pkienzle | 2007-09-10 14:45:32 -0400 (Mon, 10 Sep 2007) | 1 line
Windows needs binary open flag for font files
r3827 | jouni | 2007-09-10 16:31:01 -0400 (Mon, 10 Sep 2007) | 2 lines
Better bounding boxes for pdf usetex, including descents.
r3828 | jouni | 2007-09-10 16:55:29 -0400 (Mon, 10 Sep 2007) | 2 lines
Bugfixes in pdf usetex
r3829 | mdboom | 2007-09-11 08:46:27 -0400 (Tue, 11 Sep 2007) | 3 lines
Fix bug in PDF clip routine that resulted in the cryptic error message
"There are too many arguments" in Adobe Acrobat.
Modified Paths:
--
branches/transforms/lib/matplotlib/backends/backend_pdf.py
branches/transforms/lib/matplotlib/dviread.py
branches/transforms/ttconv/pprdrv_tt.cpp
Property Changed:
branches/transforms/
Property changes on: branches/transforms
___
Name: svnmerge-integrated
- /trunk/matplotlib:1-3823
+ /trunk/matplotlib:1-3830
Modified: branches/transforms/lib/matplotlib/backends/backend_pdf.py
===
--- branches/transforms/lib/matplotlib/backends/backend_pdf.py 2007-09-11
17:56:13 UTC (rev 3830)
+++ branches/transforms/lib/matplotlib/backends/backend_pdf.py 2007-09-11
17:57:47 UTC (rev 3831)
@@ -519,12 +519,13 @@
ul_position, ul_thickness = font.get_ps_font_info()
if fontinfo.encodingfile is not None:
-differencesArray = [ Name(ch) for ch in
- dviread.Encoding(fontinfo.encodingfile) ]
+enc = dviread.Encoding(fontinfo.encodingfile)
+widths = [ afmdata.get_width_from_char_name(ch)
+ for ch in enc ]
+differencesArray = [ Name(ch) for ch in enc ]
differencesArray = [ 0 ] + differencesArray
firstchar = 0
lastchar = len(differencesArray) - 2
-widths = [ 100 for x in range(firstchar,lastchar+1) ] # XXX TODO
else:
widths = [ None for i in range(256) ]
for ch in range(256):
@@ -1434,7 +1435,7 @@
fontsize = prop.get_size_in_points()
dvifile = texmanager.make_dvi(s, fontsize)
dvi = dviread.Dvi(dvifile, 72)
-text, boxes = iter(dvi).next()
+page = iter(dvi).next()
dvi.close()
if angle == 0: # avoid rounding errors in common case
@@ -1448,7 +1449,7 @@
# Gather font information and do some setup for combining
# characters into strings.
oldfontnum, seq = None, []
-for x1, y1, fontnum, glyph, width in text:
+for x1, y1, fontnum, glyph, width in page.text:
if fontnum != oldfontnum:
texname, fontsize = dvi.fontinfo(fontnum)
fontinfo = self.tex_font_mapping(texname)
@@ -1462,8 +1463,8 @@
seq += [('end',)]
# Find consecutive text strings with constant x coordinate and
-# combine into one string (if needed kern would be less than
-# 0.1 points) or several strings interspersed with kerns.
+# combine into a sequence of strings and kerns, or just one
+# string (if any kerns would be less than 0.1 points).
i, curx = 0, 0
while i < len(seq)-1:
elt, next = seq[i:i+2]
@@ -1503,7 +1504,7 @@
boxgc = self.new_gc()
boxgc.copy_properties(gc)
boxgc.set_linewidth(0)
-for x1, y1, h, w in boxes:
+for x1, y1, h, w in page.boxes:
(x1, y1), (x2, y2), (x3, y3), (x4, y4) = \
mytrans(x1, y1), mytrans(x1+w, y1), \
mytrans(x1+w, y1+h), mytrans(x1, y1+h)
@@ -1653,14 +1654,9 @@
fontsize = prop.get_size_in_points()
dvifile = texmanager.make_dvi(s, fontsize)
dvi = dviread.Dvi(dvifile, 72)
-text, boxes = iter(dvi).next()
-# TODO: better bounding box -- this is not quite right:
-l = min(p[0] for p in text+boxes)
-r = max(p[0] for p in text+boxes) + fontsize
-b = min(p[1] for p in text+boxes)
-t = max(p[1] for p in text+boxes) + fontsize
-# (not to even mention finding the baseline)
-return r-l, t-b, t-b
+page = iter(dvi).next()
+dvi.close()
+return page.width, page.height, page.descent
if ismath:
w, h, d, glyphs, rects, used_characters = \
self.mathtext_parser.parse(s, 72, prop)
@@ -1837,7 +1833,7 @@
cmds.extend(self.pop()
SF.net SVN: matplotlib: [3832] trunk/matplotlib/MANIFEST
Revision: 3832 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3832&view=rev Author: dsdale Date: 2007-09-11 11:46:47 -0700 (Tue, 11 Sep 2007) Log Message: --- removed MANIFEST from revision control. It is generated by MANIFEST.in when building source distribution archives Removed Paths: - trunk/matplotlib/MANIFEST Deleted: trunk/matplotlib/MANIFEST === --- trunk/matplotlib/MANIFEST 2007-09-11 17:57:47 UTC (rev 3831) +++ trunk/matplotlib/MANIFEST 2007-09-11 18:46:47 UTC (rev 3832) @@ -1,1398 +0,0 @@ -API_CHANGES -CHANGELOG -INSTALL -INTERACTIVE -KNOWN_BUGS -MANIFEST.in -Makefile -NUMARRAY_ISSUES -README -TODO -__init__.py -makeswig.py -matplotlibrc.template -setup.cfg -setup.py -setupegg.py -setupext.py -CXX/Config.hxx -CXX/Exception.hxx -CXX/Extensions.hxx -CXX/IndirectPythonInterface.cxx -CXX/IndirectPythonInterface.hxx -CXX/Objects.hxx -CXX/Version.hxx -CXX/cxx_extensions.cxx -CXX/cxxextensions.c -CXX/cxxsupport.cxx -agg23/font_freetype/Makefile.am -agg23/font_freetype/agg_font_freetype.cpp -agg23/font_freetype/agg_font_freetype.h -agg23/font_win32_tt/agg_font_win32_tt.cpp -agg23/font_win32_tt/agg_font_win32_tt.h -agg23/include/Makefile.am -agg23/include/agg_alpha_mask_u8.h -agg23/include/agg_arc.h -agg23/include/agg_array.h -agg23/include/agg_arrowhead.h -agg23/include/agg_basics.h -agg23/include/agg_bezier_arc.h -agg23/include/agg_bitset_iterator.h -agg23/include/agg_bounding_rect.h -agg23/include/agg_bspline.h -agg23/include/agg_clip_liang_barsky.h -agg23/include/agg_color_gray.h -agg23/include/agg_color_rgba.h -agg23/include/agg_config.h -agg23/include/agg_conv_adaptor_vcgen.h -agg23/include/agg_conv_adaptor_vpgen.h -agg23/include/agg_conv_bspline.h -agg23/include/agg_conv_clip_polygon.h -agg23/include/agg_conv_clip_polyline.h -agg23/include/agg_conv_close_polygon.h -agg23/include/agg_conv_concat.h -agg23/include/agg_conv_contour.h -agg23/include/agg_conv_curve.h -agg23/include/agg_conv_dash.h -agg23/include/agg_conv_gpc.h -agg23/include/agg_conv_marker.h -agg23/include/agg_conv_marker_adaptor.h -agg23/include/agg_conv_segmentator.h -agg23/include/agg_conv_shorten_path.h -agg23/include/agg_conv_smooth_poly1.h -agg23/include/agg_conv_stroke.h -agg23/include/agg_conv_transform.h -agg23/include/agg_conv_unclose_polygon.h -agg23/include/agg_curves.h -agg23/include/agg_dda_line.h -agg23/include/agg_ellipse.h -agg23/include/agg_ellipse_bresenham.h -agg23/include/agg_embedded_raster_fonts.h -agg23/include/agg_font_cache_manager.h -agg23/include/agg_gamma_functions.h -agg23/include/agg_gamma_lut.h -agg23/include/agg_glyph_raster_bin.h -agg23/include/agg_gsv_text.h -agg23/include/agg_image_filters.h -agg23/include/agg_line_aa_basics.h -agg23/include/agg_math.h -agg23/include/agg_math_stroke.h -agg23/include/agg_path_storage.h -agg23/include/agg_path_storage_integer.h -agg23/include/agg_pattern_filters_rgba.h -agg23/include/agg_pixfmt_amask_adaptor.h -agg23/include/agg_pixfmt_gray.h -agg23/include/agg_pixfmt_rgb.h -agg23/include/agg_pixfmt_rgb_packed.h -agg23/include/agg_pixfmt_rgba.h -agg23/include/agg_rasterizer_outline.h -agg23/include/agg_rasterizer_outline_aa.h -agg23/include/agg_rasterizer_scanline_aa.h -agg23/include/agg_render_scanlines.h -agg23/include/agg_renderer_base.h -agg23/include/agg_renderer_markers.h -agg23/include/agg_renderer_mclip.h -agg23/include/agg_renderer_outline_aa.h -agg23/include/agg_renderer_outline_image.h -agg23/include/agg_renderer_primitives.h -agg23/include/agg_renderer_raster_text.h -agg23/include/agg_renderer_scanline.h -agg23/include/agg_rendering_buffer.h -agg23/include/agg_rendering_buffer_dynarow.h -agg23/include/agg_rounded_rect.h -agg23/include/agg_scanline_bin.h -agg23/include/agg_scanline_boolean_algebra.h -agg23/include/agg_scanline_p.h -agg23/include/agg_scanline_storage_aa.h -agg23/include/agg_scanline_storage_bin.h -agg23/include/agg_scanline_u.h -agg23/include/agg_shorten_path.h -agg23/include/agg_simul_eq.h -agg23/include/agg_span_allocator.h -agg23/include/agg_span_converter.h -agg23/include/agg_span_generator.h -agg23/include/agg_span_gouraud.h -agg23/include/agg_span_gouraud_gray.h -agg23/include/agg_span_gouraud_rgba.h -agg23/include/agg_span_gradient.h -agg23/include/agg_span_gradient_alpha.h -agg23/include/agg_span_image_filter.h -agg23/include/agg_span_image_filter_gray.h -agg23/include/agg_span_image_filter_rgb.h -agg23/include/agg_span_image_filter_rgba.h -agg23/include/agg_span_image_resample.h -agg23/include/agg_span_image_resample_gray.h -agg23/include/agg_span_image_resample_rgb.h -agg23/include/agg_span_image_resample_rgba.h -agg23/include/agg_span_interpolator_adaptor.h -agg23/include/agg_span_interpolator_linear.h -agg23/include/agg_span_interpolator_persp.h -agg23/include/agg_span_interpolator_trans.h -agg23/include/agg_span_pattern.h -agg23/include/agg_span_pattern_filter_gray.h -agg23/include/agg_span_pattern_filter_rgb.h -a
SF.net SVN: matplotlib: [3833] trunk/matplotlib/lib/matplotlib
Revision: 3833
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3833&view=rev
Author: jrevans
Date: 2007-09-11 12:40:27 -0700 (Tue, 11 Sep 2007)
Log Message:
---
Added the ability for the following in the various GUI backends:
>>> import pylab
>>> fig = pylab.figure()
>>> fig.canvas.set_window_title("My Plot Window")
Modified Paths:
--
trunk/matplotlib/lib/matplotlib/backend_bases.py
trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py
trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py
trunk/matplotlib/lib/matplotlib/backends/backend_qt.py
trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py
trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py
trunk/matplotlib/lib/matplotlib/backends/backend_wx.py
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===
--- trunk/matplotlib/lib/matplotlib/backend_bases.py2007-09-11 18:46:47 UTC
(rev 3832)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py2007-09-11 19:40:27 UTC
(rev 3833)
@@ -1205,6 +1205,14 @@
def get_default_filetype(self):
raise NotImplementedError
+def set_window_title(self, title):
+"""
+Set the title text of the window containing the figure. Note that
+this has no effect if there is no window (eg, a PS backend).
+"""
+if hasattr(self, "manager"):
+self.manager.set_window_title(title)
+
def switch_backends(self, FigureCanvasClass):
"""
instantiate an instance of FigureCanvasClass
@@ -1317,6 +1325,13 @@
"""
pass
+def set_window_title(self, title):
+"""
+Set the title text of the window containing the figure. Note that
+this has no effect if there is no window (eg, a PS backend).
+"""
+pass
+
# cursors
class Cursors: #namespace
HAND, POINTER, SELECT_REGION, MOVE = range(4)
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py
===
--- trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py 2007-09-11
18:46:47 UTC (rev 3832)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py 2007-09-11
19:40:27 UTC (rev 3833)
@@ -299,6 +299,9 @@
self.canvas.draw()
self.window.redraw()
+def set_window_title(self, title):
+self.window_title=title
+self.window.label(title)
class AxisMenu:
def __init__(self, toolbar):
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py
===
--- trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2007-09-11
18:46:47 UTC (rev 3832)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2007-09-11
19:40:27 UTC (rev 3833)
@@ -460,6 +460,8 @@
toolbar = None
return toolbar
+def set_window_title(self, title):
+self.window.set_title(title)
def resize(self, width, height):
'set the canvas size in pixels'
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt.py
===
--- trunk/matplotlib/lib/matplotlib/backends/backend_qt.py 2007-09-11
18:46:47 UTC (rev 3832)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qt.py 2007-09-11
19:40:27 UTC (rev 3833)
@@ -247,6 +247,9 @@
if DEBUG: print "destroy figure manager"
self.window.close(True)
+def set_window_title(self, title):
+self.window.setCaption(title)
+
class NavigationToolbar2QT( NavigationToolbar2, qt.QWidget ):
# list of toolitems to add to the toolbar, format is:
# text, tooltip_text, image_file, callback(str)
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py
===
--- trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py 2007-09-11
18:46:47 UTC (rev 3832)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py 2007-09-11
19:40:27 UTC (rev 3833)
@@ -249,6 +249,9 @@
if DEBUG: print "destroy figure manager"
self.window.close()
+def set_window_title(self, title):
+self.window.setWindowTitle(title)
+
class NavigationToolbar2QT( NavigationToolbar2, QtGui.QWidget ):
# list of toolitems to add to the toolbar, format is:
# text, tooltip_text, image_file, callback(str)
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py
===
--- trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py 2007-09-11
18:46:47 UTC (rev 3832)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py 2007-09-11
19:40:27 UTC (rev 3833)
@@ -349,6 +349,9 @@
pass
self.window = None
+def set_window_title(self, title):
+sel
