You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(115) |
Aug
(120) |
Sep
(137) |
Oct
(170) |
Nov
(461) |
Dec
(263) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(120) |
Feb
(74) |
Mar
(35) |
Apr
(74) |
May
(245) |
Jun
(356) |
Jul
(240) |
Aug
(115) |
Sep
(78) |
Oct
(225) |
Nov
(98) |
Dec
(271) |
2009 |
Jan
(132) |
Feb
(84) |
Mar
(74) |
Apr
(56) |
May
(90) |
Jun
(79) |
Jul
(83) |
Aug
(296) |
Sep
(214) |
Oct
(76) |
Nov
(82) |
Dec
(66) |
2010 |
Jan
(46) |
Feb
(58) |
Mar
(51) |
Apr
(77) |
May
(58) |
Jun
(126) |
Jul
(128) |
Aug
(64) |
Sep
(50) |
Oct
(44) |
Nov
(48) |
Dec
(54) |
2011 |
Jan
(68) |
Feb
(52) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <md...@us...> - 2010-06-11 18:17:59
|
Revision: 8415 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8415&view=rev Author: mdboom Date: 2010-06-11 18:17:52 +0000 (Fri, 11 Jun 2010) Log Message: ----------- Add a global rcParam 'path.snap' that, when False, turns off all pixel-snapping. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/artist.py trunk/matplotlib/lib/matplotlib/collections.py trunk/matplotlib/lib/matplotlib/config/mplconfig.py trunk/matplotlib/lib/matplotlib/config/rcsetup.py trunk/matplotlib/lib/matplotlib/patches.py trunk/matplotlib/lib/matplotlib/rcsetup.py trunk/matplotlib/matplotlibrc.template Modified: trunk/matplotlib/lib/matplotlib/artist.py =================================================================== --- trunk/matplotlib/lib/matplotlib/artist.py 2010-06-11 14:30:32 UTC (rev 8414) +++ trunk/matplotlib/lib/matplotlib/artist.py 2010-06-11 18:17:52 UTC (rev 8415) @@ -2,7 +2,7 @@ import re, warnings import matplotlib import matplotlib.cbook as cbook -from matplotlib import docstring +from matplotlib import docstring, rcParams from transforms import Bbox, IdentityTransform, TransformedBbox, TransformedPath from path import Path @@ -414,7 +414,10 @@ Only supported by the Agg and MacOSX backends. """ - return self._snap + if rcParams['path.snap']: + return self._snap + else: + return False def set_snap(self, snap): """ Modified: trunk/matplotlib/lib/matplotlib/collections.py =================================================================== --- trunk/matplotlib/lib/matplotlib/collections.py 2010-06-11 14:30:32 UTC (rev 8414) +++ trunk/matplotlib/lib/matplotlib/collections.py 2010-06-11 18:17:52 UTC (rev 8415) @@ -211,6 +211,7 @@ gc = renderer.new_gc() self._set_gc_clip(gc) + gc.set_snap(self.get_snap()) renderer.draw_path_collection( gc, transform.frozen(), paths, self.get_transforms(), Modified: trunk/matplotlib/lib/matplotlib/config/mplconfig.py =================================================================== --- trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2010-06-11 14:30:32 UTC (rev 8414) +++ trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2010-06-11 18:17:52 UTC (rev 8415) @@ -118,6 +118,7 @@ class path(TConfig): simplify = T.false simplify_threshold = T.float(1.0 / 9.0) + snap = T.true class patch(TConfig): linewidth = T.Float(1.0) @@ -444,7 +445,8 @@ # Path properties 'path.simplify' : (self.tconfig.path, 'simplify'), - 'path.simplify_threshold' : (self.tconfig.path, 'simplify_threshold') + 'path.simplify_threshold' : (self.tconfig.path, 'simplify_threshold'), + 'path.snap' : (self.tconfig.path, 'snap') } def __setitem__(self, key, val): Modified: trunk/matplotlib/lib/matplotlib/config/rcsetup.py =================================================================== --- trunk/matplotlib/lib/matplotlib/config/rcsetup.py 2010-06-11 14:30:32 UTC (rev 8414) +++ trunk/matplotlib/lib/matplotlib/config/rcsetup.py 2010-06-11 18:17:52 UTC (rev 8415) @@ -476,7 +476,8 @@ 'plugins.directory' : ['.matplotlib_plugins', str], # where plugin directory is locate 'path.simplify' : [True, validate_bool], - 'path.simplify_threshold' : [1.0 / 9.0, ValidateInterval(0.0, 1.0)] + 'path.simplify_threshold' : [1.0 / 9.0, ValidateInterval(0.0, 1.0)], + 'path.snap' : [True, validate_bool] } if __name__ == '__main__': Modified: trunk/matplotlib/lib/matplotlib/patches.py =================================================================== --- trunk/matplotlib/lib/matplotlib/patches.py 2010-06-11 14:30:32 UTC (rev 8414) +++ trunk/matplotlib/lib/matplotlib/patches.py 2010-06-11 18:17:52 UTC (rev 8415) @@ -356,7 +356,7 @@ self._set_gc_clip(gc) gc.set_capstyle('projecting') gc.set_url(self._url) - gc.set_snap(self._snap) + gc.set_snap(self.get_snap()) if (not self.fill or self._facecolor is None or (cbook.is_string_like(self._facecolor) and self._facecolor.lower()=='none')): @@ -3845,6 +3845,7 @@ gc.set_antialiased(self._antialiased) self._set_gc_clip(gc) gc.set_capstyle('round') + gc.set_snap(self.get_snap()) if (not self.fill or self._facecolor is None or (cbook.is_string_like(self._facecolor) and self._facecolor.lower()=='none')): Modified: trunk/matplotlib/lib/matplotlib/rcsetup.py =================================================================== --- trunk/matplotlib/lib/matplotlib/rcsetup.py 2010-06-11 14:30:32 UTC (rev 8414) +++ trunk/matplotlib/lib/matplotlib/rcsetup.py 2010-06-11 18:17:52 UTC (rev 8415) @@ -546,16 +546,17 @@ 'path.simplify' : [True, validate_bool], 'path.simplify_threshold' : [1.0 / 9.0, ValidateInterval(0.0, 1.0)], + 'path.snap' : [True, validate_bool], 'agg.path.chunksize' : [0, validate_int], # 0 to disable chunking; # recommend about 20000 to # enable. Experimental. # key-mappings - 'keymap.fullscreen' : ['f', validate_stringlist], + 'keymap.fullscreen' : ['f', validate_stringlist], 'keymap.home' : [['h', 'r', 'home'], validate_stringlist], 'keymap.back' : [['left', 'c', 'backspace'], validate_stringlist], 'keymap.forward' : [['right', 'v'], validate_stringlist], 'keymap.pan' : ['p', validate_stringlist], - 'keymap.zoom' : ['o', validate_stringlist], + 'keymap.zoom' : ['o', validate_stringlist], 'keymap.save' : ['s', validate_stringlist], 'keymap.grid' : ['g', validate_stringlist], 'keymap.yscale' : ['l', validate_stringlist], Modified: trunk/matplotlib/matplotlibrc.template =================================================================== --- trunk/matplotlib/matplotlibrc.template 2010-06-11 14:30:32 UTC (rev 8414) +++ trunk/matplotlib/matplotlibrc.template 2010-06-11 18:17:52 UTC (rev 8415) @@ -63,10 +63,10 @@ # circles. See # http://matplotlib.sourceforge.net/api/artist_api.html#module-matplotlib.patches # information on patch properties -#patch.linewidth : 1.0 # edge width in points -#patch.facecolor : blue -#patch.edgecolor : black -#patch.antialiased : True # render patches in antialised (no jaggies) +#patch.linewidth : 1.0 # edge width in points +#patch.facecolor : blue +#patch.edgecolor : black +#patch.antialiased : True # render patches in antialised (no jaggies) ### FONT # @@ -268,12 +268,12 @@ # The figure subplot parameters. All dimensions are fraction of the # figure width or height -#figure.subplot.left : 0.125 # the left side of the subplots of the figure -#figure.subplot.right : 0.9 # the right side of the subplots of the figure -#figure.subplot.bottom : 0.1 # the bottom of the subplots of the figure -#figure.subplot.top : 0.9 # the top of the subplots of the figure -#figure.subplot.wspace : 0.2 # the amount of width reserved for blank space between subplots -#figure.subplot.hspace : 0.2 # the amount of height reserved for white space between subplots +#figure.subplot.left : 0.125 # the left side of the subplots of the figure +#figure.subplot.right : 0.9 # the right side of the subplots of the figure +#figure.subplot.bottom : 0.1 # the bottom of the subplots of the figure +#figure.subplot.top : 0.9 # the top of the subplots of the figure +#figure.subplot.wspace : 0.2 # the amount of width reserved for blank space between subplots +#figure.subplot.hspace : 0.2 # the amount of height reserved for white space between subplots ### IMAGES #image.aspect : equal # equal | auto | a number @@ -297,12 +297,15 @@ # A value of 20000 is probably a good # starting point. ### SAVING FIGURES -#path.simplify : False # When True, simplify paths by removing "invisible" +#path.simplify : True # When True, simplify paths by removing "invisible" # points to reduce file size and increase rendering # speed #path.simplify_threshold : 0.1 # The threshold of similarity below which # vertices will be removed in the simplification # process +#path.snap : True # When True, rectilinear axis-aligned paths will be snapped to + # the nearest pixel when certain criteria are met. When False, + # paths will never be snapped. # the default savefig params can be different from the display params # Eg, you may want a higher resolution, or to make the figure @@ -362,12 +365,12 @@ #verbose.fileo : sys.stdout # a log filename, sys.stdout or sys.stderr # Event keys to interact with figures/plots via keyboard. -# Customize these settings according to your needs. -# Leave the field(s) empty if you don't need a key-map. (i.e., fullscreen : '') +# Customize these settings according to your needs. +# Leave the field(s) empty if you don't need a key-map. (i.e., fullscreen : '') -#keymap.fullscreen : f # toggling +#keymap.fullscreen : f # toggling #keymap.home : h, r, home # home or reset mnemonic -#keymap.back : left, c, backspace # forward / backward keys to enable +#keymap.back : left, c, backspace # forward / backward keys to enable #keymap.forward : right, v # left handed quick navigation #keymap.pan : p # pan mnemonic #keymap.zoom : o # zoom mnemonic This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2010-06-11 14:30:38
|
Revision: 8414 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8414&view=rev Author: mdboom Date: 2010-06-11 14:30:32 +0000 (Fri, 11 Jun 2010) Log Message: ----------- Take stroke width into account when quantizing rectilinear paths. Discovered by Jason Grout in the mailing list thread "Plots shifted up or to the left a pixel or so" Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/artist.py trunk/matplotlib/lib/matplotlib/path.py trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_dates/date_axhline.png trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_dates/date_axvline.png trunk/matplotlib/src/_backend_agg.cpp trunk/matplotlib/src/_macosx.m trunk/matplotlib/src/_path.cpp trunk/matplotlib/src/path_cleanup.cpp trunk/matplotlib/src/path_converters.h Modified: trunk/matplotlib/lib/matplotlib/artist.py =================================================================== --- trunk/matplotlib/lib/matplotlib/artist.py 2010-06-11 08:34:24 UTC (rev 8413) +++ trunk/matplotlib/lib/matplotlib/artist.py 2010-06-11 14:30:32 UTC (rev 8414) @@ -412,7 +412,7 @@ * None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center - Only supported by the Agg backends. + Only supported by the Agg and MacOSX backends. """ return self._snap @@ -427,7 +427,7 @@ * None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center - Only supported by the Agg backends. + Only supported by the Agg and MacOSX backends. """ self._snap = snap Modified: trunk/matplotlib/lib/matplotlib/path.py =================================================================== --- trunk/matplotlib/lib/matplotlib/path.py 2010-06-11 08:34:24 UTC (rev 8413) +++ trunk/matplotlib/lib/matplotlib/path.py 2010-06-11 14:30:32 UTC (rev 8414) @@ -188,7 +188,8 @@ return len(self.vertices) def iter_segments(self, transform=None, remove_nans=True, clip=None, - quantize=False, simplify=None, curves=True): + quantize=False, stroke_width=1.0, simplify=None, + curves=True): """ Iterates over all of the curve segments in the path. Each iteration returns a 2-tuple (*vertices*, *code*), where @@ -210,6 +211,9 @@ *quantize*: if None, auto-quantize. If True, force quantize, and if False, don't quantize. + *stroke_width*: the width of the stroke being drawn. Needed + as a hint for the quantizer. + *simplify*: if True, perform simplification, to remove vertices that do not affect the appearance of the path. If False, perform no simplification. If None, use the @@ -232,7 +236,7 @@ STOP = self.STOP vertices, codes = cleanup_path(self, transform, remove_nans, clip, - quantize, simplify, curves) + quantize, stroke_width, simplify, curves) len_vertices = len(vertices) i = 0 Modified: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_dates/date_axhline.png =================================================================== (Binary files differ) Modified: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_dates/date_axvline.png =================================================================== (Binary files differ) Modified: trunk/matplotlib/src/_backend_agg.cpp =================================================================== --- trunk/matplotlib/src/_backend_agg.cpp 2010-06-11 08:34:24 UTC (rev 8413) +++ trunk/matplotlib/src/_backend_agg.cpp 2010-06-11 14:30:32 UTC (rev 8414) @@ -535,14 +535,16 @@ transformed_path_t marker_path_transformed(marker_path, marker_trans); quantize_t marker_path_quantized(marker_path_transformed, gc.quantize_mode, - marker_path.total_vertices()); + marker_path.total_vertices(), + gc.linewidth); curve_t marker_path_curve(marker_path_quantized); PathIterator path(path_obj); transformed_path_t path_transformed(path, trans); quantize_t path_quantized(path_transformed, gc.quantize_mode, - path.total_vertices()); + path.total_vertices(), + 1.0); curve_t path_curve(path_quantized); path_curve.rewind(0); @@ -1106,7 +1108,7 @@ transformed_path_t tpath(path, trans); nan_removed_t nan_removed(tpath, true, path.has_curves()); clipped_t clipped(nan_removed, clip, width, height); - quantized_t quantized(clipped, gc.quantize_mode, path.total_vertices()); + quantized_t quantized(clipped, gc.quantize_mode, path.total_vertices(), gc.linewidth); simplify_t simplified(quantized, simplify, path.simplify_threshold()); curve_t curve(simplified); @@ -1273,7 +1275,8 @@ transformed_path_t tpath(path, trans); nan_removed_t nan_removed(tpath, true, has_curves); clipped_t clipped(nan_removed, do_clip, width, height); - quantized_t quantized(clipped, gc.quantize_mode, path.total_vertices()); + quantized_t quantized(clipped, gc.quantize_mode, + path.total_vertices(), gc.linewidth); if (has_curves) { quantized_curve_t curve(quantized); _draw_path(curve, has_clippath, face, gc); Modified: trunk/matplotlib/src/_macosx.m =================================================================== --- trunk/matplotlib/src/_macosx.m 2010-06-11 08:34:24 UTC (rev 8413) +++ trunk/matplotlib/src/_macosx.m 2010-06-11 14:30:32 UTC (rev 8414) @@ -289,6 +289,7 @@ 0, rect, QUANTIZE_FALSE, + 1.0, 0); Py_DECREF(transform); if (!iterator) @@ -662,6 +663,7 @@ 0, rect, QUANTIZE_AUTO, + 1.0, 0); Py_DECREF(transform); if (!iterator) @@ -889,6 +891,7 @@ 0, rect, QUANTIZE_AUTO, + CGContextGetLineWidth(self), rgbFace == NULL); if (!iterator) { @@ -966,6 +969,7 @@ 0, rect, QUANTIZE_AUTO, + CGContextGetLineWidth(self), 0); if (!iterator) { @@ -1042,6 +1046,7 @@ 0, rect, mode, + CGContextGetLineWidth(self), 0); if (!iterator) { @@ -1063,6 +1068,7 @@ 1, rect, QUANTIZE_TRUE, + 1.0, 0); if (!iterator) { @@ -1326,6 +1332,17 @@ 0, rect, mode, + 1.0, + /* Hardcoding stroke width to 1.0 + here, but for true + correctness, the paths would + need to be set up for each + different linewidth that may + be applied below. This + difference is very minute in + practice, so this hardcoding + is probably ok for now. -- + MGD */ 0); Py_DECREF(transform); Py_DECREF(path); @@ -1362,6 +1379,7 @@ 0, rect, QUANTIZE_AUTO, + 1.0, 0); if (!iterator) { @@ -1669,6 +1687,7 @@ 0, rect, QUANTIZE_AUTO, + 1.0, 0); if (iterator) { @@ -2654,6 +2673,7 @@ 0, rect, QUANTIZE_AUTO, + 1.0, 0); if (iterator) { Modified: trunk/matplotlib/src/_path.cpp =================================================================== --- trunk/matplotlib/src/_path.cpp 2010-06-11 08:34:24 UTC (rev 8413) +++ trunk/matplotlib/src/_path.cpp 2010-06-11 14:30:32 UTC (rev 8414) @@ -1228,8 +1228,9 @@ void _cleanup_path(PathIterator& path, const agg::trans_affine& trans, bool remove_nans, bool do_clip, const agg::rect_base<double>& rect, - e_quantize_mode quantize_mode, bool do_simplify, - bool return_curves, std::vector<double>& vertices, + e_quantize_mode quantize_mode, double stroke_width, + bool do_simplify, bool return_curves, + std::vector<double>& vertices, std::vector<npy_uint8>& codes) { typedef agg::conv_transform<PathIterator> transformed_path_t; typedef PathNanRemover<transformed_path_t> nan_removal_t; @@ -1241,7 +1242,7 @@ transformed_path_t tpath(path, trans); nan_removal_t nan_removed(tpath, remove_nans, path.has_curves()); clipped_t clipped(nan_removed, do_clip, rect); - quantized_t quantized(clipped, quantize_mode, path.total_vertices()); + quantized_t quantized(clipped, quantize_mode, path.total_vertices(), stroke_width); simplify_t simplified(quantized, do_simplify, path.simplify_threshold()); vertices.reserve(path.total_vertices() * 2); @@ -1260,7 +1261,7 @@ Py::Object _path_module::cleanup_path(const Py::Tuple& args) { - args.verify_length(7); + args.verify_length(8); PathIterator path(args[0]); agg::trans_affine trans = py_to_agg_transformation_matrix(args[1].ptr(), false); @@ -1300,8 +1301,10 @@ quantize_mode = QUANTIZE_FALSE; } + double stroke_width = Py::Float(args[5]); + bool simplify; - Py::Object simplify_obj = args[5]; + Py::Object simplify_obj = args[6]; if (simplify_obj.isNone()) { simplify = path.should_simplify(); @@ -1311,13 +1314,13 @@ simplify = simplify_obj.isTrue(); } - bool return_curves = args[6].isTrue(); + bool return_curves = args[7].isTrue(); std::vector<double> vertices; std::vector<npy_uint8> codes; _cleanup_path(path, trans, remove_nans, do_clip, clip_rect, quantize_mode, - simplify, return_curves, vertices, codes); + stroke_width, simplify, return_curves, vertices, codes); npy_intp length = codes.size(); npy_intp dims[] = { length, 2, 0 }; Modified: trunk/matplotlib/src/path_cleanup.cpp =================================================================== --- trunk/matplotlib/src/path_cleanup.cpp 2010-06-11 08:34:24 UTC (rev 8413) +++ trunk/matplotlib/src/path_cleanup.cpp 2010-06-11 14:30:32 UTC (rev 8414) @@ -28,14 +28,16 @@ PathCleanupIterator(PyObject* path, agg::trans_affine trans, bool remove_nans, bool do_clip, const agg::rect_base<double>& rect, - e_quantize_mode quantize_mode, bool do_simplify) : + e_quantize_mode quantize_mode, double stroke_width, + bool do_simplify) : m_path_obj(path, true), m_path_iter(m_path_obj), m_transform(trans), m_transformed(m_path_iter, m_transform), m_nan_removed(m_transformed, remove_nans, m_path_iter.has_curves()), m_clipped(m_nan_removed, do_clip, rect), - m_quantized(m_clipped, quantize_mode, m_path_iter.total_vertices()), + m_quantized(m_clipped, quantize_mode, m_path_iter.total_vertices(), + stroke_width), m_simplify(m_quantized, do_simplify && m_path_iter.should_simplify(), m_path_iter.simplify_threshold()) { @@ -53,14 +55,15 @@ void* get_path_iterator( PyObject* path, PyObject* trans, int remove_nans, int do_clip, - double rect[4], e_quantize_mode quantize_mode, int do_simplify) + double rect[4], e_quantize_mode quantize_mode, double stroke_width, + int do_simplify) { agg::trans_affine agg_trans = py_to_agg_transformation_matrix(trans, false); agg::rect_base<double> clip_rect(rect[0], rect[1], rect[2], rect[3]); PathCleanupIterator* pipeline = new PathCleanupIterator( path, agg_trans, remove_nans != 0, do_clip != 0, - clip_rect, quantize_mode, do_simplify != 0); + clip_rect, quantize_mode, stroke_width, do_simplify != 0); return (void*)pipeline; } Modified: trunk/matplotlib/src/path_converters.h =================================================================== --- trunk/matplotlib/src/path_converters.h 2010-06-11 08:34:24 UTC (rev 8413) +++ trunk/matplotlib/src/path_converters.h 2010-06-11 14:30:32 UTC (rev 8414) @@ -378,6 +378,7 @@ private: VertexSource* m_source; bool m_quantize; + double m_quantize_value; static bool should_quantize(VertexSource& path, e_quantize_mode quantize_mode, @@ -436,10 +437,17 @@ - QUANTIZE_FALSE: No quantization */ PathQuantizer(VertexSource& source, e_quantize_mode quantize_mode, - unsigned total_vertices=15) : + unsigned total_vertices=15, double stroke_width=0.0) : m_source(&source) { m_quantize = should_quantize(source, quantize_mode, total_vertices); + + if (m_quantize) + { + int odd_even = (int)mpl_round(stroke_width) % 2; + m_quantize_value = (odd_even) ? 0.5 : 0.0; + } + source.rewind(0); } @@ -454,8 +462,8 @@ code = m_source->vertex(x, y); if (m_quantize && agg::is_vertex(code)) { - *x = mpl_round(*x) + 0.5; - *y = mpl_round(*y) + 0.5; + *x = mpl_round(*x) + m_quantize_value; + *y = mpl_round(*y) + m_quantize_value; } return code; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2010-06-11 08:34:30
|
Revision: 8413 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8413&view=rev Author: efiring Date: 2010-06-11 08:34:24 +0000 (Fri, 11 Jun 2010) Log Message: ----------- [3013559] cbook.get_sample_data: open image file in binary mode. Patch by C. Gohlke. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/cbook.py Modified: trunk/matplotlib/lib/matplotlib/cbook.py =================================================================== --- trunk/matplotlib/lib/matplotlib/cbook.py 2010-06-11 08:09:25 UTC (rev 8412) +++ trunk/matplotlib/lib/matplotlib/cbook.py 2010-06-11 08:34:24 UTC (rev 8413) @@ -619,7 +619,11 @@ fname = cached[0] if asfileobj: - return file(fname) + if os.path.splitext(fname)[-1].lower() in ('.csv', '.xrc', '.txt'): + mode = 'r' + else: + mode = 'rb' + return open(fname, mode) else: return fname This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2010-06-11 08:09:31
|
Revision: 8412 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8412&view=rev Author: efiring Date: 2010-06-11 08:09:25 +0000 (Fri, 11 Jun 2010) Log Message: ----------- [3014606] fix set_alpha in backend_cairo Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backends/backend_cairo.py Modified: trunk/matplotlib/lib/matplotlib/backends/backend_cairo.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_cairo.py 2010-06-11 07:23:54 UTC (rev 8411) +++ trunk/matplotlib/lib/matplotlib/backends/backend_cairo.py 2010-06-11 08:09:25 UTC (rev 8412) @@ -140,8 +140,8 @@ def draw_path(self, gc, path, transform, rgbFace=None): - if len(path.vertices) > 18980: - raise ValueError("The Cairo backend can not draw paths longer than 18980 points.") + if len(path.vertices) > 18980: + raise ValueError("The Cairo backend can not draw paths longer than 18980 points.") ctx = gc.ctx @@ -315,9 +315,10 @@ def set_alpha(self, alpha): - self._alpha = alpha + GraphicsContextBase.set_alpha(self, alpha) + _alpha = self.get_alpha() rgb = self._rgb - self.ctx.set_source_rgba (rgb[0], rgb[1], rgb[2], alpha) + self.ctx.set_source_rgba (rgb[0], rgb[1], rgb[2], _alpha) #def set_antialiased(self, b): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2010-06-11 07:24:02
|
Revision: 8411 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8411&view=rev Author: efiring Date: 2010-06-11 07:23:54 +0000 (Fri, 11 Jun 2010) Log Message: ----------- backend_wx: remove ancient comment string Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backends/backend_wx.py Modified: trunk/matplotlib/lib/matplotlib/backends/backend_wx.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2010-06-10 18:43:34 UTC (rev 8410) +++ trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2010-06-11 07:23:54 UTC (rev 8411) @@ -17,81 +17,7 @@ should be included with this source code. """ -""" -KNOWN BUGS - - - Mousewheel (on Windows) only works after menu button has been pressed - at least once - - Mousewheel on Linux (wxGTK linked against GTK 1.2) does not work at all - - Vertical text renders horizontally if you use a non TrueType font - on Windows. This is a known wxPython issue. Work-around is to ensure - that you use a TrueType font. - - Pcolor demo puts chart slightly outside bounding box (approx 1-2 pixels - to the bottom left) - - Outputting to bitmap more than 300dpi results in some text being incorrectly - scaled. Seems to be a wxPython bug on Windows or font point sizes > 60, as - font size is correctly calculated. - - Performance poorer than for previous direct rendering version - - TIFF output not supported on wxGTK. This is a wxGTK issue - - Text is not anti-aliased on wxGTK. This is probably a platform - configuration issue. - - If a second call is made to show(), no figure is generated (#866965) -Not implemented: - - Printing - -Fixed this release: - - Bug #866967: Interactive operation issues fixed [JDH] - - Bug #866969: Dynamic update does not function with backend_wx [JOD] - -Examples which work on this release: - --------------------------------------------------------------- - | Windows 2000 | Linux | - | wxPython 2.3.3 | wxPython 2.4.2.4 | - --------------------------------------------------------------| - - alignment_test.py | TBE | OK | - - arctest.py | TBE | (3) | - - axes_demo.py | OK | OK | - - axes_props.py | OK | OK | - - bar_stacked.py | TBE | OK | - - barchart_demo.py | OK | OK | - - color_demo.py | OK | OK | - - csd_demo.py | OK | OK | - - dynamic_demo.py | N/A | N/A | - - dynamic_demo_wx.py | TBE | OK | - - embedding_in_gtk.py | N/A | N/A | - - embedding_in_wx.py | OK | OK | - - errorbar_demo.py | OK | OK | - - figtext.py | OK | OK | - - histogram_demo.py | OK | OK | - - interactive.py | N/A (2) | N/A (2) | - - interactive2.py | N/A (2) | N/A (2) | - - legend_demo.py | OK | OK | - - legend_demo2.py | OK | OK | - - line_styles.py | OK | OK | - - log_demo.py | OK | OK | - - logo.py | OK | OK | - - mpl_with_glade.py | N/A (2) | N/A (2) | - - mri_demo.py | OK | OK | - - mri_demo_with_eeg.py | OK | OK | - - multiple_figs_demo.py | OK | OK | - - pcolor_demo.py | OK | OK | - - psd_demo.py | OK | OK | - - scatter_demo.py | OK | OK | - - scatter_demo2.py | OK | OK | - - simple_plot.py | OK | OK | - - stock_demo.py | OK | OK | - - subplot_demo.py | OK | OK | - - system_monitor.py | N/A (2) | N/A (2) | - - text_handles.py | OK | OK | - - text_themes.py | OK | OK | - - vline_demo.py | OK | OK | - --------------------------------------------------------------- - - (2) - Script uses GTK-specific features - cannot not run, - but wxPython equivalent should be written. - (3) - Clipping seems to be broken. -""" - cvs_id = '$Id$' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2010-06-10 18:43:41
|
Revision: 8410 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8410&view=rev Author: jswhit Date: 2010-06-10 18:43:34 +0000 (Thu, 10 Jun 2010) Log Message: ----------- added ploticos.py example for plotting triangular grids. Modified Paths: -------------- trunk/toolkits/basemap/Changelog trunk/toolkits/basemap/MANIFEST.in trunk/toolkits/basemap/examples/README trunk/toolkits/basemap/examples/ploticos.py Modified: trunk/toolkits/basemap/Changelog =================================================================== --- trunk/toolkits/basemap/Changelog 2010-06-10 18:25:19 UTC (rev 8409) +++ trunk/toolkits/basemap/Changelog 2010-06-10 18:43:34 UTC (rev 8410) @@ -4,12 +4,12 @@ * add support for plotting on unstructured grids using keyword 'tri' in pcolor,contour,contourf methods (which then forward to tripcolor, tricontour, tricontourf axes - methods). + methods). examples/ploticos.py added. * let continents that fill the whole map be filled. * added option for cubic spline interpolation in interp function (order=3) using scipy.ndimage. * added "near-sided perspective" projection for a satellite - view at an arbitrary altitude. + view at an arbitrary altitude. * patch from Stephane Raynaud to pass format string to drawmapscale, and allow units='m'. * updated proj4 source to version 4.7.0, pyproj to 1.8.6. Modified: trunk/toolkits/basemap/MANIFEST.in =================================================================== --- trunk/toolkits/basemap/MANIFEST.in 2010-06-10 18:25:19 UTC (rev 8409) +++ trunk/toolkits/basemap/MANIFEST.in 2010-06-10 18:43:34 UTC (rev 8410) @@ -20,6 +20,7 @@ include examples/simpletest_oo.py include examples/randompoints.py include examples/daynight.py +include examples/ploticos.py include examples/test.py include examples/us_25m.dem include examples/testgdal.py Modified: trunk/toolkits/basemap/examples/README =================================================================== --- trunk/toolkits/basemap/examples/README 2010-06-10 18:25:19 UTC (rev 8409) +++ trunk/toolkits/basemap/examples/README 2010-06-10 18:43:34 UTC (rev 8410) @@ -136,3 +136,5 @@ (requires scipy). daynight.py shows how to shade the regions of a map where the sun has set. + +ploticos.py demonstrates plotting on unstructured grids. Modified: trunk/toolkits/basemap/examples/ploticos.py =================================================================== --- trunk/toolkits/basemap/examples/ploticos.py 2010-06-10 18:25:19 UTC (rev 8409) +++ trunk/toolkits/basemap/examples/ploticos.py 2010-06-10 18:43:34 UTC (rev 8410) @@ -16,4 +16,5 @@ map.pcolor(x,y,z,tri=True,shading='faceted',vmin=0,vmax=3000) #map.contourf(x,y,z,np.arange(0,3000,150),tri=True) #map.contour(x,y,z,np.arange(0,3000,150),tri=True) +plt.title('pcolor plot on a global icosahedral mesh') plt.show() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2010-06-10 18:25:25
|
Revision: 8409 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8409&view=rev Author: jswhit Date: 2010-06-10 18:25:19 +0000 (Thu, 10 Jun 2010) Log Message: ----------- don't force adjustable='box' for AxesGrid compatability. Added example that uses AxesGrid. Modified Paths: -------------- trunk/toolkits/basemap/Changelog trunk/toolkits/basemap/MANIFEST.in trunk/toolkits/basemap/examples/README trunk/toolkits/basemap/examples/run_all.py trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py Added Paths: ----------- trunk/toolkits/basemap/examples/fcstmaps_axesgrid.py Modified: trunk/toolkits/basemap/Changelog =================================================================== --- trunk/toolkits/basemap/Changelog 2010-06-10 17:48:10 UTC (rev 8408) +++ trunk/toolkits/basemap/Changelog 2010-06-10 18:25:19 UTC (rev 8409) @@ -1,4 +1,6 @@ version 0.99.5 (not yet released) + * don't force adjustable='box' so Basemap is compatible + with AxesGrid. Added fcstmaps_axesgrid.py example. * add support for plotting on unstructured grids using keyword 'tri' in pcolor,contour,contourf methods (which then forward to tripcolor, tricontour, tricontourf axes Modified: trunk/toolkits/basemap/MANIFEST.in =================================================================== --- trunk/toolkits/basemap/MANIFEST.in 2010-06-10 17:48:10 UTC (rev 8408) +++ trunk/toolkits/basemap/MANIFEST.in 2010-06-10 18:25:19 UTC (rev 8409) @@ -53,6 +53,7 @@ include examples/geos_demo_3.py include examples/200706041200-msg-ch01-SAfrica.jpg include examples/fcstmaps.py +include examples/fcstmaps_axesgrid.py include examples/plotsst.py include examples/wiki_example.py include examples/fillstates.py Modified: trunk/toolkits/basemap/examples/README =================================================================== --- trunk/toolkits/basemap/examples/README 2010-06-10 17:48:10 UTC (rev 8408) +++ trunk/toolkits/basemap/examples/README 2010-06-10 18:25:19 UTC (rev 8409) @@ -63,6 +63,9 @@ fcstmaps.py is a sample multi-panel plot that accesses data over http using the dap module. An internet connection is required. +fcstmaps_axesgrid.py is the same as above, but illustrates the use +of the AxesGrid toolkit. + plotsst.py also uses dap client to access the data, and also illustrates how the NetCDFFile function deals with missing values. Added: trunk/toolkits/basemap/examples/fcstmaps_axesgrid.py =================================================================== --- trunk/toolkits/basemap/examples/fcstmaps_axesgrid.py (rev 0) +++ trunk/toolkits/basemap/examples/fcstmaps_axesgrid.py 2010-06-10 18:25:19 UTC (rev 8409) @@ -0,0 +1,102 @@ +# this example reads today's numerical weather forecasts +# from the NOAA OpenDAP servers and makes a multi-panel plot. +# This version demonstrates the use of the AxesGrid toolkit. +import numpy as np +import matplotlib.pyplot as plt +import sys +import numpy.ma as ma +import datetime +from mpl_toolkits.basemap import Basemap, NetCDFFile, addcyclic, num2date +from mpl_toolkits.axes_grid1 import AxesGrid + + +# today's date is default. +if len(sys.argv) > 1: + YYYYMMDD = sys.argv[1] +else: + YYYYMMDD = datetime.datetime.today().strftime('%Y%m%d') + +# set OpenDAP server URL. +URLbase="http://nomad1.ncep.noaa.gov:9090/dods/mrf/mrf" +URL=URLbase+YYYYMMDD+'/mrf'+YYYYMMDD +print URL+'\n' +try: + data = NetCDFFile(URL) +except: + msg = """ +opendap server not providing the requested data. +Try another date by providing YYYYMMDD on command line.""" + raise IOError, msg + + +# read lats,lons,times. + +print data.variables.keys() +latitudes = data.variables['lat'] +longitudes = data.variables['lon'] +fcsttimes = data.variables['time'] +times = fcsttimes[0:6] # first 6 forecast times. +ntimes = len(times) +# convert times for datetime instances. +fdates = num2date(times,units=fcsttimes.units,calendar='standard') +# make a list of YYYYMMDDHH strings. +verifdates = [fdate.strftime('%Y%m%d%H') for fdate in fdates] +# convert times to forecast hours. +fcsthrs = [] +for fdate in fdates: + fdiff = fdate-fdates[0] + fcsthrs.append(fdiff.days*24. + fdiff.seconds/3600.) +print fcsthrs +print verifdates +lats = latitudes[:] +nlats = len(lats) +lons1 = longitudes[:] +nlons = len(lons1) + +# unpack 2-meter temp forecast data. + +t2mvar = data.variables['tmp2m'] +t2min = t2mvar[0:ntimes,:,:] +t2m = np.zeros((ntimes,nlats,nlons+1),t2min.dtype) + +# create figure, set up AxesGrid. +fig=plt.figure(figsize=(6,8)) +grid = AxesGrid(fig, [0.05,0.01,0.9,0.9], + nrows_ncols=(3, 2), + axes_pad=0.25, + cbar_mode='single', + cbar_pad=0.3, + cbar_size=0.1, + cbar_location='top', + share_all=True, + ) + +# create Basemap instance for Orthographic projection. +m = Basemap(lon_0=-90,lat_0=60,projection='ortho') +# add wrap-around point in longitude. +for nt in range(ntimes): + t2m[nt,:,:], lons = addcyclic(t2min[nt,:,:], lons1) +# convert to celsius. +t2m = t2m-273.15 +# contour levels +clevs = np.arange(-30,30.1,2.) +lons, lats = np.meshgrid(lons, lats) +x, y = m(lons, lats) +# make subplots. +for nt,fcsthr in enumerate(fcsthrs): + ax = grid[nt] + m.ax = ax + cs = m.contourf(x,y,t2m[nt,:,:],clevs,cmap=plt.cm.jet,extend='both') + m.drawcoastlines(linewidth=0.5) + m.drawcountries() + m.drawparallels(np.arange(-80,81,20)) + m.drawmeridians(np.arange(0,360,20)) + # panel title + ax.set_title('%d-h forecast valid '%fcsthr+verifdates[nt],fontsize=9) +# figure title +plt.figtext(0.5,0.95, + u"2-m temp (\N{DEGREE SIGN}C) forecasts from %s"%verifdates[0], + horizontalalignment='center',fontsize=14) +# a single colorbar. +cbar = fig.colorbar(cs, cax=grid.cbar_axes[0], orientation='horizontal') +plt.show() Modified: trunk/toolkits/basemap/examples/run_all.py =================================================================== --- trunk/toolkits/basemap/examples/run_all.py 2010-06-10 17:48:10 UTC (rev 8408) +++ trunk/toolkits/basemap/examples/run_all.py 2010-06-10 18:25:19 UTC (rev 8409) @@ -2,6 +2,7 @@ test_files = glob.glob('*.py') test_files.remove('run_all.py') test_files.remove('fcstmaps.py') +test_files.remove('fcstmaps_axesgrid.py') test_files.remove('testgdal.py') test_files.remove('pnganim.py') test_files.remove('geos_demo_2.py') Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py =================================================================== --- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2010-06-10 17:48:10 UTC (rev 8408) +++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2010-06-10 18:25:19 UTC (rev 8409) @@ -2628,9 +2628,9 @@ # plot is re-centered in bounding rectangle. # (anchor instance var determines where plot is placed) if self.fix_aspect: - ax.set_aspect('equal',adjustable='box',anchor=self.anchor) + ax.set_aspect('equal',anchor=self.anchor) else: - ax.set_aspect('auto',adjustable='box',anchor=self.anchor) + ax.set_aspect('auto',anchor=self.anchor) # make sure axis ticks are turned off. if self.noticks: ax.set_xticks([]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2010-06-10 17:48:17
|
Revision: 8408 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8408&view=rev Author: mdboom Date: 2010-06-10 17:48:10 +0000 (Thu, 10 Jun 2010) Log Message: ----------- Update to the 1.0 STIX fonts. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/font_manager.py trunk/matplotlib/lib/matplotlib/mathtext.py trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/LICENSE_STIX trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXGeneral.ttf trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXGeneralBol.ttf trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXGeneralBolIta.ttf trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXGeneralItalic.ttf trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXNonUni.ttf trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXNonUniBol.ttf trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXNonUniBolIta.ttf trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXNonUniIta.ttf trunk/matplotlib/setup.py Added Paths: ----------- trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSizFiveSymReg.ttf trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSizFourSymBol.ttf trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSizFourSymReg.ttf trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSizOneSymBol.ttf trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSizOneSymReg.ttf trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSizThreeSymBol.ttf trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSizThreeSymReg.ttf trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSizTwoSymBol.ttf trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSizTwoSymReg.ttf Removed Paths: ------------- trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSiz1Sym.ttf trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSiz1SymBol.ttf trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSiz2Sym.ttf trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSiz2SymBol.ttf trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSiz3Sym.ttf trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSiz3SymBol.ttf trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSiz4Sym.ttf trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSiz4SymBol.ttf trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSiz5Sym.ttf Modified: trunk/matplotlib/lib/matplotlib/font_manager.py =================================================================== --- trunk/matplotlib/lib/matplotlib/font_manager.py 2010-06-10 17:04:44 UTC (rev 8407) +++ trunk/matplotlib/lib/matplotlib/font_manager.py 2010-06-10 17:48:10 UTC (rev 8408) @@ -975,7 +975,7 @@ # Increment this version number whenever the font cache data # format or behavior has changed and requires a existing font # cache files to be rebuilt. - __version__ = 6 + __version__ = 7 def __init__(self, size=None, weight='normal'): self._version = self.__version__ Modified: trunk/matplotlib/lib/matplotlib/mathtext.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mathtext.py 2010-06-10 17:04:44 UTC (rev 8407) +++ trunk/matplotlib/lib/matplotlib/mathtext.py 2010-06-10 17:48:10 UTC (rev 8408) @@ -330,7 +330,7 @@ def render_glyph(self, ox, oy, info): oy = self.height - oy + info.offset thetext = unichr_safe(info.num) - + self.svg_glyphs.append( (info.font, info.fontsize, thetext, ox, oy, info.metrics)) @@ -850,7 +850,7 @@ fontname, font_class, uniindex) new_fontname = fontname - + # Only characters in the "Letter" class should be italicized in 'it' # mode. Greek capital letters should be Roman. if found_symbol: @@ -923,11 +923,11 @@ 'nonunibf' : 'STIXNonUnicode:weight=bold', 0 : 'STIXGeneral', - 1 : 'STIXSize1', - 2 : 'STIXSize2', - 3 : 'STIXSize3', - 4 : 'STIXSize4', - 5 : 'STIXSize5' + 1 : 'STIXSizeOneSym', + 2 : 'STIXSizeTwoSym', + 3 : 'STIXSizeThreeSym', + 4 : 'STIXSizeFourSym', + 5 : 'STIXSizeFiveSym' } use_cmex = False cm_fallback = False Modified: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/LICENSE_STIX =================================================================== --- trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/LICENSE_STIX 2010-06-10 17:04:44 UTC (rev 8407) +++ trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/LICENSE_STIX 2010-06-10 17:48:10 UTC (rev 8408) @@ -1,71 +1,124 @@ -TERMS AND CONDITIONS +The STIX fonts distributed with matplotlib have been modified from +their canonical form. They have been converted from OTF to TTF format +using Fontforge and this script: - 1. Permission is hereby granted, free of charge, to any person -obtaining a copy of the STIX Fonts-TM set accompanying this license -(collectively, the "Fonts") and the associated documentation files -(collectively with the Fonts, the "Font Software"), to reproduce and -distribute the Font Software, including the rights to use, copy, merge -and publish copies of the Font Software, and to permit persons to whom -the Font Software is furnished to do so same, subject to the following -terms and conditions (the "License"). + #!/usr/bin/env fontforge + i=1 + while ( i<$argc ) + Open($argv[i]) + Generate($argv[i]:r + ".ttf") + i = i+1 + endloop - 2. The following copyright and trademark notice and these Terms and -Conditions shall be included in all copies of one or more of the Font -typefaces and any derivative work created as permitted under this -License: +The original STIX Font License begins below. - Copyright (c) 2001-2005 by the STI Pub Companies, consisting of -the American Institute of Physics, the American Chemical Society, the -American Mathematical Society, the American Physical Society, Elsevier, -Inc., and The Institute of Electrical and Electronic Engineers, Inc. -Portions copyright (c) 1998-2003 by MicroPress, Inc. Portions copyright -(c) 1990 by Elsevier, Inc. All rights reserved. STIX Fonts-TM is a -trademark of The Institute of Electrical and Electronics Engineers, Inc. +----------------------------------------------------------- - 3. You may (a) convert the Fonts from one format to another (e.g., -from TrueType to PostScript), in which case the normal and reasonable -distortion that occurs during such conversion shall be permitted and (b) -embed or include a subset of the Fonts in a document for the purposes of -allowing users to read text in the document that utilizes the Fonts. In -each case, you may use the STIX Fonts-TM mark to designate the resulting -Fonts or subset of the Fonts. +STIX Font License - 4. You may also (a) add glyphs or characters to the Fonts, or modify -the shape of existing glyphs, so long as the base set of glyphs is not -removed and (b) delete glyphs or characters from the Fonts, provided -that the resulting font set is distributed with the following -disclaimer: "This [name] font does not include all the Unicode points -covered in the STIX Fonts-TM set but may include others." In each case, -the name used to denote the resulting font set shall not include the -term "STIX" or any similar term. +24 May 2010 - 5. You may charge a fee in connection with the distribution of the -Font Software, provided that no copy of one or more of the individual -Font typefaces that form the STIX Fonts-TM set may be sold by itself. +Copyright (c) 2001-2010 by the STI Pub Companies, consisting of the American +Institute of Physics, the American Chemical Society, the American Mathematical +Society, the American Physical Society, Elsevier, Inc., and The Institute of +Electrical and Electronic Engineers, Inc. (www.stixfonts.org), with Reserved +Font Name STIX Fonts, STIX Fonts (TM) is a trademark of The Institute of +Electrical and Electronics Engineers, Inc. - 6. THE FONT SOFTWARE IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY -KIND, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK OR OTHER RIGHT. IN NO EVENT SHALL -MICROPRESS OR ANY OF THE STI PUB COMPANIES BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, INCLUDING, BUT NOT LIMITED TO, ANY GENERAL, -SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM OR OUT OF THE USE OR -INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT -SOFTWARE. +Portions copyright (c) 1998-2003 by MicroPress, Inc. (www.micropress-inc.com), +with Reserved Font Name TM Math. To obtain additional mathematical fonts, please +contact MicroPress, Inc., 68-30 Harrow Street, Forest Hills, NY 11375, USA, +Phone: (718) 575-1816. - 7. Except as contained in the notice set forth in Section 2, the -names MicroPress Inc. and STI Pub Companies, as well as the names of the -companies/organizations that compose the STI Pub Companies, shall not be -used in advertising or otherwise to promote the sale, use or other -dealings in the Font Software without the prior written consent of the -respective company or organization. +Portions copyright (c) 1990 by Elsevier, Inc. - 8. This License shall become null and void in the event of any -material breach of the Terms and Conditions herein by licensee. +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL - 9. A substantial portion of the STIX Fonts set was developed by -MicroPress Inc. for the STI Pub Companies. To obtain additional -mathematical fonts, please contact MicroPress, Inc., 68-30 Harrow -Street, Forest Hills, NY 11375, USA - Phone: (718) 575-1816. +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. Modified: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXGeneral.ttf =================================================================== (Binary files differ) Modified: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXGeneralBol.ttf =================================================================== (Binary files differ) Modified: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXGeneralBolIta.ttf =================================================================== (Binary files differ) Modified: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXGeneralItalic.ttf =================================================================== (Binary files differ) Modified: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXNonUni.ttf =================================================================== (Binary files differ) Modified: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXNonUniBol.ttf =================================================================== (Binary files differ) Modified: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXNonUniBolIta.ttf =================================================================== (Binary files differ) Modified: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXNonUniIta.ttf =================================================================== (Binary files differ) Deleted: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSiz1Sym.ttf =================================================================== (Binary files differ) Deleted: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSiz1SymBol.ttf =================================================================== (Binary files differ) Deleted: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSiz2Sym.ttf =================================================================== (Binary files differ) Deleted: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSiz2SymBol.ttf =================================================================== (Binary files differ) Deleted: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSiz3Sym.ttf =================================================================== (Binary files differ) Deleted: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSiz3SymBol.ttf =================================================================== (Binary files differ) Deleted: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSiz4Sym.ttf =================================================================== (Binary files differ) Deleted: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSiz4SymBol.ttf =================================================================== (Binary files differ) Deleted: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSiz5Sym.ttf =================================================================== (Binary files differ) Added: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSizFiveSymReg.ttf =================================================================== (Binary files differ) Property changes on: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSizFiveSymReg.ttf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSizFourSymBol.ttf =================================================================== (Binary files differ) Property changes on: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSizFourSymBol.ttf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSizFourSymReg.ttf =================================================================== (Binary files differ) Property changes on: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSizFourSymReg.ttf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSizOneSymBol.ttf =================================================================== (Binary files differ) Property changes on: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSizOneSymBol.ttf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSizOneSymReg.ttf =================================================================== (Binary files differ) Property changes on: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSizOneSymReg.ttf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSizThreeSymBol.ttf =================================================================== (Binary files differ) Property changes on: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSizThreeSymBol.ttf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSizThreeSymReg.ttf =================================================================== (Binary files differ) Property changes on: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSizThreeSymReg.ttf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSizTwoSymBol.ttf =================================================================== (Binary files differ) Property changes on: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSizTwoSymBol.ttf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSizTwoSymReg.ttf =================================================================== (Binary files differ) Property changes on: trunk/matplotlib/lib/matplotlib/mpl-data/fonts/ttf/STIXSizTwoSymReg.ttf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/matplotlib/setup.py =================================================================== --- trunk/matplotlib/setup.py 2010-06-10 17:04:44 UTC (rev 8407) +++ trunk/matplotlib/setup.py 2010-06-10 17:48:10 UTC (rev 8408) @@ -95,6 +95,10 @@ 'mpl-data/fonts/pdfcorefonts/*.afm', 'mpl-data/fonts/pdfcorefonts/*.txt', 'mpl-data/fonts/ttf/*.ttf', + 'mpl-data/fonts/ttf/LICENSE_STIX', + 'mpl-data/fonts/ttf/COPYRIGHT.TXT', + 'mpl-data/fonts/ttf/README.TXT', + 'mpl-data/fonts/ttf/RELEASENOTES.TXT', 'mpl-data/images/*.xpm', 'mpl-data/images/*.svg', 'mpl-data/images/*.png', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2010-06-10 17:04:50
|
Revision: 8407 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8407&view=rev Author: mdboom Date: 2010-06-10 17:04:44 +0000 (Thu, 10 Jun 2010) Log Message: ----------- [2908399] Support clip paths in QuadMesh with gouraud shading Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backends/backend_svg.py trunk/matplotlib/src/_backend_agg.cpp Modified: trunk/matplotlib/lib/matplotlib/backends/backend_svg.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_svg.py 2010-06-10 14:06:50 UTC (rev 8406) +++ trunk/matplotlib/lib/matplotlib/backends/backend_svg.py 2010-06-10 17:04:44 UTC (rev 8407) @@ -370,6 +370,24 @@ self._n_gradients += 1 + def draw_gouraud_triangles(self, gc, triangles_array, colors_array, + transform): + write = self._svgwriter.write + + clipid = self._get_gc_clip_svg(gc) + if clipid is None: + clippath = '' + else: + clippath = 'clip-path="url(#%s)"' % clipid + + write('<g %s>\n' % clippath) + + transform = transform.frozen() + for tri, col in zip(triangles_array, colors_array): + self.draw_gouraud_triangle(gc, tri, col, transform) + + write('</g>\n') + def draw_image(self, gc, x, y, im): # MGDTODO: Support clippath here trans = [1,0,0,1,0,0] Modified: trunk/matplotlib/src/_backend_agg.cpp =================================================================== --- trunk/matplotlib/src/_backend_agg.cpp 2010-06-10 14:06:50 UTC (rev 8406) +++ trunk/matplotlib/src/_backend_agg.cpp 2010-06-10 17:04:44 UTC (rev 8407) @@ -1532,7 +1532,7 @@ theRasterizer.reset_clipping(); rendererBase.reset_clipping(true); set_clipbox(gc.cliprect, theRasterizer); - /* TODO: Support clip paths */ + bool has_clippath = render_clippath(gc.clippath, gc.clippath_trans); trans *= agg::trans_affine_scaling(1.0, -1.0); trans *= agg::trans_affine_translation(0.0, (double)height); @@ -1560,7 +1560,19 @@ theRasterizer.add_path(span_gen); - agg::render_scanlines_aa(theRasterizer, slineP8, rendererBase, span_alloc, span_gen); + if (has_clippath) { + typedef agg::pixfmt_amask_adaptor<pixfmt, alpha_mask_type> pixfmt_amask_type; + typedef agg::renderer_base<pixfmt_amask_type> amask_ren_type; + typedef agg::renderer_scanline_aa<amask_ren_type, span_alloc_t, span_gen_t> + amask_aa_renderer_type; + + pixfmt_amask_type pfa(pixFmt, alphaMask); + amask_ren_type r(pfa); + amask_aa_renderer_type ren(r, span_alloc, span_gen); + agg::render_scanlines(theRasterizer, slineP8, ren); + } else { + agg::render_scanlines_aa(theRasterizer, slineP8, rendererBase, span_alloc, span_gen); + } } Py::Object This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2010-06-10 14:06:57
|
Revision: 8406 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8406&view=rev Author: mdboom Date: 2010-06-10 14:06:50 +0000 (Thu, 10 Jun 2010) Log Message: ----------- [3010563] misaligned title text when using GTK backend Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backends/backend_gdk.py Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gdk.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_gdk.py 2010-06-10 13:48:31 UTC (rev 8405) +++ trunk/matplotlib/lib/matplotlib/backends/backend_gdk.py 2010-06-10 14:06:50 UTC (rev 8406) @@ -308,8 +308,10 @@ layout, inkRect, logicalRect = self._get_pango_layout(s, prop) l, b, w, h = inkRect - return w, h+1, h + 1 + ll, lb, lw, lh = logicalRect + return w, h + 1, h - lh + def new_gc(self): return GraphicsContextGDK(renderer=self) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2010-06-10 13:48:41
|
Revision: 8405 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8405&view=rev Author: mdboom Date: 2010-06-10 13:48:31 +0000 (Thu, 10 Jun 2010) Log Message: ----------- [3011582] stix_fonts_demo.py assert error When matplotlib is compiled without -DNDEBUG, we get this error on one of the example: $ python stix_fonts_demo.py python2.6: CXX/cxx_extensions.cxx:1320: virtual Py::PythonExtensionBase::~PythonExtensionBase(): Assertion `ob_refcnt == 0' failed. Aborted Modified Paths: -------------- trunk/matplotlib/src/ft2font.cpp Modified: trunk/matplotlib/src/ft2font.cpp =================================================================== --- trunk/matplotlib/src/ft2font.cpp 2010-06-10 01:59:13 UTC (rev 8404) +++ trunk/matplotlib/src/ft2font.cpp 2010-06-10 13:48:31 UTC (rev 8405) @@ -686,25 +686,28 @@ int error = FT_New_Face( _ft2Library, facefile.c_str(), 0, &face ); - if (error == FT_Err_Unknown_File_Format ) { std::ostringstream s; s << "Could not load facefile " << facefile << "; Unknown_File_Format" << std::endl; + ob_refcnt--; throw Py::RuntimeError(s.str()); } else if (error == FT_Err_Cannot_Open_Resource) { std::ostringstream s; s << "Could not open facefile " << facefile << "; Cannot_Open_Resource" << std::endl; + ob_refcnt--; throw Py::RuntimeError(s.str()); } else if (error == FT_Err_Invalid_File_Format) { std::ostringstream s; s << "Could not open facefile " << facefile << "; Invalid_File_Format" << std::endl; + ob_refcnt--; throw Py::RuntimeError(s.str()); } else if (error) { std::ostringstream s; s << "Could not open facefile " << facefile << "; freetype error code " << error<< std::endl; + ob_refcnt--; throw Py::RuntimeError(s.str()); } @@ -720,6 +723,7 @@ if (error) { std::ostringstream s; s << "Could not set the fontsize for facefile " << facefile << std::endl; + ob_refcnt--; throw Py::RuntimeError(s.str()); } @@ -739,7 +743,6 @@ if ( style_name == NULL ) style_name = "UNAVAILABLE"; - setattr("postscript_name", Py::String(ps_name)); setattr("num_faces", Py::Int(face->num_faces)); setattr("family_name", Py::String(family_name)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2010-06-10 01:59:19
|
Revision: 8404 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8404&view=rev Author: jdh2358 Date: 2010-06-10 01:59:13 +0000 (Thu, 10 Jun 2010) Log Message: ----------- added bbox_inches and pad_inches to savefig signature Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/figure.py Modified: trunk/matplotlib/lib/matplotlib/figure.py =================================================================== --- trunk/matplotlib/lib/matplotlib/figure.py 2010-06-09 22:05:09 UTC (rev 8403) +++ trunk/matplotlib/lib/matplotlib/figure.py 2010-06-10 01:59:13 UTC (rev 8404) @@ -992,7 +992,7 @@ savefig(fname, dpi=None, facecolor='w', edgecolor='w', orientation='portrait', papertype=None, format=None, - transparent=False): + transparent=False, bbox_inches=None, pad_inches=0.1): Save the current figure. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2010-06-09 22:05:16
|
Revision: 8403 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8403&view=rev Author: jdh2358 Date: 2010-06-09 22:05:09 +0000 (Wed, 09 Jun 2010) Log Message: ----------- fix legend doc typos Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/doc/users/legend_guide.rst Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2010-06-09 17:57:36 UTC (rev 8402) +++ trunk/matplotlib/CHANGELOG 2010-06-09 22:05:09 UTC (rev 8403) @@ -4,7 +4,7 @@ 2010-06-06 Change the way we do split/dividend adjustments in finance.py to handle dividends and fix the zero division bug reported - in sf bug 2949906. Note that volume is not adjusted + in sf bug 2949906 and 2123566. Note that volume is not adjusted because the Yahoo CSV does not distinguish between share split and dividend adjustments making it near impossible to get volume adjustement right (unless we want to guess based Modified: trunk/matplotlib/doc/users/legend_guide.rst =================================================================== --- trunk/matplotlib/doc/users/legend_guide.rst 2010-06-09 17:57:36 UTC (rev 8402) +++ trunk/matplotlib/doc/users/legend_guide.rst 2010-06-09 22:05:09 UTC (rev 8403) @@ -12,14 +12,14 @@ ==================== The legend command has a following call signature:: - + legend(*args, **kwargs) - + If len(args) is 2, the first argument should be a list of artist to be labeled, and the second argument should a list of string labels. If len(args) is 0, it automatically generate the legend from label properties of the child artists by calling -:meth:`~matplotlib.axes.Axes.get_legend_handles_labels` method. +:meth:`~matplotlib.axes.Axes.get_legend_handles_labels` method. For example, *ax.legend()* is equivalent to:: handles, labels = ax.get_legend_handles_labels() @@ -44,7 +44,7 @@ * :class:`~matplotlib.patches.Patch` * :class:`~matplotlib.collections.LineCollection` * :class:`~matplotlib.collections.RegularPolyCollection` - + Unfortunately, there is no easy workaround when you need legend for an artist not in the above list (You may use one of the supported artist as a proxy. See below), or customize it beyond what is @@ -84,28 +84,28 @@ p1, = ax.plot([1,2,3], label="line 1") p2, = ax.plot([3,2,1], label="line 2") p3, = ax.plot([2,3,1], label="line 3") - + handles, labels = ax.get_legend_handles_labels() # reverse the order ax.legend(handles[::-1], labels[::-1]) - + # or sort them by labels import operator hl = sorted(zip(handles, labels), key=operator.itemgetter(1)) handles2, labels2 = zip(*hl) - + ax.legend(handles2, labels2) Using Proxy Artist ------------------ -When you want to display legend for an artist not supported by the -matplotlib, you may use other supported artist as a proxy. For -example, you may creates an proxy artist without adding it to the axes -(so the proxy artist will not be drawn in the main axes) and feet it +When you want to display legend for an artist not supported by +matplotlib, you may use another artist as a proxy. For +example, you may create a proxy artist without adding it to the axes +(so the proxy artist will not be drawn in the main axes) and feed it to the legend function.:: p = Rectangle((0, 0), 1, 1, fc="r") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2010-06-09 17:57:46
|
Revision: 8402 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8402&view=rev Author: efiring Date: 2010-06-09 17:57:36 +0000 (Wed, 09 Jun 2010) Log Message: ----------- Axes.grid controls minor and/or major lines; axis.grid allows 'both' Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/axes.py trunk/matplotlib/lib/matplotlib/axis.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2010-06-09 03:04:53 UTC (rev 8401) +++ trunk/matplotlib/CHANGELOG 2010-06-09 17:57:36 UTC (rev 8402) @@ -1,3 +1,7 @@ +2010-06-09 Allow Axes.grid to control minor gridlines; allow + Axes.grid and Axis.grid to control major and minor + gridlines in the same method call. - EF + 2010-06-06 Change the way we do split/dividend adjustments in finance.py to handle dividends and fix the zero division bug reported in sf bug 2949906. Note that volume is not adjusted Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-06-09 03:04:53 UTC (rev 8401) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-06-09 17:57:36 UTC (rev 8402) @@ -1957,19 +1957,22 @@ self._axisbelow = b @docstring.dedent_interpd - def grid(self, b=None, **kwargs): + def grid(self, b=None, which='major', **kwargs): """ call signature:: - grid(self, b=None, **kwargs) + grid(self, b=None, which='major', **kwargs) Set the axes grids on or off; *b* is a boolean. (For Matlab compatibility, *b* may also be a string, 'on' or 'off'.) If *b* is *None* and ``len(kwargs)==0``, toggle the grid state. If *kwargs* are supplied, it is assumed that you want a grid and *b* - is thus set to *True* + is thus set to *True*. + *which* can be 'major' (default), 'minor', or 'both' to control + whether major tick grids, minor tick grids, or both are affected. + *kawrgs* are used to set the grid line properties, eg:: ax.grid(color='r', linestyle='-', linewidth=2) @@ -1981,8 +1984,8 @@ if len(kwargs): b = True b = _string_to_bool(b) - self.xaxis.grid(b, **kwargs) - self.yaxis.grid(b, **kwargs) + self.xaxis.grid(b, which=which, **kwargs) + self.yaxis.grid(b, which=which, **kwargs) def ticklabel_format(self, **kwargs): """ Modified: trunk/matplotlib/lib/matplotlib/axis.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axis.py 2010-06-09 03:04:53 UTC (rev 8401) +++ trunk/matplotlib/lib/matplotlib/axis.py 2010-06-09 17:57:36 UTC (rev 8402) @@ -1002,7 +1002,7 @@ def grid(self, b=None, which='major', **kwargs): """ Set the axis grid on or off; b is a boolean. Use *which* = - 'major' | 'minor' to set the grid for major or minor ticks. + 'major' | 'minor' | 'both' to set the grid for major or minor ticks. If *b* is *None* and len(kwargs)==0, toggle the grid state. If *kwargs* are supplied, it is assumed you want the grid on and *b* @@ -1013,14 +1013,15 @@ xax.grid(color='r', linestyle='-', linewidth=2) """ if len(kwargs): b = True - if which.lower().find('minor')>=0: + which = which.lower() + if which in ['minor', 'both']: if b is None: self._gridOnMinor = not self._gridOnMinor else: self._gridOnMinor = b for tick in self.minorTicks: # don't use get_ticks here! if tick is None: continue tick.gridOn = self._gridOnMinor if len(kwargs): artist.setp(tick.gridline,**kwargs) - if which.lower().find('major')>=0: + if which in ['major', 'both']: if b is None: self._gridOnMajor = not self._gridOnMajor else: self._gridOnMajor = b for tick in self.majorTicks: # don't use get_ticks here! This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2010-06-09 03:05:00
|
Revision: 8401 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8401&view=rev Author: efiring Date: 2010-06-09 03:04:53 +0000 (Wed, 09 Jun 2010) Log Message: ----------- put 3 more pytz zoneinfo files under svn control; they were missed by accident when I updated pytz Added Paths: ----------- trunk/matplotlib/lib/pytz/zoneinfo/Antarctica/Macquarie trunk/matplotlib/lib/pytz/zoneinfo/Asia/Kathmandu trunk/matplotlib/lib/pytz/zoneinfo/Asia/Novokuznetsk Added: trunk/matplotlib/lib/pytz/zoneinfo/Antarctica/Macquarie =================================================================== (Binary files differ) Property changes on: trunk/matplotlib/lib/pytz/zoneinfo/Antarctica/Macquarie ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/matplotlib/lib/pytz/zoneinfo/Asia/Kathmandu =================================================================== (Binary files differ) Property changes on: trunk/matplotlib/lib/pytz/zoneinfo/Asia/Kathmandu ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/matplotlib/lib/pytz/zoneinfo/Asia/Novokuznetsk =================================================================== (Binary files differ) Property changes on: trunk/matplotlib/lib/pytz/zoneinfo/Asia/Novokuznetsk ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2010-06-09 03:02:43
|
Revision: 8400 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8400&view=rev Author: efiring Date: 2010-06-09 03:02:34 +0000 (Wed, 09 Jun 2010) Log Message: ----------- remove spurious whitespace Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2010-06-09 03:01:53 UTC (rev 8399) +++ trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2010-06-09 03:02:34 UTC (rev 8400) @@ -93,7 +93,7 @@ class TimerGTK(TimerBase): ''' Subclass of :class:`backend_bases.TimerBase` that uses GTK for timer events. - + Attributes: * interval: The time between timer events in milliseconds. Default is 1000 ms. @@ -118,7 +118,7 @@ def _on_timer(self): TimerBase._on_timer(self) - + # Gtk timeout_add() requires that the callback returns True if it # is to be called again. if len(self.callbacks) > 0 and not self._single: @@ -453,9 +453,9 @@ Creates a new backend-specific subclass of :class:`backend_bases.Timer`. This is useful for getting periodic events through the backend's native event loop. Implemented only for backends with GUIs. - + optional arguments: - + *interval* Timer interval in milliseconds *callbacks* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2010-06-09 03:01:59
|
Revision: 8399 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8399&view=rev Author: efiring Date: 2010-06-09 03:01:53 +0000 (Wed, 09 Jun 2010) Log Message: ----------- [2982047] start default collection label with underscore, like line label Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-06-08 22:41:10 UTC (rev 8398) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-06-09 03:01:53 UTC (rev 8399) @@ -1398,7 +1398,7 @@ ''' label = collection.get_label() if not label: - collection.set_label('collection%d'%len(self.collections)) + collection.set_label('_collection%d'%len(self.collections)) self.collections.append(collection) self._set_artist_props(collection) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2010-06-08 22:41:17
|
Revision: 8398 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8398&view=rev Author: efiring Date: 2010-06-08 22:41:10 +0000 (Tue, 08 Jun 2010) Log Message: ----------- [3013440] add set_alpha method to GraphicsContextMac Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py Modified: trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py 2010-06-08 21:57:14 UTC (rev 8397) +++ trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py 2010-06-08 22:41:10 UTC (rev 8398) @@ -180,6 +180,11 @@ GraphicsContextBase.__init__(self) _macosx.GraphicsContext.__init__(self) + def set_alpha(self, alpha): + GraphicsContextBase.set_alpha(self, alpha) + _alpha = self.get_alpha() + _macosx.GraphicsContext.set_alpha(self, _alpha) + def set_foreground(self, fg, isRGB=False): GraphicsContextBase.set_foreground(self, fg, isRGB) rgb = self.get_rgb() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2010-06-08 21:57:22
|
Revision: 8397 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8397&view=rev Author: efiring Date: 2010-06-08 21:57:14 +0000 (Tue, 08 Jun 2010) Log Message: ----------- backend_wx: modernize show; multiple calls to show work now Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backends/backend_wx.py Modified: trunk/matplotlib/lib/matplotlib/backends/backend_wx.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2010-06-07 23:39:24 UTC (rev 8396) +++ trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2010-06-08 21:57:14 UTC (rev 8397) @@ -1423,32 +1423,22 @@ def show(): """ - Current implementation assumes that matplotlib is executed in a PyCrust - shell. It appears to be possible to execute wxPython applications from - within a PyCrust without having to ensure that wxPython has been created - in a secondary thread (e.g. SciPy gui_thread). - - Unfortunately, gui_thread seems to introduce a number of further - dependencies on SciPy modules, which I do not wish to introduce - into the backend at this point. If there is a need I will look - into this in a later release. + Show all the figures and enter the wx main loop. + This should be the last line of your script. """ DEBUG_MSG("show()", 3, None) for figwin in Gcf.get_all_fig_managers(): figwin.frame.Show() - if show._needmain and not matplotlib.is_interactive(): - # start the wxPython gui event if there is not already one running + needmain = not wx.App.IsMainLoopRunning() + if needmain and len(Gcf.get_all_fig_managers())>0: wxapp = wx.GetApp() if wxapp is not None: - # wxPython 2.4 has no wx.App.IsMainLoopRunning() method - imlr = getattr(wxapp, 'IsMainLoopRunning', lambda: False) - if not imlr(): - wxapp.MainLoop() - show._needmain = False -show._needmain = True + wxapp.MainLoop() + # start the wxPython gui event if there is not already one running + def new_figure_manager(num, *args, **kwargs): """ Create a new figure manager instance This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2010-06-07 23:39:31
|
Revision: 8396 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8396&view=rev Author: efiring Date: 2010-06-07 23:39:24 +0000 (Mon, 07 Jun 2010) Log Message: ----------- dates: improve documentation related to use of Gregorian calendar Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/dates.py Modified: trunk/matplotlib/lib/matplotlib/dates.py =================================================================== --- trunk/matplotlib/lib/matplotlib/dates.py 2010-06-07 20:15:11 UTC (rev 8395) +++ trunk/matplotlib/lib/matplotlib/dates.py 2010-06-07 23:39:24 UTC (rev 8396) @@ -9,6 +9,23 @@ :func:`num2date` and :func:`drange` are used to facilitate easy conversion to and from :mod:`datetime` and numeric ranges. +.. note:: + Like Python's datetime, mpl uses the Gregorian calendar for + all conversions between dates and floating point numbers. + This practice is not universal, and calendar differences can + cause confusing differences between what Python and mpl + give as the number of days since 0001-01-01 and what other + software and databases yield. For example, the + `US Naval Observatory <http://www.usno.navy.mil/USNO/astronomical-applications/data-services/jul-date>`_ + uses a calendar that switches from Julian to Gregorian in + October, 1582. Hence, using their calculator, the number of + days between 0001-01-01 and 2006-04-01 is 732403, whereas using + the Gregorian calendar via the datetime module we find:: + + In [31]:date(2006,4,1).toordinal() - date(1,1,1).toordinal() + Out[31]:732401 + + A wide range of specific and general purpose date tick locators and formatters are provided in this module. See :mod:`matplotlib.ticker` for general information on tick locators @@ -233,8 +250,11 @@ *d* is either a :class:`datetime` instance or a sequence of datetimes. Return value is a floating point number (or sequence of floats) - which gives one plus the number of days (fraction part represents hours, - minutes, seconds) since 0001-01-01 00:00:00 UTC. + which gives the number of days (fraction part represents hours, + minutes, seconds) since 0001-01-01 00:00:00 UTC, *plus* *one*. + The addition of one here is a historical artifact. Also, note + that the Gregorian calendar is assumed; this is not universal + practice. For details, see the module docstring. """ if not cbook.iterable(d): return _to_ordinalf(d) else: return np.asarray([_to_ordinalf(val) for val in d]) @@ -252,9 +272,12 @@ def num2date(x, tz=None): """ - *x* is a float value which gives one plus the number of days + *x* is a float value which gives the number of days (fraction part represents hours, minutes, seconds) since - 0001-01-01 00:00:00 UTC. + 0001-01-01 00:00:00 UTC *plus* *one*. + The addition of one here is a historical artifact. Also, note + that the Gregorian calendar is assumed; this is not universal + practice. For details, see the module docstring. Return value is a :class:`datetime` instance in timezone *tz* (default to rcparams TZ value). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2010-06-07 20:15:18
|
Revision: 8395 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8395&view=rev Author: mdboom Date: 2010-06-07 20:15:11 +0000 (Mon, 07 Jun 2010) Log Message: ----------- [2860167] setting radial range of polar plot fails Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/projections/polar.py trunk/matplotlib/lib/matplotlib/tests/test_axes.py Added Paths: ----------- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_rmin.pdf trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_rmin.png trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_rmin.svg Modified: trunk/matplotlib/lib/matplotlib/projections/polar.py =================================================================== --- trunk/matplotlib/lib/matplotlib/projections/polar.py 2010-06-07 18:29:09 UTC (rev 8394) +++ trunk/matplotlib/lib/matplotlib/projections/polar.py 2010-06-07 20:15:11 UTC (rev 8395) @@ -35,14 +35,31 @@ output_dims = 2 is_separable = False + def __init__(self, axis=None): + Transform.__init__(self) + self._axis = axis + def transform(self, tr): xy = np.zeros(tr.shape, np.float_) + if self._axis is not None: + rmin = self._axis.viewLim.ymin + else: + rmin = 0 + t = tr[:, 0:1] r = tr[:, 1:2] x = xy[:, 0:1] y = xy[:, 1:2] - x[:] = r * np.cos(t) - y[:] = r * np.sin(t) + + if rmin != 0: + r = r - rmin + mask = r < 0 + x[:] = np.where(mask, np.nan, r * np.cos(t)) + y[:] = np.where(mask, np.nan, r * np.sin(t)) + else: + x[:] = r * np.cos(t) + y[:] = r * np.sin(t) + return xy transform.__doc__ = Transform.transform.__doc__ @@ -61,7 +78,7 @@ transform_path_non_affine.__doc__ = Transform.transform_path_non_affine.__doc__ def inverted(self): - return PolarAxes.InvertedPolarTransform() + return PolarAxes.InvertedPolarTransform(self._axis) inverted.__doc__ = Transform.inverted.__doc__ class PolarAffine(Affine2DBase): @@ -84,9 +101,9 @@ def get_matrix(self): if self._invalid: limits_scaled = self._limits.transformed(self._scale_transform) - ymax = limits_scaled.ymax + yscale = limits_scaled.ymax - limits_scaled.ymin affine = Affine2D() \ - .scale(0.5 / ymax) \ + .scale(0.5 / yscale) \ .translate(0.5, 0.5) self._mtx = affine.get_matrix() self._inverted = None @@ -103,10 +120,16 @@ output_dims = 2 is_separable = False + def __init__(self, axis=None): + Transform.__init__(self) + self._axis = axis + def transform(self, xy): x = xy[:, 0:1] y = xy[:, 1:] r = np.sqrt(x*x + y*y) + if self._axis is not None: + r += self._axis.viewLim.ymin theta = np.arccos(x / r) theta = np.where(y < 0, 2 * np.pi - theta, theta) return np.concatenate((theta, r), 1) @@ -221,9 +244,13 @@ # It is assumed that this part will have non-linear components self.transScale = TransformWrapper(IdentityTransform()) - # A (possibly non-linear) projection on the (already scaled) data - self.transProjection = self.PolarTransform() + # A (possibly non-linear) projection on the (already scaled) + # data. This one is aware of rmin + self.transProjection = self.PolarTransform(self) + # This one is not aware of rmin + self.transPureProjection = self.PolarTransform() + # An affine transformation on the data, generally to limit the # range of the axes self.transProjectionAffine = self.PolarAffine(self.transScale, self.viewLim) @@ -237,7 +264,7 @@ # equivalent to transData, except it always puts r == 1.0 at # the edge of the axis circle. self._xaxis_transform = ( - self.transProjection + + self.transPureProjection + self.PolarAffine(IdentityTransform(), Bbox.unit()) + self.transAxes) # The theta labels are moved from radius == 0.0 to radius == 1.1 @@ -298,13 +325,23 @@ (0.5, 0.5), 0.5)} def set_rmax(self, rmax): - self.viewLim.y0 = 0 self.viewLim.y1 = rmax - angle = self._r_label1_position.to_values()[4] def get_rmax(self): return self.viewLim.ymax + def set_rmin(self, rmin): + self.viewLim.y0 = rmin + + def get_rmin(self): + return self.viewLim.ymin + + def set_rlim(self, rmin=None, rmax=None): + self.viewLim.y0 = rmin + self.viewLim.y1 = rmax + + set_ylim = set_rlim + def set_yscale(self, *args, **kwargs): Axes.set_yscale(self, *args, **kwargs) self.yaxis.set_major_locator( Added: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_rmin.pdf =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_rmin.pdf (rev 0) +++ trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_rmin.pdf 2010-06-07 20:15:11 UTC (rev 8395) @@ -0,0 +1,321 @@ +%PDF-1.4 +%\xAC\xDC \xAB\xBA +1 0 obj +<< /Type /Catalog /Pages 2 0 R >> +endobj +8 0 obj +<< /XObject 7 0 R /Pattern 5 0 R +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] /ExtGState 4 0 R +/Shading 6 0 R /Font 3 0 R >> +endobj +10 0 obj +<< /Contents 9 0 R /Type /Page /Resources 8 0 R /Parent 2 0 R +/MediaBox [ 0 0 576 432 ] >> +endobj +9 0 obj +<< /Filter /FlateDecode /Length 11 0 R >> +stream +x\x9C\xED\x9DϮ<?n\xDD\xF7\xF5\xB5L6\xFDWik 1\xE0]\xE2\xB2\xB2r\x90\xC6u\x80\xAC\xFCZyĜշKE];;?\xAF\xAE1\xE3\xF9ޮ\xAE\xAE\x92DR$Ͽ=\xD2\xF9Wg<\xFF\x87\xFE\xFB\x97G8\xC3\xF9wg\xEDM\xFF\xFBe\xFF[rҿ\xC2\xE7\xF5\xF9\xF1\xFA\xDE\xDF\xEB_y\xA4\xEBҕW\xD2M9\xE7וz\xB5\xBD?˽\xBF\xFA\x95K\x88\xAD\xC7v\xB6\xF8*\xA1\xA7q\x85\x91\xF5\xBB1\xBC\xE2u\x85\xFB5\x8E\xA1{c\xE5J1\x9Es\x96\x92^u\xE8\xC7\xE2\xAD\x9C1\xB5W\x8A\xAD\x8E+\xA7\xAB\x9C\xA5\x85\xD7uƮ\xD0\xCF\xDEl~\xA4\xEF\x9Cs\xBC\xFF\xAD\xC7ݯ\xF3\xFC\xBD\xEA\xFAb\xCFW\xC9\xF9\xBA\xFFһ\xB8Qd=v\xFD\xA9u\xD4\xF9\xBAx\xF2\xF5\xFE\xD7\xF17g҃?/9/\xC7q\xAD\x83q\xBF\xA7\xF7Ll\xEF\xF5\xB4e\xDD8b\xAC\x9A\xF5\xC7\xC0\xDFŦw\x99\xFF~L\x9B\xFB=7\xCF\xCFwqK\xE4\x86\xF1\\xDCǰM>\x82\xF27\xE7\xFF<\xFE\xFB\xF1\xBF\xCF_\xC9\xF9\x95\x9C?_r\xFE\xF3\xF9\xBF\x84So8\xCF\xFF4\x88\xC5\xFB;}\xAF\xBD\xAER\xCF)h\xC8I\xEF\xAC\xC9i\xADf\xFDSЕ. +9 +\xB8\xA7+\xD9\xF5c\xCA)\xA51jz\x97WU\x9Fk\xAA]\xCF5i\x85c\xD7tp~\xD5\xDC\xF4G\x99\xEBE\x8F+!\xB71\xDE\xF7KRR\xB1\x94֢]O)\x84\xA6A\xA7b\xF7\xC7W\xEDZ\x972\xD2\xE0~M`\xAD5\xE50\xE2e\xF7\x87W\xB9\xF4Ҋ\xBD\xBF~Nokɞ߇\x94\x87@Yo\xA1\xEB\xFA\xB9b\xBD\xA2>\xE3~]O\x92\xE0p\x85\xA6iM\xCDRJ-]\xD0\xED\xFE\xEBծ\xA0\x97I\xA9h҂\xBE\x9E\xAE\xF3żs\xBF\x96%kZ\xBC\xBA\xDE/t=.զ\xE9\x8C\xC3\xEE\xB7z\xEEm\xAE7\xA6\xE3\xD2d\x87>k\x8Du\x8F&Y\xD7\xEB+\i\xB4z\xE5\xDA\xDF\xF7\xF78Z\xAAz`\xD6\xF5\xCCtĦ\xF7 \xF5}\xFFUr\xE8\xE1*A\xEF\xD2+\xE8\xD1W˹\xA7\xF7\xFBk\xB9Z\x91L\xCDO\xD0\xF8r\xD7|iA\xE3\xFB\xFD\xABV[C(\xA8\x83\xA4\xEC\xD2d\x871\xFA\xF7\xF4\xC5C MK\xAA\xCB]\xA3\xEDU\xEB#%xO\xDF(\x9A\x99\xD1G@\xD7!y\x90\xD9\xF0\xB5<\xD2'}\xA1\x94!\x81E\xC3\xEB\xAD\xF6\xAB\xBE\x96W\xDD\xF8 +\xCDw,\xDF%\xA5'\xD5B-\xF3\xF8\xF8һ\xA9E\xEC\xF5[\xFA\xBA\xFE\x90*K\xBA\xE254YI+\xF5)<ү\x96c\x95pI\xB3\xA54\xAD\xD6\xBE\x85K\xAF|iH\xF6S\x837\xD5%\xCD\xD5\xD0\xC7M\x8F\xD2ȳ&7\xF2]=\xFB\xE2U5V]z!\xB5Hzn\x99\xFBZ)\x9A\xACvi\xA1\xA2\xDE,ǚ5\xAEL\x91F{e-m֛k\xA1\xA2F֊\xC4T\xB39o\xBFICk\xB3\xCB1\xC7r\xF1\xA1\x97\xD0\xF34i%\xA4\xCAHӫ\x8F*\xB9\x89&\x86z\x87W\xE0\xDA%\xB0\xCB +9\xAE5\xF7a\xB7\xEB\xE9\xB1غ\x97>\xAFKFR\xD5\xECV\xBB\xFF\xD2:t&+\xD4y]\xFA\x96[FO\xB8_z#\x95\xAD!J\xAC\xE6\xDBg\x9ET\xB4\x90\xA8\xA1~[r%\xC5\xEF=\xA4a\xA3\xA5&=K\xB0h\xF7wɑ~\xACJX\xA3]\xD7*i\xBAL\xAB\xB8_r\x8F\xA1\xE5b\x93rN҂\xEC\xF1I\xEF+D\xD1\x8Cl\xCD$"\x97$\xFA\xBAl\xF8IP\xABG\x85,Y\xB9l\xA1\x85(\x97\x86\xDFK\xB1\xFB\xA5%B\xE9U4 +\xF2\xBA\xA4Zܟ\xC3+\xE9iTM\x9B\xE49]\xE6\xFE\x9C\x84\xF1\xB1FTߤXW됰d\xBB[\xB2 \xA0\x8Cұ\xD6MId#\xAA\xAD\xE7jw냀Fhʸ\xAE\xB1\xCA\xC6\xD4b\x9CO/\xBD\xA1@Ib[M\x87\xF5\xB0"D\xC3h\xED\x80-\x8C |
From: <ef...@us...> - 2010-06-07 18:29:15
|
Revision: 8394 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8394&view=rev Author: efiring Date: 2010-06-07 18:29:09 +0000 (Mon, 07 Jun 2010) Log Message: ----------- In a collection, if there is no facecolor, take alpha from edgecolor rgba, if available. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backend_bases.py Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backend_bases.py 2010-06-07 14:23:58 UTC (rev 8393) +++ trunk/matplotlib/lib/matplotlib/backend_bases.py 2010-06-07 18:29:09 UTC (rev 8394) @@ -300,7 +300,10 @@ if Nfacecolors: rgbFace = facecolors[i % Nfacecolors] if Nedgecolors: - gc0.set_foreground(edgecolors[i % Nedgecolors]) + fg = edgecolors[i % Nedgecolors] + if Nfacecolors == 0 and len(fg)==4: + gc0.set_alpha(fg[3]) + gc0.set_foreground(fg) if Nlinewidths: gc0.set_linewidth(linewidths[i % Nlinewidths]) if Nlinestyles: @@ -309,7 +312,7 @@ if rgbFace[3] == 0: rgbFace = None else: - gc0.set_alpha(rgbFace[-1]) + gc0.set_alpha(rgbFace[3]) rgbFace = rgbFace[:3] gc0.set_antialiased(antialiaseds[i % Naa]) if Nurls: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2010-06-07 14:24:05
|
Revision: 8393 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8393&view=rev Author: mdboom Date: 2010-06-07 14:23:58 +0000 (Mon, 07 Jun 2010) Log Message: ----------- Fix baseline-alignment on multi-line text. (Reported by Olle Engdeg?\195?\165rd) Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/formatter_ticker_005.svg trunk/matplotlib/lib/matplotlib/tests/test_text.py trunk/matplotlib/lib/matplotlib/text.py Added Paths: ----------- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_text/multiline.pdf trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_text/multiline.png trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_text/multiline.svg Modified: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/formatter_ticker_005.svg =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/formatter_ticker_005.svg 2010-06-07 13:04:24 UTC (rev 8392) +++ trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/formatter_ticker_005.svg 2010-06-07 14:23:58 UTC (rev 8393) @@ -143,7 +143,7 @@ <g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m9281cae24120827b11d5ea8a7ad3e96b" x="518.400000" y="43.200000"/> </g></g> <g id="text6"> -<g style="fill: #000000; opacity: 1.000000" transform="translate(498.314062,401.706250)scale(0.120000)"> +<g style="fill: #000000; opacity: 1.000000" transform="translate(498.314063,401.706250)scale(0.120000)"> <use xlink:href="#c_7a2040fe3b94fcd41d0a72c84e93b115"/> <use xlink:href="#c_ed3e21196fb739f392806f09ca0594ef" x="63.623047"/> <use xlink:href="#c_7a2040fe3b94fcd41d0a72c84e93b115" x="95.410156"/> @@ -163,7 +163,7 @@ <path id="c_0bce5afba2dc6b9024b26277c38ad8e8" d="M56.203125 -29.593750l0.000000 4.390625l-41.312500 0.000000q0.593750 9.281250 5.593750 14.140625q5.000000 4.859375 13.937500 4.859375q5.171875 0.000000 10.031250 -1.265625q4.859375 -1.265625 9.656250 -3.812500l0.000000 8.500000q-4.843750 2.046875 -9.921875 3.125000q-5.078125 1.078125 -10.296875 1.078125q-13.093750 0.000000 -20.734375 -7.609375q-7.640625 -7.625000 -7.640625 -20.625000q0.000000 -13.421875 7.250000 -21.296875q7.250000 -7.890625 19.562500 -7.890625q11.031250 0.000000 17.453125 7.109375q6.421875 7.093750 6.421875 19.296875M47.218750 -32.234375q-0.093750 -7.359375 -4.125000 -11.750000q-4.031250 -4.406250 -10.671875 -4.406250q-7.515625 0.000000 -12.031250 4.250000q-4.515625 4.250000 -5.203125 11.968750z"/> <path id="c_d41d8cd98f00b204e9800998ecf8427e" d=""/> </defs> -<g style="fill: #000000; opacity: 1.000000" transform="translate(262.293750,416.003125)scale(0.120000)"> +<g style="fill: #000000; opacity: 1.000000" transform="translate(262.121875,416.003125)scale(0.120000)"> <use xlink:href="#c_801fe2e877fad46da27c898b407b3b54"/> <use xlink:href="#c_7b26b13f539f13a4c64eef23b6952d29" x="59.179688"/> <use xlink:href="#c_5099edb83619131346ae654950954dea" x="95.263672"/> @@ -289,7 +289,7 @@ <g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m20b58b2501143cb5e0a5e8f1ef6f1643" x="518.400000" y="158.400000"/> </g></g> <g id="text14"> -<g style="fill: #000000; opacity: 1.000000" transform="translate(43.375000,162.767188)scale(0.120000)"> +<g style="fill: #000000; opacity: 1.000000" transform="translate(43.375000,162.767187)scale(0.120000)"> <use xlink:href="#c_42baa63129a918535c52adb20d687ea7"/> <use xlink:href="#c_7a2040fe3b94fcd41d0a72c84e93b115" x="63.623047"/> <use xlink:href="#c_ed3e21196fb739f392806f09ca0594ef" x="127.246094"/> Added: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_text/multiline.pdf =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_text/multiline.pdf (rev 0) +++ trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_text/multiline.pdf 2010-06-07 14:23:58 UTC (rev 8393) @@ -0,0 +1,194 @@ +%PDF-1.4 +%\xAC\xDC \xAB\xBA +1 0 obj +<< /Type /Catalog /Pages 2 0 R >> +endobj +8 0 obj +<< /XObject 7 0 R /Pattern 5 0 R +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] /ExtGState 4 0 R +/Shading 6 0 R /Font 3 0 R >> +endobj +10 0 obj +<< /Contents 9 0 R /Type /Page /Resources 8 0 R /Parent 2 0 R +/MediaBox [ 0 0 576 432 ] >> +endobj +9 0 obj +<< /Filter /FlateDecode /Length 11 0 R >> +stream +x\x9Cm\x8F=\xC20\x85w\x9F\xC2#,!\xCE_\xC3Z *\xB1\x92 \xD1VEI\xA7 8>.ڪ\x91\x9F\xFD\xDEg+\x847PxB_%&\xB4\x85\xE3\xDF\xD5h\xC5J\xFE*ϡ\xE4܃U\x85bC\xA8\x81!/\xCC\xD8\xC4O\xA3\xBD\x9E;\xCD\xE4\x81h\xDA1\xDAi\xC9\xC1fK\xD7\xE6\xFF\xDBc\xBA\xCCc\xC9\xFF\x94\xD8Bpw$$\xC3Lh@9#\xBC/,\x92BZ\xA7,\x86+l\xD2=\xE6.v}\xBD\xC5p\xC3CXaF \xEB +H\xBD\xD7|c\xA0r\xFD\xCCx\x89]ۧ\xBA\xCF_^]\x9FL +endstream +endobj +11 0 obj +185 +endobj +16 0 obj +<< /Filter /FlateDecode /Length 304 >> +stream +x\x9C=\x92;\x92\xC30C{\x9D\x82Ȍ\xF8\x93\xE4\xF3d'\x95\xF7\xFE\xED>2\xC9V\x80I\x89 |
From: <jd...@us...> - 2010-06-07 13:04:31
|
Revision: 8392 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8392&view=rev Author: jdh2358 Date: 2010-06-07 13:04:24 +0000 (Mon, 07 Jun 2010) Log Message: ----------- fix adjusted prices so divs are included propely; closes sf 2949906 Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/finance.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2010-06-07 01:03:54 UTC (rev 8391) +++ trunk/matplotlib/CHANGELOG 2010-06-07 13:04:24 UTC (rev 8392) @@ -1,3 +1,12 @@ +2010-06-06 Change the way we do split/dividend adjustments in + finance.py to handle dividends and fix the zero division bug reported + in sf bug 2949906. Note that volume is not adjusted + because the Yahoo CSV does not distinguish between share + split and dividend adjustments making it near impossible to + get volume adjustement right (unless we want to guess based + on the size of the adjustment or scrape the html tables, + which we don't) - JDH + 2010-06-06 Updated dateutil to 1.5 and pytz to 2010h. 2010-06-02 Add error_kw kwarg to Axes.bar(). - EF Modified: trunk/matplotlib/lib/matplotlib/finance.py =================================================================== --- trunk/matplotlib/lib/matplotlib/finance.py 2010-06-07 01:03:54 UTC (rev 8391) +++ trunk/matplotlib/lib/matplotlib/finance.py 2010-06-07 13:04:24 UTC (rev 8392) @@ -42,7 +42,10 @@ where d is a floating poing representation of date, as returned by date2num - if adjusted=True, use adjusted prices + if adjusted=True, use adjusted prices. Note that volume is not + adjusted and we are not able to handle volume adjustments properly + because the Yahoo CSV does not distinguish between split and + dividend adjustments. """ results = [] @@ -68,10 +71,10 @@ volume = int(vals[5]) if adjusted: aclose = float(vals[6]) - m = aclose/close - open *= m - high *= m - low *= m + delta = aclose-close + open += delta + high += delta + low += delta close = aclose results.append((d, open, close, high, low, volume)) @@ -146,7 +149,10 @@ if asobject is True, the return val is an object with attrs date, open, close, high, low, volume, which are equal length arrays - if adjust=True, use adjusted prices + if adjusted=True, use adjusted prices. Note that volume is not + adjusted and we are not able to handle volume adjustments properly + because the Yahoo CSV does not distinguish between split and + dividend adjustments. Ex: sp = f.quotes_historical_yahoo('^GSPC', d1, d2, asobject=True, adjusted=True) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2010-06-07 01:04:01
|
Revision: 8391 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8391&view=rev Author: efiring Date: 2010-06-07 01:03:54 +0000 (Mon, 07 Jun 2010) Log Message: ----------- CHANGELOG: note version changes in dateutil and pytz Modified Paths: -------------- trunk/matplotlib/CHANGELOG Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2010-06-06 22:44:18 UTC (rev 8390) +++ trunk/matplotlib/CHANGELOG 2010-06-07 01:03:54 UTC (rev 8391) @@ -1,3 +1,5 @@ +2010-06-06 Updated dateutil to 1.5 and pytz to 2010h. + 2010-06-02 Add error_kw kwarg to Axes.bar(). - EF 2010-06-01 Fix pcolormesh() and QuadMesh to pass on kwargs as This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |