SF.net SVN: matplotlib:[6562] trunk/matplotlib/lib/matplotlib/lines.py
Revision: 6562 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6562&view=rev Author: leejjoon Date: 2008-12-11 17:45:45 + (Thu, 11 Dec 2008) Log Message: --- fixed typo in Line2D.set_marker doc. Modified Paths: -- trunk/matplotlib/lib/matplotlib/lines.py Modified: trunk/matplotlib/lib/matplotlib/lines.py === --- trunk/matplotlib/lib/matplotlib/lines.py2008-12-11 03:25:31 UTC (rev 6561) +++ trunk/matplotlib/lib/matplotlib/lines.py2008-12-11 17:45:45 UTC (rev 6562) @@ -651,9 +651,9 @@ """ Set the line marker -= == +== == marker description -= == +== == '.'point ','pixel 'o'circle @@ -687,7 +687,7 @@ 'None' nothing ' 'nothing '' nothing -= == +== == ACCEPTS: [ '+' | '*' | ',' | '.' | '1' | '2' | '3' | '4' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. -- SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[6563] trunk/matplotlib/lib/matplotlib/__init__.py
Revision: 6563 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6563&view=rev Author: astraw Date: 2008-12-11 18:29:30 + (Thu, 11 Dec 2008) Log Message: --- /matplotlib/__init__.py: catch OSError when calling subprocess. An OSError can occur when the user does not have the command in the path. Fixes an error reported by Nils Wagner. Modified Paths: -- trunk/matplotlib/lib/matplotlib/__init__.py Modified: trunk/matplotlib/lib/matplotlib/__init__.py === --- trunk/matplotlib/lib/matplotlib/__init__.py 2008-12-11 17:45:45 UTC (rev 6562) +++ trunk/matplotlib/lib/matplotlib/__init__.py 2008-12-11 18:29:30 UTC (rev 6563) @@ -262,7 +262,7 @@ line = s.stdout.readlines()[1] v = line.split()[-1] return v -except (IndexError, ValueError): +except (IndexError, ValueError, OSError): return None def checkdep_ghostscript(): @@ -275,7 +275,7 @@ stderr=subprocess.PIPE) v = s.stdout.read()[:-1] return v -except (IndexError, ValueError): +except (IndexError, ValueError, OSError): return None def checkdep_tex(): @@ -287,7 +287,7 @@ match = re.search(pattern, line) v = match.group(0) return v -except (IndexError, ValueError, AttributeError): +except (IndexError, ValueError, AttributeError, OSError): return None def checkdep_pdftops(): @@ -298,7 +298,7 @@ if 'version' in line: v = line.split()[-1] return v -except (IndexError, ValueError, UnboundLocalError): +except (IndexError, ValueError, UnboundLocalError, OSError): return None def compare_versions(a, b): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. -- SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[6564] trunk/matplotlib/lib/matplotlib
Revision: 6564 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6564&view=rev Author: leejjoon Date: 2008-12-11 18:59:00 + (Thu, 11 Dec 2008) Log Message: --- deleted some unused imports, functions. Modified Paths: -- trunk/matplotlib/lib/matplotlib/axis.py trunk/matplotlib/lib/matplotlib/backend_bases.py trunk/matplotlib/lib/matplotlib/backends/backend_agg.py trunk/matplotlib/lib/matplotlib/legend.py trunk/matplotlib/lib/matplotlib/patches.py trunk/matplotlib/lib/matplotlib/text.py Modified: trunk/matplotlib/lib/matplotlib/axis.py === --- trunk/matplotlib/lib/matplotlib/axis.py 2008-12-11 18:29:30 UTC (rev 6563) +++ trunk/matplotlib/lib/matplotlib/axis.py 2008-12-11 18:59:00 UTC (rev 6564) @@ -470,7 +470,7 @@ 'return the Interval instance for this axis view limits' return self.axes.viewLim.intervaly -def set_view_interval(self, vmin, vmax): +def set_view_interval(self, vmin, vmax, ignore = False): if ignore: self.axes.viewLim.intervaly = vmin, vmax else: Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py === --- trunk/matplotlib/lib/matplotlib/backend_bases.py2008-12-11 18:29:30 UTC (rev 6563) +++ trunk/matplotlib/lib/matplotlib/backend_bases.py2008-12-11 18:59:00 UTC (rev 6564) @@ -28,8 +28,6 @@ import numpy as np import matplotlib.cbook as cbook import matplotlib.colors as colors -import matplotlib._image as _image -import matplotlib.path as path import matplotlib.transforms as transforms import matplotlib.widgets as widgets from matplotlib import rcParams Modified: trunk/matplotlib/lib/matplotlib/backends/backend_agg.py === --- trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2008-12-11 18:29:30 UTC (rev 6563) +++ trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2008-12-11 18:59:00 UTC (rev 6564) @@ -21,23 +21,19 @@ * integrate screen dpi w/ ppi and text """ from __future__ import division -import os, sys, weakref import numpy as npy -import matplotlib from matplotlib import verbose, rcParams -from matplotlib._image import fromarray -from matplotlib._pylab_helpers import Gcf from matplotlib.backend_bases import RendererBase,\ - GraphicsContextBase, FigureManagerBase, FigureCanvasBase -from matplotlib.cbook import is_string_like, exception_to_str, maxdict + FigureManagerBase, FigureCanvasBase +from matplotlib.cbook import is_string_like, maxdict from matplotlib.figure import Figure from matplotlib.font_manager import findfont from matplotlib.ft2font import FT2Font, LOAD_FORCE_AUTOHINT from matplotlib.mathtext import MathTextParser from matplotlib.path import Path -from matplotlib.transforms import Affine2D, Bbox +from matplotlib.transforms import Bbox from _backend_agg import RendererAgg as _RendererAgg from matplotlib import _png Modified: trunk/matplotlib/lib/matplotlib/legend.py === --- trunk/matplotlib/lib/matplotlib/legend.py 2008-12-11 18:29:30 UTC (rev 6563) +++ trunk/matplotlib/lib/matplotlib/legend.py 2008-12-11 18:59:00 UTC (rev 6564) @@ -30,14 +30,10 @@ from matplotlib.cbook import is_string_like, iterable, silent_list, safezip from matplotlib.font_manager import FontProperties from matplotlib.lines import Line2D -from matplotlib.mlab import segments_intersect -from matplotlib.patches import Patch, Rectangle, Shadow, bbox_artist, FancyBboxPatch +from matplotlib.patches import Patch, Rectangle, Shadow, FancyBboxPatch from matplotlib.collections import LineCollection, RegularPolyCollection -from matplotlib.text import Text -from matplotlib.transforms import Affine2D, Bbox, BboxTransformTo +from matplotlib.transforms import Bbox -from itertools import cycle, izip - from matplotlib.offsetbox import HPacker, VPacker, TextArea, DrawingArea Modified: trunk/matplotlib/lib/matplotlib/patches.py === --- trunk/matplotlib/lib/matplotlib/patches.py 2008-12-11 18:29:30 UTC (rev 6563) +++ trunk/matplotlib/lib/matplotlib/patches.py 2008-12-11 18:59:00 UTC (rev 6564) @@ -9,7 +9,6 @@ import matplotlib.artist as artist import matplotlib.colors as colors import matplotlib.transforms as transforms -import matplotlib.artist as artist from matplotlib.path import Path # these are not available for the object inspector until after the @@ -2171,7 +2170,7 @@ from matplotlib.bezier import split_bezier_intersecting_with_closedpath from matplotlib.bezier import get_intersection, inside_circle, get_parallels from matplotlib.bezier import make_wedged_bezier2 -from matplotlib.bezier import split_path_inout, inside_circle, get_cos_sin +from matplotlib.bezier impo
SF.net SVN: matplotlib:[6565] trunk/matplotlib
Revision: 6565
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6565&view=rev
Author: jouni
Date: 2008-12-11 20:32:04 + (Thu, 11 Dec 2008)
Log Message:
---
Use subprocess.Popen instead of os.popen in dviread
(Windows problem reported by Jorgen Stenarson)
Modified Paths:
--
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/dviread.py
Modified: trunk/matplotlib/CHANGELOG
===
--- trunk/matplotlib/CHANGELOG 2008-12-11 18:59:00 UTC (rev 6564)
+++ trunk/matplotlib/CHANGELOG 2008-12-11 20:32:04 UTC (rev 6565)
@@ -1,3 +1,6 @@
+2008-12-11 Use subprocess.Popen instead of os.popen in dviread
+ (Windows problem reported by Jorgen Stenarson) - JKS
+
2008-12-10 Added Michael's font_manager fix and Jae-Joon's
figure/subplot fix. Bumped version number to 0.98.5 - JDH
Modified: trunk/matplotlib/lib/matplotlib/dviread.py
===
--- trunk/matplotlib/lib/matplotlib/dviread.py 2008-12-11 18:59:00 UTC (rev
6564)
+++ trunk/matplotlib/lib/matplotlib/dviread.py 2008-12-11 20:32:04 UTC (rev
6565)
@@ -21,8 +21,8 @@
import matplotlib
import matplotlib.cbook as mpl_cbook
import numpy as np
-import os
import struct
+import subprocess
_dvistate = mpl_cbook.Bunch(pre=0, outer=1, inpage=2, post_post=3, finale=4)
@@ -742,25 +742,15 @@
doesn't use kpathsea, so what do we do? (TODO)
"""
-cmd = 'kpsewhich '
+cmd = ['kpsewhich']
if format is not None:
-assert "'" not in format
-cmd += "--format='" + format + "' "
-assert "'" not in filename
-cmd += "'" + filename + "'"
-
+cmd += ['--format=' + format]
+cmd += [filename]
+
matplotlib.verbose.report('find_tex_file(%s): %s' \
% (filename,cmd), 'debug')
-pipe = os.popen(cmd, 'r')
-result = ""
-while True:
-data = _read_nointr(pipe)
-if data == "":
-break
-result += data
-pipe.close()
-result = result.rstrip()
-
+pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE)
+result = pipe.communicate()[0].rstrip()
matplotlib.verbose.report('find_tex_file result: %s' % result,
'debug')
return result
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[6566] trunk/matplotlib/lib/matplotlib/lines.py
Revision: 6566 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6566&view=rev Author: mdboom Date: 2008-12-11 20:44:12 + (Thu, 11 Dec 2008) Log Message: --- added some docs for linestyles and markers Modified Paths: -- trunk/matplotlib/lib/matplotlib/lines.py Modified: trunk/matplotlib/lib/matplotlib/lines.py === --- trunk/matplotlib/lib/matplotlib/lines.py2008-12-11 20:32:04 UTC (rev 6565) +++ trunk/matplotlib/lib/matplotlib/lines.py2008-12-11 20:44:12 UTC (rev 6566) @@ -690,6 +690,7 @@ == == + ACCEPTS: [ '+' | '*' | ',' | '.' | '1' | '2' | '3' | '4' | '<' | '>' | 'D' | 'H' | '^' | '_' | 'd' | 'h' | 'o' | 'p' | 's' | 'v' | 'x' | '|' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. -- SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[6567] trunk/matplotlib/lib/matplotlib/lines.py
Revision: 6567 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6567&view=rev Author: mdboom Date: 2008-12-11 20:44:23 + (Thu, 11 Dec 2008) Log Message: --- fixed typo in Line2D.set_marker doc. Modified Paths: -- trunk/matplotlib/lib/matplotlib/lines.py Modified: trunk/matplotlib/lib/matplotlib/lines.py === --- trunk/matplotlib/lib/matplotlib/lines.py2008-12-11 20:44:12 UTC (rev 6566) +++ trunk/matplotlib/lib/matplotlib/lines.py2008-12-11 20:44:23 UTC (rev 6567) @@ -690,7 +690,6 @@ == == - ACCEPTS: [ '+' | '*' | ',' | '.' | '1' | '2' | '3' | '4' | '<' | '>' | 'D' | 'H' | '^' | '_' | 'd' | 'h' | 'o' | 'p' | 's' | 'v' | 'x' | '|' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. -- SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[6568] trunk/matplotlib/lib/matplotlib/lines.py
Revision: 6568 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6568&view=rev Author: mdboom Date: 2008-12-11 20:44:32 + (Thu, 11 Dec 2008) Log Message: --- added some docs for linestyles and markers Modified Paths: -- trunk/matplotlib/lib/matplotlib/lines.py Modified: trunk/matplotlib/lib/matplotlib/lines.py === --- trunk/matplotlib/lib/matplotlib/lines.py2008-12-11 20:44:23 UTC (rev 6567) +++ trunk/matplotlib/lib/matplotlib/lines.py2008-12-11 20:44:32 UTC (rev 6568) @@ -690,6 +690,7 @@ == == + ACCEPTS: [ '+' | '*' | ',' | '.' | '1' | '2' | '3' | '4' | '<' | '>' | 'D' | 'H' | '^' | '_' | 'd' | 'h' | 'o' | 'p' | 's' | 'v' | 'x' | '|' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. -- SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[6569] trunk/matplotlib/lib/matplotlib/backend_bases .py
Revision: 6569 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6569&view=rev Author: mdboom Date: 2008-12-11 20:44:40 + (Thu, 11 Dec 2008) Log Message: --- Added a member for snapping Modified Paths: -- trunk/matplotlib/lib/matplotlib/backend_bases.py Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py === --- trunk/matplotlib/lib/matplotlib/backend_bases.py2008-12-11 20:44:32 UTC (rev 6568) +++ trunk/matplotlib/lib/matplotlib/backend_bases.py2008-12-11 20:44:40 UTC (rev 6569) @@ -436,6 +436,7 @@ self._rgb = (0.0, 0.0, 0.0) self._hatch = None self._url = None +self._snap = None def copy_properties(self, gc): 'Copy properties from gc to self' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. -- SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[6570] trunk/matplotlib
Revision: 6570
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6570&view=rev
Author: mdboom
Date: 2008-12-11 20:44:51 + (Thu, 11 Dec 2008)
Log Message:
---
Add snap parameter to gc object and pass it all the way to Agg.
Modified Paths:
--
trunk/matplotlib/lib/matplotlib/backend_bases.py
trunk/matplotlib/src/_backend_agg.cpp
trunk/matplotlib/src/_backend_agg.h
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===
--- trunk/matplotlib/lib/matplotlib/backend_bases.py2008-12-11 20:44:40 UTC
(rev 6569)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py2008-12-11 20:44:51 UTC
(rev 6570)
@@ -452,6 +452,7 @@
self._rgb = gc._rgb
self._hatch = gc._hatch
self._url = gc._url
+self._snap = gc._snap
def get_alpha(self):
"""
@@ -533,6 +534,19 @@
"""
return self._url
+def get_snap(self):
+"""
+returns the snap setting which may be:
+
+ * True: snap vertices to the nearest pixel center
+
+ * False: leave vertices as-is
+
+ * None: (auto) If the path contains only rectilinear line
+segments, round to the nearest pixel center
+"""
+return self._snap
+
def set_alpha(self, alpha):
"""
Set the alpha value used for blending - not supported on
@@ -639,6 +653,19 @@
"""
self._url = url
+def set_snap(self, snap):
+"""
+Sets the snap setting which may be:
+
+ * True: snap vertices to the nearest pixel center
+
+ * False: leave vertices as-is
+
+ * None: (auto) If the path contains only rectilinear line
+segments, round to the nearest pixel center
+"""
+self._snap = snap
+
def set_hatch(self, hatch):
"""
Sets the hatch style for filling
Modified: trunk/matplotlib/src/_backend_agg.cpp
===
--- trunk/matplotlib/src/_backend_agg.cpp 2008-12-11 20:44:40 UTC (rev
6569)
+++ trunk/matplotlib/src/_backend_agg.cpp 2008-12-11 20:44:51 UTC (rev
6570)
@@ -148,6 +148,7 @@
_set_dashes(gc);
_set_clip_rectangle(gc);
_set_clip_path(gc);
+ _set_snap(gc);
}
GCAgg::GCAgg(double dpi) :
@@ -254,6 +255,24 @@
}
}
+void
+GCAgg::_set_snap( const Py::Object& gc) {
+ //set the snap setting
+
+ _VERBOSE("GCAgg::_set_snap");
+
+ Py::Object method_obj = gc.getAttr("get_snap");
+ Py::Callable method(method_obj);
+ Py::Object py_snap = method.apply(Py::Tuple());
+ if (py_snap.isNone()) {
+snap = SNAP_AUTO;
+ } else if (py_snap.isTrue()) {
+snap = SNAP_TRUE;
+ } else {
+snap = SNAP_FALSE;
+ }
+}
+
const size_t
RendererAgg::PIXELS_PER_INCH(96);
@@ -336,43 +355,51 @@
}
template
-bool should_snap(Path& path, const agg::trans_affine& trans) {
+bool should_snap(const GCAgg& gc, Path& path, const agg::trans_affine& trans) {
// If this contains only straight horizontal or vertical lines, it should be
// quantized to the nearest pixels
double x0, y0, x1, y1;
unsigned code;
- if (path.total_vertices() > 15)
-return false;
+ switch (gc.snap) {
+ case GCAgg::SNAP_AUTO:
+if (path.total_vertices() > 15)
+ return false;
- code = path.vertex(&x0, &y0);
- if (code == agg::path_cmd_stop) {
-path.rewind(0);
-return false;
- }
- trans.transform(&x0, &y0);
+code = path.vertex(&x0, &y0);
+if (code == agg::path_cmd_stop) {
+ path.rewind(0);
+ return false;
+}
+trans.transform(&x0, &y0);
- while ((code = path.vertex(&x1, &y1)) != agg::path_cmd_stop) {
-trans.transform(&x1, &y1);
+while ((code = path.vertex(&x1, &y1)) != agg::path_cmd_stop) {
+ trans.transform(&x1, &y1);
-switch (code) {
-case agg::path_cmd_curve3:
-case agg::path_cmd_curve4:
- path.rewind(0);
- return false;
-case agg::path_cmd_line_to:
- if (!(fabs(x0 - x1) < 1e-4 || fabs(y0 - y1) < 1e-4)) {
- path.rewind(0);
- return false;
+ switch (code) {
+ case agg::path_cmd_curve3:
+ case agg::path_cmd_curve4:
+path.rewind(0);
+return false;
+ case agg::path_cmd_line_to:
+if (!(fabs(x0 - x1) < 1e-4 || fabs(y0 - y1) < 1e-4)) {
+ path.rewind(0);
+ return false;
+}
}
+
+ x0 = x1;
+ y0 = y1;
}
-x0 = x1;
-y0 = y1;
+path.rewind(0);
+return true;
+ case GCAgg::SNAP_FALSE:
+return false;
+ case GCAgg::SNAP_TRUE:
+return true;
}
-
- path.rewind(0);
- return true;
+ return false;
}
Py::Object
@@ -487,6 +514,8 @@
if (args.size() == 6)
face_obj = args[5];
+ GCAgg gc = GCAgg(gc_obj, dpi);
+
// Deal with the difference in y-axis direction
marker_trans *= agg::trans_affine_scaling(1.0, -1.0);
trans *= agg::trans_affine_scal
SF.net SVN: matplotlib:[6571] trunk/matplotlib
Revision: 6571 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6571&view=rev Author: mdboom Date: 2008-12-11 20:45:12 + (Thu, 11 Dec 2008) Log Message: --- More progress on programmatic snapping. Applied to markers (to prevent them from disappearing), and legend boxes. Modified Paths: -- trunk/matplotlib/lib/matplotlib/artist.py trunk/matplotlib/lib/matplotlib/legend.py trunk/matplotlib/lib/matplotlib/lines.py trunk/matplotlib/lib/matplotlib/patches.py trunk/matplotlib/src/_backend_agg.cpp Modified: trunk/matplotlib/lib/matplotlib/artist.py === --- trunk/matplotlib/lib/matplotlib/artist.py 2008-12-11 20:44:51 UTC (rev 6570) +++ trunk/matplotlib/lib/matplotlib/artist.py 2008-12-11 20:45:12 UTC (rev 6571) @@ -54,6 +54,7 @@ self._url = None self.x_isdata = True # False to avoid updating Axes.dataLim with x self.y_isdata = True # with y +self._snap = None def remove(self): """ @@ -329,6 +330,32 @@ """ self._url = url +def get_snap(self): +""" +Returns the snap setting which may be: + + * True: snap vertices to the nearest pixel center + + * False: leave vertices as-is + + * None: (auto) If the path contains only rectilinear line +segments, round to the nearest pixel center +""" +return self._snap + +def set_snap(self, snap): +""" +Sets the snap setting which may be: + + * True: snap vertices to the nearest pixel center + + * False: leave vertices as-is + + * None: (auto) If the path contains only rectilinear line +segments, round to the nearest pixel center +""" +self._snap = snap + def get_figure(self): """ Return the :class:`~matplotlib.figure.Figure` instance the Modified: trunk/matplotlib/lib/matplotlib/legend.py === --- trunk/matplotlib/lib/matplotlib/legend.py 2008-12-11 20:44:51 UTC (rev 6570) +++ trunk/matplotlib/lib/matplotlib/legend.py 2008-12-11 20:45:12 UTC (rev 6571) @@ -254,6 +254,7 @@ xy=(0.0, 0.0), width=1., height=1., facecolor='w', edgecolor='k', mutation_scale=self.fontsize, +snap=True ) # The width and height of the legendPatch will be set (in the Modified: trunk/matplotlib/lib/matplotlib/lines.py === --- trunk/matplotlib/lib/matplotlib/lines.py2008-12-11 20:44:51 UTC (rev 6570) +++ trunk/matplotlib/lib/matplotlib/lines.py2008-12-11 20:45:12 UTC (rev 6571) @@ -453,6 +453,7 @@ join = self._solidjoinstyle gc.set_joinstyle(join) gc.set_capstyle(cap) +gc.set_snap(self.get_snap()) funcname = self._lineStyles.get(self._linestyle, '_draw_nothing') if funcname != '_draw_nothing': @@ -845,6 +846,7 @@ def _draw_point(self, renderer, gc, path, path_trans): w = renderer.points_to_pixels(self._markersize) * \ self._point_size_reduction * 0.5 +gc.set_snap(renderer.points_to_pixels(self._markersize) > 3.0) rgbFace = self._get_rgb_face() transform = Affine2D().scale(w) renderer.draw_markers( @@ -854,6 +856,7 @@ _draw_pixel_transform = Affine2D().translate(-0.5, -0.5) def _draw_pixel(self, renderer, gc, path, path_trans): rgbFace = self._get_rgb_face() +gc.set_snap(False) renderer.draw_markers(gc, Path.unit_rectangle(), self._draw_pixel_transform, path, path_trans, rgbFace) @@ -861,6 +864,7 @@ def _draw_circle(self, renderer, gc, path, path_trans): w = renderer.points_to_pixels(self._markersize) * 0.5 +gc.set_snap(renderer.points_to_pixels(self._markersize) > 3.0) rgbFace = self._get_rgb_face() transform = Affine2D().scale(w, w) renderer.draw_markers( @@ -870,6 +874,7 @@ _triangle_path = Path([[0.0, 1.0], [-1.0, -1.0], [1.0, -1.0], [0.0, 1.0]]) def _draw_triangle_up(self, renderer, gc, path, path_trans): +gc.set_snap(renderer.points_to_pixels(self._markersize) >= 5.0) offset = 0.5*renderer.points_to_pixels(self._markersize) transform = Affine2D().scale(offset, offset) rgbFace = self._get_rgb_face() @@ -878,6 +883,7 @@ def _draw_triangle_down(self, renderer, gc, path, path_trans): +gc.set_snap(renderer.points_to_pixels(self._markersize) >= 5.0) offset = 0.5*renderer.points_to_pixels(self._markersize) transform = Affine2D().scale(offset, -offset) rgbFace = self._get_rgb_face() @@ -886,6 +892,7 @@ def _draw_triangl
SF.net SVN: matplotlib:[6572] trunk/matplotlib/lib/matplotlib/artist.py
Revision: 6572 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6572&view=rev Author: mdboom Date: 2008-12-11 20:45:23 + (Thu, 11 Dec 2008) Log Message: --- Add docstring clarification. Modified Paths: -- trunk/matplotlib/lib/matplotlib/artist.py Modified: trunk/matplotlib/lib/matplotlib/artist.py === --- trunk/matplotlib/lib/matplotlib/artist.py 2008-12-11 20:45:12 UTC (rev 6571) +++ trunk/matplotlib/lib/matplotlib/artist.py 2008-12-11 20:45:23 UTC (rev 6572) @@ -340,6 +340,8 @@ * None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center + +Only supported by the Agg backends. """ return self._snap @@ -353,6 +355,8 @@ * None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center + +Only supported by the Agg backends. """ self._snap = snap This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. -- SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[6573] trunk/matplotlib
Revision: 6573 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6573&view=rev Author: cmoad Date: 2008-12-12 03:04:53 + (Fri, 12 Dec 2008) Log Message: --- minor rev bump to 0.98.5 Modified Paths: -- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/__init__.py Modified: trunk/matplotlib/CHANGELOG === --- trunk/matplotlib/CHANGELOG 2008-12-11 20:45:23 UTC (rev 6572) +++ trunk/matplotlib/CHANGELOG 2008-12-12 03:04:53 UTC (rev 6573) @@ -1,3 +1,6 @@ += +2008-12-09 Released 0.98.5 at svn r6573 + 2008-12-11 Use subprocess.Popen instead of os.popen in dviread (Windows problem reported by Jorgen Stenarson) - JKS @@ -4,7 +7,8 @@ 2008-12-10 Added Michael's font_manager fix and Jae-Joon's figure/subplot fix. Bumped version number to 0.98.5 - JDH -= 2008-12-09 Released 0.98.4 at svn r6536 += +2008-12-09 Released 0.98.4 at svn r6536 2008-12-08 Added mdehoon's native macosx backend from sf patch 2179017 - JDH Modified: trunk/matplotlib/lib/matplotlib/__init__.py === --- trunk/matplotlib/lib/matplotlib/__init__.py 2008-12-11 20:45:23 UTC (rev 6572) +++ trunk/matplotlib/lib/matplotlib/__init__.py 2008-12-12 03:04:53 UTC (rev 6573) @@ -89,7 +89,7 @@ """ from __future__ import generators -__version__ = '0.98.5rc' +__version__ = '0.98.5' __revision__ = '$Revision$' __date__ = '$Date$' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. -- SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[6574] trunk/matplotlib/CHANGELOG
Revision: 6574 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6574&view=rev Author: cmoad Date: 2008-12-12 03:33:28 + (Fri, 12 Dec 2008) Log Message: --- fixed release date for 0.98.5 Modified Paths: -- trunk/matplotlib/CHANGELOG Modified: trunk/matplotlib/CHANGELOG === --- trunk/matplotlib/CHANGELOG 2008-12-12 03:04:53 UTC (rev 6573) +++ trunk/matplotlib/CHANGELOG 2008-12-12 03:33:28 UTC (rev 6574) @@ -1,5 +1,5 @@ = -2008-12-09 Released 0.98.5 at svn r6573 +2008-12-11 Released 0.98.5 at svn r6573 2008-12-11 Use subprocess.Popen instead of os.popen in dviread (Windows problem reported by Jorgen Stenarson) - JKS This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. -- SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
