From: <md...@us...> - 2010-06-12 07:49:01
|
Revision: 8417 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8417&view=rev Author: mdehoon Date: 2010-06-12 07:48:54 +0000 (Sat, 12 Jun 2010) Log Message: ----------- No CGContextGetLineWidth in Cocoa; pass the line width from Python instead. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py trunk/matplotlib/src/_macosx.m Modified: trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py 2010-06-12 06:53:03 UTC (rev 8416) +++ trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py 2010-06-12 07:48:54 UTC (rev 8417) @@ -52,12 +52,14 @@ def draw_path(self, gc, path, transform, rgbFace=None): if rgbFace is not None: rgbFace = tuple(rgbFace) - gc.draw_path(path, transform, rgbFace) + linewidth = gc.get_linewidth() + gc.draw_path(path, transform, linewidth, rgbFace) def draw_markers(self, gc, marker_path, marker_trans, path, trans, rgbFace=None): if rgbFace is not None: rgbFace = tuple(rgbFace) - gc.draw_markers(marker_path, marker_trans, path, trans, rgbFace) + linewidth = gc.get_linewidth() + gc.draw_markers(marker_path, marker_trans, path, trans, linewidth, rgbFace) def draw_path_collection(self, gc, master_transform, paths, all_transforms, offsets, offsetTrans, facecolors, edgecolors, Modified: trunk/matplotlib/src/_macosx.m =================================================================== --- trunk/matplotlib/src/_macosx.m 2010-06-12 06:53:03 UTC (rev 8416) +++ trunk/matplotlib/src/_macosx.m 2010-06-12 07:48:54 UTC (rev 8417) @@ -864,6 +864,7 @@ PyObject* path; PyObject* transform; PyObject* rgbFace; + float linewidth; int n; @@ -878,9 +879,10 @@ return NULL; } - if(!PyArg_ParseTuple(args, "OO|O", + if(!PyArg_ParseTuple(args, "OOf|O", &path, &transform, + &linewidth, &rgbFace)) return NULL; if(rgbFace==Py_None) rgbFace = NULL; @@ -891,7 +893,7 @@ 0, rect, QUANTIZE_AUTO, - CGContextGetLineWidth(self), + linewidth, rgbFace == NULL); if (!iterator) { @@ -969,7 +971,7 @@ 0, rect, QUANTIZE_AUTO, - CGContextGetLineWidth(self), + linewidth, 0); if (!iterator) { @@ -995,6 +997,7 @@ PyObject* marker_transform; PyObject* path; PyObject* transform; + float linewidth; PyObject* rgbFace; int ok; @@ -1015,11 +1018,12 @@ return NULL; } - if(!PyArg_ParseTuple(args, "OOOO|O", + if(!PyArg_ParseTuple(args, "OOOOf|O", &marker_path, &marker_transform, &path, &transform, + &linewidth, &rgbFace)) return NULL; if(rgbFace==Py_None) rgbFace = NULL; @@ -1046,7 +1050,7 @@ 0, rect, mode, - CGContextGetLineWidth(self), + linewidth, 0); if (!iterator) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2010-06-15 19:10:26
|
Revision: 8437 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8437&view=rev Author: mdboom Date: 2010-06-15 19:10:19 +0000 (Tue, 15 Jun 2010) Log Message: ----------- Use the word "snapping" everywhere for consistency. This is the word used in the outward-facing interface all along. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/path.py trunk/matplotlib/src/_backend_agg.cpp trunk/matplotlib/src/_backend_agg.h trunk/matplotlib/src/_macosx.m trunk/matplotlib/src/_path.cpp trunk/matplotlib/src/path_cleanup.cpp trunk/matplotlib/src/path_cleanup.h trunk/matplotlib/src/path_converters.h Modified: trunk/matplotlib/lib/matplotlib/path.py =================================================================== --- trunk/matplotlib/lib/matplotlib/path.py 2010-06-15 13:01:22 UTC (rev 8436) +++ trunk/matplotlib/lib/matplotlib/path.py 2010-06-15 19:10:19 UTC (rev 8437) @@ -188,7 +188,7 @@ return len(self.vertices) def iter_segments(self, transform=None, remove_nans=True, clip=None, - quantize=False, stroke_width=1.0, simplify=None, + snap=False, stroke_width=1.0, simplify=None, curves=True): """ Iterates over all of the curve segments in the path. Each @@ -208,11 +208,12 @@ *clip*: if not None, must be a four-tuple (x1, y1, x2, y2) defining a rectangle in which to clip the path. - *quantize*: if None, auto-quantize. If True, force quantize, - and if False, don't quantize. + *snap*: if None, auto-snap to pixels, to reduce + fuzziness of rectilinear lines. If True, force snapping, and + if False, don't snap. *stroke_width*: the width of the stroke being drawn. Needed - as a hint for the quantizer. + as a hint for the snapping algorithm. *simplify*: if True, perform simplification, to remove vertices that do not affect the appearance of the path. If @@ -236,7 +237,7 @@ STOP = self.STOP vertices, codes = cleanup_path(self, transform, remove_nans, clip, - quantize, stroke_width, simplify, curves) + snap, stroke_width, simplify, curves) len_vertices = len(vertices) i = 0 Modified: trunk/matplotlib/src/_backend_agg.cpp =================================================================== --- trunk/matplotlib/src/_backend_agg.cpp 2010-06-15 13:01:22 UTC (rev 8436) +++ trunk/matplotlib/src/_backend_agg.cpp 2010-06-15 19:10:19 UTC (rev 8437) @@ -270,11 +270,11 @@ Py::Callable method(method_obj); Py::Object py_snap = method.apply(Py::Tuple()); if (py_snap.isNone()) { - quantize_mode = QUANTIZE_AUTO; + snap_mode = SNAP_AUTO; } else if (py_snap.isTrue()) { - quantize_mode = QUANTIZE_TRUE; + snap_mode = SNAP_TRUE; } else { - quantize_mode = QUANTIZE_FALSE; + snap_mode = SNAP_FALSE; } } @@ -506,8 +506,8 @@ Py::Object RendererAgg::draw_markers(const Py::Tuple& args) { typedef agg::conv_transform<PathIterator> transformed_path_t; - typedef PathQuantizer<transformed_path_t> quantize_t; - typedef agg::conv_curve<quantize_t> curve_t; + typedef PathSnapper<transformed_path_t> snap_t; + typedef agg::conv_curve<snap_t> curve_t; typedef agg::conv_stroke<curve_t> stroke_t; typedef agg::pixfmt_amask_adaptor<pixfmt, alpha_mask_type> pixfmt_amask_type; typedef agg::renderer_base<pixfmt_amask_type> amask_ren_type; @@ -533,19 +533,19 @@ PathIterator marker_path(marker_path_obj); 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(), - gc.linewidth); - curve_t marker_path_curve(marker_path_quantized); + snap_t marker_path_snapped(marker_path_transformed, + gc.snap_mode, + marker_path.total_vertices(), + gc.linewidth); + curve_t marker_path_curve(marker_path_snapped); PathIterator path(path_obj); transformed_path_t path_transformed(path, trans); - quantize_t path_quantized(path_transformed, - gc.quantize_mode, - path.total_vertices(), - 1.0); - curve_t path_curve(path_quantized); + snap_t path_snapped(path_transformed, + gc.snap_mode, + path.total_vertices(), + 1.0); + curve_t path_curve(path_snapped); path_curve.rewind(0); facepair_t face = _get_rgba_face(face_obj, gc.alpha); @@ -1079,8 +1079,8 @@ typedef agg::conv_transform<PathIterator> transformed_path_t; typedef PathNanRemover<transformed_path_t> nan_removed_t; typedef PathClipper<nan_removed_t> clipped_t; - typedef PathQuantizer<clipped_t> quantized_t; - typedef PathSimplifier<quantized_t> simplify_t; + typedef PathSnapper<clipped_t> snapped_t; + typedef PathSimplifier<snapped_t> simplify_t; typedef agg::conv_curve<simplify_t> curve_t; _VERBOSE("RendererAgg::draw_path"); @@ -1108,8 +1108,8 @@ 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(), gc.linewidth); - simplify_t simplified(quantized, simplify, path.simplify_threshold()); + snapped_t snapped(clipped, gc.snap_mode, path.total_vertices(), gc.linewidth); + simplify_t simplified(snapped, simplify, path.simplify_threshold()); curve_t curve(simplified); try { @@ -1141,8 +1141,8 @@ typedef agg::conv_transform<typename PathGenerator::path_iterator> transformed_path_t; typedef PathNanRemover<transformed_path_t> nan_removed_t; typedef PathClipper<nan_removed_t> clipped_t; - typedef PathQuantizer<clipped_t> quantized_t; - typedef agg::conv_curve<quantized_t> quantized_curve_t; + typedef PathSnapper<clipped_t> snapped_t; + typedef agg::conv_curve<snapped_t> snapped_curve_t; typedef agg::conv_curve<clipped_t> curve_t; PyArrayObject* offsets = NULL; @@ -1275,13 +1275,13 @@ 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(), gc.linewidth); + snapped_t snapped(clipped, gc.snap_mode, + path.total_vertices(), gc.linewidth); if (has_curves) { - quantized_curve_t curve(quantized); + snapped_curve_t curve(snapped); _draw_path(curve, has_clippath, face, gc); } else { - _draw_path(quantized, has_clippath, face, gc); + _draw_path(snapped, has_clippath, face, gc); } } else { gc.isaa = bool(Py::Int(antialiaseds[i % Naa])); Modified: trunk/matplotlib/src/_backend_agg.h =================================================================== --- trunk/matplotlib/src/_backend_agg.h 2010-06-15 13:01:22 UTC (rev 8436) +++ trunk/matplotlib/src/_backend_agg.h 2010-06-15 19:10:19 UTC (rev 8437) @@ -123,7 +123,7 @@ typedef std::vector<std::pair<double, double> > dash_t; double dashOffset; dash_t dashes; - e_quantize_mode quantize_mode; + e_snap_mode snap_mode; Py::Object hatchpath; Modified: trunk/matplotlib/src/_macosx.m =================================================================== --- trunk/matplotlib/src/_macosx.m 2010-06-15 13:01:22 UTC (rev 8436) +++ trunk/matplotlib/src/_macosx.m 2010-06-15 19:10:19 UTC (rev 8437) @@ -288,7 +288,7 @@ 0, 0, rect, - QUANTIZE_FALSE, + SNAP_FALSE, 1.0, 0); Py_DECREF(transform); @@ -446,13 +446,13 @@ return p; } -static int _get_snap(GraphicsContext* self, enum e_quantize_mode* mode) +static int _get_snap(GraphicsContext* self, enum e_snap_mode* mode) { PyObject* snap = PyObject_CallMethod((PyObject*)self, "get_snap", ""); if(!snap) return 0; - if(snap==Py_None) *mode = QUANTIZE_AUTO; - else if (PyBool_Check(snap)) *mode = QUANTIZE_TRUE; - else *mode = QUANTIZE_FALSE; + if(snap==Py_None) *mode = SNAP_AUTO; + else if (PyBool_Check(snap)) *mode = SNAP_TRUE; + else *mode = SNAP_FALSE; Py_DECREF(snap); return 1; } @@ -662,7 +662,7 @@ 0, 0, rect, - QUANTIZE_AUTO, + SNAP_AUTO, 1.0, 0); Py_DECREF(transform); @@ -892,7 +892,7 @@ 1, 0, rect, - QUANTIZE_AUTO, + SNAP_AUTO, linewidth, rgbFace == NULL); if (!iterator) @@ -970,7 +970,7 @@ 1, 0, rect, - QUANTIZE_AUTO, + SNAP_AUTO, linewidth, 0); if (!iterator) @@ -1006,7 +1006,7 @@ CGMutablePathRef marker; void* iterator; double rect[4] = {0.0, 0.0, self->size.width, self->size.height}; - enum e_quantize_mode mode; + enum e_snap_mode mode; double xc, yc; unsigned code; @@ -1071,7 +1071,7 @@ 1, 1, rect, - QUANTIZE_TRUE, + SNAP_TRUE, 1.0, 0); if (!iterator) @@ -1225,7 +1225,7 @@ /* --------- Prepare some variables for the path iterator ------------- */ void* iterator; double rect[4] = {0.0, 0.0, self->size.width, self->size.height}; - enum e_quantize_mode mode; + enum e_snap_mode mode; ok = _get_snap(self, &mode); if (!ok) { @@ -1382,7 +1382,7 @@ 0, 0, rect, - QUANTIZE_AUTO, + SNAP_AUTO, 1.0, 0); if (!iterator) @@ -1690,7 +1690,7 @@ 0, 0, rect, - QUANTIZE_AUTO, + SNAP_AUTO, 1.0, 0); if (iterator) @@ -2676,7 +2676,7 @@ 0, 0, rect, - QUANTIZE_AUTO, + SNAP_AUTO, 1.0, 0); if (iterator) Modified: trunk/matplotlib/src/_path.cpp =================================================================== --- trunk/matplotlib/src/_path.cpp 2010-06-15 13:01:22 UTC (rev 8436) +++ trunk/matplotlib/src/_path.cpp 2010-06-15 19:10:19 UTC (rev 8437) @@ -55,7 +55,7 @@ add_varargs_method("convert_path_to_polygons", &_path_module::convert_path_to_polygons, "convert_path_to_polygons(path, trans, width, height)"); add_varargs_method("cleanup_path", &_path_module::cleanup_path, - "cleanup_path(path, trans, remove_nans, clip, quantize, simplify, curves)"); + "cleanup_path(path, trans, remove_nans, clip, snap, simplify, curves)"); initialize("Helper functions for paths"); } @@ -1228,22 +1228,22 @@ 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, double stroke_width, + e_snap_mode snap_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; typedef PathClipper<nan_removal_t> clipped_t; - typedef PathQuantizer<clipped_t> quantized_t; - typedef PathSimplifier<quantized_t> simplify_t; + typedef PathSnapper<clipped_t> snapped_t; + typedef PathSimplifier<snapped_t> simplify_t; typedef agg::conv_curve<simplify_t> curve_t; 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(), stroke_width); - simplify_t simplified(quantized, do_simplify, path.simplify_threshold()); + snapped_t snapped(clipped, snap_mode, path.total_vertices(), stroke_width); + simplify_t simplified(snapped, do_simplify, path.simplify_threshold()); vertices.reserve(path.total_vertices() * 2); codes.reserve(path.total_vertices()); @@ -1286,19 +1286,19 @@ do_clip = true; } - Py::Object quantize_obj = args[4]; - e_quantize_mode quantize_mode; - if (quantize_obj.isNone()) + Py::Object snap_obj = args[4]; + e_snap_mode snap_mode; + if (snap_obj.isNone()) { - quantize_mode = QUANTIZE_AUTO; + snap_mode = SNAP_AUTO; } - else if (quantize_obj.isTrue()) + else if (snap_obj.isTrue()) { - quantize_mode = QUANTIZE_TRUE; + snap_mode = SNAP_TRUE; } else { - quantize_mode = QUANTIZE_FALSE; + snap_mode = SNAP_FALSE; } double stroke_width = Py::Float(args[5]); @@ -1319,7 +1319,7 @@ std::vector<double> vertices; std::vector<npy_uint8> codes; - _cleanup_path(path, trans, remove_nans, do_clip, clip_rect, quantize_mode, + _cleanup_path(path, trans, remove_nans, do_clip, clip_rect, snap_mode, stroke_width, simplify, return_curves, vertices, codes); npy_intp length = codes.size(); Modified: trunk/matplotlib/src/path_cleanup.cpp =================================================================== --- trunk/matplotlib/src/path_cleanup.cpp 2010-06-15 13:01:22 UTC (rev 8436) +++ trunk/matplotlib/src/path_cleanup.cpp 2010-06-15 19:10:19 UTC (rev 8437) @@ -12,8 +12,8 @@ typedef agg::conv_transform<PathIterator> transformed_path_t; typedef PathNanRemover<transformed_path_t> nan_removal_t; typedef PathClipper<nan_removal_t> clipped_t; - typedef PathQuantizer<clipped_t> quantized_t; - typedef PathSimplifier<quantized_t> simplify_t; + typedef PathSnapper<clipped_t> snapped_t; + typedef PathSimplifier<snapped_t> simplify_t; Py::Object m_path_obj; PathIterator m_path_iter; @@ -21,14 +21,14 @@ transformed_path_t m_transformed; nan_removal_t m_nan_removed; clipped_t m_clipped; - quantized_t m_quantized; + snapped_t m_snapped; simplify_t m_simplify; public: PathCleanupIterator(PyObject* path, agg::trans_affine trans, bool remove_nans, bool do_clip, const agg::rect_base<double>& rect, - e_quantize_mode quantize_mode, double stroke_width, + e_snap_mode snap_mode, double stroke_width, bool do_simplify) : m_path_obj(path, true), m_path_iter(m_path_obj), @@ -36,9 +36,9 @@ 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(), - stroke_width), - m_simplify(m_quantized, do_simplify && m_path_iter.should_simplify(), + m_snapped(m_clipped, snap_mode, m_path_iter.total_vertices(), + stroke_width), + m_simplify(m_snapped, do_simplify && m_path_iter.should_simplify(), m_path_iter.simplify_threshold()) { Py_INCREF(path); @@ -55,7 +55,7 @@ void* get_path_iterator( PyObject* path, PyObject* trans, int remove_nans, int do_clip, - double rect[4], e_quantize_mode quantize_mode, double stroke_width, + double rect[4], e_snap_mode snap_mode, double stroke_width, int do_simplify) { agg::trans_affine agg_trans = py_to_agg_transformation_matrix(trans, false); @@ -63,7 +63,7 @@ PathCleanupIterator* pipeline = new PathCleanupIterator( path, agg_trans, remove_nans != 0, do_clip != 0, - clip_rect, quantize_mode, stroke_width, do_simplify != 0); + clip_rect, snap_mode, stroke_width, do_simplify != 0); return (void*)pipeline; } Modified: trunk/matplotlib/src/path_cleanup.h =================================================================== --- trunk/matplotlib/src/path_cleanup.h 2010-06-15 13:01:22 UTC (rev 8436) +++ trunk/matplotlib/src/path_cleanup.h 2010-06-15 19:10:19 UTC (rev 8437) @@ -3,17 +3,17 @@ #include <Python.h> -enum e_quantize_mode +enum e_snap_mode { - QUANTIZE_AUTO, - QUANTIZE_FALSE, - QUANTIZE_TRUE + SNAP_AUTO, + SNAP_FALSE, + SNAP_TRUE }; void* get_path_iterator( PyObject* path, PyObject* trans, int remove_nans, int do_clip, - double rect[4], enum e_quantize_mode quantize_mode, double stroke_width, + double rect[4], enum e_snap_mode snap_mode, double stroke_width, int do_simplify); unsigned Modified: trunk/matplotlib/src/path_converters.h =================================================================== --- trunk/matplotlib/src/path_converters.h 2010-06-15 13:01:22 UTC (rev 8436) +++ trunk/matplotlib/src/path_converters.h 2010-06-15 19:10:19 UTC (rev 8437) @@ -26,7 +26,7 @@ Agg where coordinates can not be larger than 24-bit signed integers. - 4. PathQuantizer: Rounds the path to the nearest center-pixels. + 4. PathSnapper: Rounds the path to the nearest center-pixels. This makes rectilinear curves look much better. 5. PathSimplifier: Removes line segments from highly dense paths @@ -361,36 +361,36 @@ }; /************************************************************ - PathQuantizer rounds vertices to their nearest center-pixels. This + PathSnapper rounds vertices to their nearest center-pixels. This makes rectilinear paths (rectangles, horizontal and vertical lines etc.) look much cleaner. */ -enum e_quantize_mode +enum e_snap_mode { - QUANTIZE_AUTO, - QUANTIZE_FALSE, - QUANTIZE_TRUE + SNAP_AUTO, + SNAP_FALSE, + SNAP_TRUE }; template<class VertexSource> -class PathQuantizer +class PathSnapper { private: VertexSource* m_source; - bool m_quantize; - double m_quantize_value; + bool m_snap; + double m_snap_value; - static bool should_quantize(VertexSource& path, - e_quantize_mode quantize_mode, - unsigned total_vertices) { + static bool should_snap(VertexSource& path, + e_snap_mode snap_mode, + unsigned total_vertices) { // If this contains only straight horizontal or vertical lines, it should be - // quantized to the nearest pixels + // snapped to the nearest pixels double x0, y0, x1, y1; unsigned code; - switch (quantize_mode) + switch (snap_mode) { - case QUANTIZE_AUTO: + case SNAP_AUTO: if (total_vertices > 1024) { return false; @@ -420,9 +420,9 @@ } return true; - case QUANTIZE_FALSE: + case SNAP_FALSE: return false; - case QUANTIZE_TRUE: + case SNAP_TRUE: return true; } @@ -431,21 +431,21 @@ public: /* - quantize_mode should be one of: - - QUANTIZE_AUTO: Examine the path to determine if it should be quantized - - QUANTIZE_TRUE: Force quantization - - QUANTIZE_FALSE: No quantization + snap_mode should be one of: + - SNAP_AUTO: Examine the path to determine if it should be snapped + - SNAP_TRUE: Force snapping + - SNAP_FALSE: No snapping */ - PathQuantizer(VertexSource& source, e_quantize_mode quantize_mode, + PathSnapper(VertexSource& source, e_snap_mode snap_mode, unsigned total_vertices=15, double stroke_width=0.0) : m_source(&source) { - m_quantize = should_quantize(source, quantize_mode, total_vertices); + m_snap = should_snap(source, snap_mode, total_vertices); - if (m_quantize) + if (m_snap) { - int odd_even = (int)mpl_round(stroke_width) % 2; - m_quantize_value = (odd_even) ? 0.5 : 0.0; + int is_odd = (int)mpl_round(stroke_width) % 2; + m_snap_value = (is_odd) ? 0.5 : 0.0; } source.rewind(0); @@ -460,17 +460,17 @@ { unsigned code; code = m_source->vertex(x, y); - if (m_quantize && agg::is_vertex(code)) - { - *x = mpl_round(*x) + m_quantize_value; - *y = mpl_round(*y) + m_quantize_value; + if (m_snap && agg::is_vertex(code)) + { + *x = mpl_round(*x) + m_snap_value; + *y = mpl_round(*y) + m_snap_value; } return code; } - inline bool is_quantizing() + inline bool is_snapping() { - return m_quantize; + return m_snap; } }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2010-06-20 16:46:40
|
Revision: 8443 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8443&view=rev Author: efiring Date: 2010-06-20 16:46:34 +0000 (Sun, 20 Jun 2010) Log Message: ----------- finance: restore original adjustment algorithm, but use ndarray. A numpy recarray replaces the Bunch when asobject is True. Additional fields are provided. Modified Paths: -------------- trunk/matplotlib/examples/pylab_examples/date_demo1.py trunk/matplotlib/examples/pylab_examples/date_demo2.py trunk/matplotlib/examples/pylab_examples/finance_demo.py trunk/matplotlib/lib/matplotlib/finance.py Modified: trunk/matplotlib/examples/pylab_examples/date_demo1.py =================================================================== --- trunk/matplotlib/examples/pylab_examples/date_demo1.py 2010-06-20 01:34:30 UTC (rev 8442) +++ trunk/matplotlib/examples/pylab_examples/date_demo1.py 2010-06-20 16:46:34 UTC (rev 8443) @@ -27,7 +27,7 @@ quotes = quotes_historical_yahoo( 'INTC', date1, date2) -if not quotes: +if len(quotes) == 0: raise SystemExit dates = [q[0] for q in quotes] Modified: trunk/matplotlib/examples/pylab_examples/date_demo2.py =================================================================== --- trunk/matplotlib/examples/pylab_examples/date_demo2.py 2010-06-20 01:34:30 UTC (rev 8442) +++ trunk/matplotlib/examples/pylab_examples/date_demo2.py 2010-06-20 16:46:34 UTC (rev 8443) @@ -23,7 +23,7 @@ quotes = quotes_historical_yahoo('INTC', date1, date2) -if not quotes: +if len(quotes) == 0: print 'Found no quotes' raise SystemExit Modified: trunk/matplotlib/examples/pylab_examples/finance_demo.py =================================================================== --- trunk/matplotlib/examples/pylab_examples/finance_demo.py 2010-06-20 01:34:30 UTC (rev 8442) +++ trunk/matplotlib/examples/pylab_examples/finance_demo.py 2010-06-20 16:46:34 UTC (rev 8443) @@ -5,20 +5,18 @@ from matplotlib.finance import quotes_historical_yahoo, candlestick,\ plot_day_summary, candlestick2 -import datetime +# (Year, month, day) tuples suffice as args for quotes_historical_yahoo +date1 = ( 2004, 2, 1) +date2 = ( 2004, 4, 12 ) -date1 = datetime.date( 2004, 2, 1) -date2 = datetime.date( 2004, 4, 12 ) - mondays = WeekdayLocator(MONDAY) # major ticks on the mondays alldays = DayLocator() # minor ticks on the days weekFormatter = DateFormatter('%b %d') # Eg, Jan 12 dayFormatter = DateFormatter('%d') # Eg, 12 -quotes = quotes_historical_yahoo( - 'INTC', date1, date2) -if not quotes: +quotes = quotes_historical_yahoo('INTC', date1, date2) +if len(quotes) == 0: raise SystemExit fig = figure() Modified: trunk/matplotlib/lib/matplotlib/finance.py =================================================================== --- trunk/matplotlib/lib/matplotlib/finance.py 2010-06-20 01:34:30 UTC (rev 8442) +++ trunk/matplotlib/lib/matplotlib/finance.py 2010-06-20 16:46:34 UTC (rev 8443) @@ -11,90 +11,130 @@ from hashlib import md5 except ImportError: from md5 import md5 #Deprecated in 2.5 +import datetime -try: import datetime -except ImportError: - raise ImportError('The finance module requires datetime support (python2.3)') - import numpy as np from matplotlib import verbose, get_configdir -from dates import date2num -from matplotlib.cbook import Bunch +from matplotlib.dates import date2num +from matplotlib.cbook import iterable, is_string_like from matplotlib.collections import LineCollection, PolyCollection from matplotlib.colors import colorConverter -from lines import Line2D, TICKLEFT, TICKRIGHT -from patches import Rectangle +from matplotlib.lines import Line2D, TICKLEFT, TICKRIGHT +from matplotlib.patches import Rectangle from matplotlib.transforms import Affine2D - configdir = get_configdir() cachedir = os.path.join(configdir, 'finance.cache') -def parse_yahoo_historical(fh, asobject=False, adjusted=True): +stock_dt = np.dtype([('date', object), + ('year', np.int16), + ('month', np.int8), + ('day', np.int8), + ('d', np.float), # mpl datenum + ('open', np.float), + ('close', np.float), + ('high', np.float), + ('low', np.float), + ('volume', np.int), + ('aclose', np.float)]) + + +def parse_yahoo_historical(fh, adjusted=True, asobject=False): """ - Parse the historical data in file handle fh from yahoo finance and return - results as a list of + Parse the historical data in file handle fh from yahoo finance. - d, open, close, high, low, volume + *adjusted* + If True (default) replace open, close, high, low, and volume with + their adjusted values. + The adjustment is by a scale factor, S = adjusted_close/close. + Adjusted volume is actual volume divided by S; + Adjusted prices are actual prices multiplied by S. Hence, + the product of price and volume is unchanged by the adjustment. - where d is a floating poing representation of date, as returned by date2num + *asobject* + If False (default for compatibility with earlier versions) + return a list of tuples containing - 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. + d, open, close, high, low, volume + + If None (preferred alternative to False), return + a 2-D ndarray corresponding to the list of tuples. + + Otherwise return a numpy recarray with + + date, year, month, day, d, open, close, high, low, + volume, adjusted_close + + where d is a floating poing representation of date, + as returned by date2num, and date is a python standard + library datetime.date instance. + + The name of this kwarg is a historical artifact. Formerly, + True returned a cbook Bunch + holding 1-D ndarrays. The behavior of a numpy recarray is + very similar to the Bunch. + """ - results = [] lines = fh.readlines() - datefmt = None + results = [] + datefmt = '%Y-%m-%d' + for line in lines[1:]: vals = line.split(',') - - if len(vals)!=7: continue + if len(vals)!=7: + continue # add warning? datestr = vals[0] - if datefmt is None: - try: - datefmt = '%Y-%m-%d' - dt = datetime.date(*time.strptime(datestr, datefmt)[:3]) - except ValueError: - datefmt = '%d-%b-%y' # Old Yahoo--cached file? - dt = datetime.date(*time.strptime(datestr, datefmt)[:3]) - d = date2num(dt) + #dt = datetime.date(*time.strptime(datestr, datefmt)[:3]) + # Using strptime doubles the runtime. With the present + # format, we don't need it. + dt = datetime.date(*[int(val) for val in datestr.split('-')]) + dnum = date2num(dt) open, high, low, close = [float(val) for val in vals[1:5]] volume = int(vals[5]) - if adjusted: - aclose = float(vals[6]) - delta = aclose-close - open += delta - high += delta - low += delta - close = aclose + aclose = float(vals[6]) - results.append((d, open, close, high, low, volume)) + results.append((dt, dt.year, dt.month, dt.day, + dnum, open, close, high, low, volume, aclose)) results.reverse() - if asobject: - if len(results)==0: return None - else: - date, open, close, high, low, volume = map(np.asarray, zip(*results)) - return Bunch(date=date, open=open, close=close, high=high, low=low, volume=volume) - else: + d = np.array(results, dtype=stock_dt) + if adjusted: + scale = d['aclose'] / d['close'] + scale[np.isinf(scale)] = np.nan + d['open'] *= scale + d['close'] *= scale + d['high'] *= scale + d['low'] *= scale - return results + if not asobject: + # 2-D sequence; formerly list of tuples, now ndarray + ret = np.zeros((len(d), 6), dtype=np.float) + ret[:,0] = d['d'] + ret[:,1] = d['open'] + ret[:,2] = d['close'] + ret[:,3] = d['high'] + ret[:,4] = d['low'] + ret[:,5] = d['volume'] + if asobject is None: + return ret + return [tuple(row) for row in ret] + return d.view(np.recarray) # Close enough to former Bunch return + + def fetch_historical_yahoo(ticker, date1, date2, cachename=None): """ Fetch historical data for ticker between date1 and date2. date1 and - date2 are datetime instances + date2 are date or datetime instances, or (year, month, day) sequences. Ex: - fh = fetch_historical_yahoo('^GSPC', d1, d2) + fh = fetch_historical_yahoo('^GSPC', (2000, 1, 1), (2001, 12, 31)) cachename is the name of the local file cache. If None, will default to the md5 hash or the url (which incorporates the ticker @@ -106,8 +146,14 @@ ticker = ticker.upper() - d1 = (date1.month-1, date1.day, date1.year) - d2 = (date2.month-1, date2.day, date2.year) + if iterable(date1): + d1 = (date1[1]-1, date1[2], date1[0]) + else: + d1 = (date1.month-1, date1.day, date1.year) + if iterable(date2): + d2 = (date2[1]-1, date2[2], date2[0]) + else: + d2 = (date2.month-1, date2.day, date2.year) urlFmt = 'http://table.finance.yahoo.com/table.csv?a=%d&b=%d&c=%d&d=%d&e=%d&f=%d&s=%s&y=0&g=d&ignore=.csv' @@ -123,7 +169,8 @@ fh = file(cachename) verbose.report('Using cachefile %s for %s'%(cachename, ticker)) else: - if not os.path.isdir(cachedir): os.mkdir(cachedir) + if not os.path.isdir(cachedir): + os.mkdir(cachedir) urlfh = urlopen(url) fh = file(cachename, 'w') @@ -135,27 +182,18 @@ return fh -def quotes_historical_yahoo(ticker, date1, date2, asobject=False, adjusted=True, cachename=None): +def quotes_historical_yahoo(ticker, date1, date2, asobject=False, + adjusted=True, cachename=None): """ Get historical data for ticker between date1 and date2. date1 and - date2 are datetime instances + date2 are datetime instances or (year, month, day) sequences. - results are a list of tuples + See :func:`parse_yahoo_historical` for explanation of output formats + and the *asobject* and *adjusted* kwargs. - (d, open, close, high, low, volume) - - where d is a floating poing representation of date, as returned by date2num - - if asobject is True, the return val is an object with attrs date, - open, close, high, low, volume, which are equal length arrays - - 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) + sp = f.quotes_historical_yahoo('^GSPC', d1, d2, + asobject=True, adjusted=True) returns = (sp.open[1:] - sp.open[:-1])/sp.open[1:] [n,bins,patches] = hist(returns, 100) mu = mean(returns) @@ -167,10 +205,18 @@ default to the md5 hash or the url (which incorporates the ticker and date range) """ + # Maybe enable a warning later as part of a slow transition + # to using None instead of False. + #if asobject is False: + # warnings.warn("Recommend changing to asobject=None") fh = fetch_historical_yahoo(ticker, date1, date2, cachename) - try: ret = parse_yahoo_historical(fh, asobject, adjusted) + try: + ret = parse_yahoo_historical(fh, asobject=asobject, + adjusted=adjusted) + if len(ret) == 0: + return None except IOError, exc: warnings.warn('urlopen() failure\n' + url + '\n' + exc.strerror[1]) return None @@ -181,7 +227,7 @@ colorup='k', colordown='r', ): """ - quotes is a list of (time, open, close, high, low, ...) tuples + quotes is a sequence of (time, open, close, high, low, ...) sequences Represent the time, open, close, high, low as a vertical line ranging from low to high. The left tick is the open and the right @@ -196,9 +242,6 @@ return value is a list of lines added """ - - - lines = [] for q in quotes: @@ -244,9 +287,9 @@ """ - quotes is a list of (time, open, close, high, low, ...) tuples. - As long as the first 5 elements of the tuples are these values, - the tuple can be as long as you want (eg it may store volume). + quotes is a sequence of (time, open, close, high, low, ...) sequences. + As long as the first 5 elements are these values, + the record can be as long as you want (eg it may store volume). time must be in float days format - see date2num @@ -263,12 +306,11 @@ return value is lines, patches where lines is a list of lines added and patches is a list of the rectangle patches added + """ - OFFSET = width/2.0 - lines = [] patches = [] for q in quotes: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lee...@us...> - 2010-06-20 23:31:55
|
Revision: 8447 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8447&view=rev Author: leejjoon Date: 2010-06-20 23:31:49 +0000 (Sun, 20 Jun 2010) Log Message: ----------- revert r8445,8446 and fix plot_directive.py to support sphinx 1.0 Modified Paths: -------------- trunk/matplotlib/doc/faq/howto_faq.rst trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py Modified: trunk/matplotlib/doc/faq/howto_faq.rst =================================================================== --- trunk/matplotlib/doc/faq/howto_faq.rst 2010-06-20 20:55:42 UTC (rev 8446) +++ trunk/matplotlib/doc/faq/howto_faq.rst 2010-06-20 23:31:49 UTC (rev 8447) @@ -178,6 +178,9 @@ of each of the labels and uses it to move the left of the subplots over so that the tick labels fit in the figure +.. plot:: pyplots/auto_subplots_adjust.py + :include-source: + .. _howto-ticks: Configure the tick linewidths @@ -218,6 +221,9 @@ below shows the default behavior in the left subplots, and the manual setting in the right subplots. +.. plot:: pyplots/align_ylabels.py + :include-source: + .. _date-index-plots: Skip dates where there is no data Modified: trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py =================================================================== --- trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py 2010-06-20 20:55:42 UTC (rev 8446) +++ trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py 2010-06-20 23:31:49 UTC (rev 8447) @@ -366,8 +366,13 @@ if options.has_key('include-source'): if plot_code is None: + if sphinx_version > (1,): + include_prefix = '/' + else: + include_prefix = setup.app.builder.srcdir + lines.extend( - ['.. include:: %s' % os.path.join(setup.app.builder.srcdir, plot_path), + ['.. include:: %s' % os.path.join(include_prefix, plot_path), ' :literal:']) if options.has_key('encoding'): lines.append(' :encoding: %s' % options['encoding']) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2010-06-21 08:51:37
|
Revision: 8448 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8448&view=rev Author: efiring Date: 2010-06-21 08:51:30 +0000 (Mon, 21 Jun 2010) Log Message: ----------- Add Axes.tick_params and pyplot.tick_params to control tick and tick label appearance. This allows interactive modification of tick and tick label color, size, etc. Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/boilerplate.py trunk/matplotlib/lib/matplotlib/axes.py trunk/matplotlib/lib/matplotlib/axis.py trunk/matplotlib/lib/matplotlib/pyplot.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2010-06-20 23:31:49 UTC (rev 8447) +++ trunk/matplotlib/CHANGELOG 2010-06-21 08:51:30 UTC (rev 8448) @@ -1,3 +1,7 @@ +2010-06-20 Added Axes.tick_params and corresponding pyplot function + to control tick and tick label appearance after an Axes + has been created. - EF + 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 Modified: trunk/matplotlib/boilerplate.py =================================================================== --- trunk/matplotlib/boilerplate.py 2010-06-20 23:31:49 UTC (rev 8447) +++ trunk/matplotlib/boilerplate.py 2010-06-21 08:51:30 UTC (rev 8448) @@ -107,6 +107,7 @@ 'annotate', 'ticklabel_format', 'locator_params', + 'tick_params', 'margins', ) Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-06-20 23:31:49 UTC (rev 8447) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-06-21 08:51:30 UTC (rev 8448) @@ -2101,7 +2101,82 @@ self.yaxis.get_major_locator().set_params(**kwargs) self.autoscale_view(tight=tight, scalex=_x, scaley=_y) + def tick_params(self, axis='both', **kwargs): + """ + Convenience method for changing the appearance of ticks and + tick labels. + Keyword arguments: + + *axis* + ['x' | 'y' | 'both'] Axis on which to operate; + default is 'both'. + + *reset* + [True | False] If *True*, set all parameters to defaults + before processing other keyword arguments. Default is + *False*. + + *which* + ['major' | 'minor' | 'both'] Default is 'major': apply + arguments to major ticks only. + + *direction* + ['in' | 'out'] Puts ticks inside or outside the axes. + + *length* + Tick length in points. + + *width* + Tick width in points. + + *color* + Tick color; accepts any mpl color spec. + + *pad* + Distance in points between tick and label. + + *labelsize* + Tick label font size in points or as a string (e.g. 'large'). + + *labelcolor* + Tick label color; mpl color spec. + + *colors* + Changes the tick color and the label color to the same value: + mpl color spec. + + *zorder* + Tick and label zorder. + + *bottom*, *top*, *left*, *right* + Boolean or ['on' | 'off'], controls whether to draw the + respective ticks. + + *labelbottom*, *labeltop*, *labelleft*, *labelright* + Boolean or ['on' | 'off'], controls whether to draw the + respective tick labels. + + Example:: + + ax.tick_params(direction='out', length=6, width=2, colors='r') + + This will make all major ticks be red, pointing out of the box, + and with dimensions 6 points by 2 points. Tick labels will + also be red. + + """ + if axis in ['x', 'both']: + xkw = dict(kwargs) + xkw.pop('top', None) + xkw.pop('bottom', None) + self.xaxis.set_tick_params(**xkw) + if axis in ['y', 'both']: + ykw = dict(kwargs) + ykw.pop('left', None) + ykw.pop('right', None) + self.yaxis.set_tick_params(**ykw) + def set_axis_off(self): """turn off the axis""" self.axison = False Modified: trunk/matplotlib/lib/matplotlib/axis.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axis.py 2010-06-20 23:31:49 UTC (rev 8447) +++ trunk/matplotlib/lib/matplotlib/axis.py 2010-06-21 08:51:30 UTC (rev 8448) @@ -60,7 +60,16 @@ """ def __init__(self, axes, loc, label, - size = None, # points + + size = None, # points + width = None, + color = None, + tickdir = None, + pad = None, + labelsize = None, + labelcolor = None, + zorder = None, + gridOn = None, # defaults to axes.grid tick1On = True, tick2On = True, @@ -71,7 +80,7 @@ """ bbox is the Bound2D bounding box in display coords of the Axes loc is the tick location in data coords - size is the tick size in relative, axes coords + size is the tick size in points """ artist.Artist.__init__(self) @@ -81,27 +90,47 @@ self.axes = axes name = self.__name__.lower() + self._name = name + + self._loc = loc + if size is None: if major: size = rcParams['%s.major.size'%name] + else: + size = rcParams['%s.minor.size'%name] + self._size = size + + self._width = width # can be None for marker default + + if color is None: + color = rcParams['%s.color' % name] + self._color = color + + if pad is None: + if major: pad = rcParams['%s.major.pad'%name] else: - size = rcParams['%s.minor.size'%name] pad = rcParams['%s.minor.pad'%name] + self._base_pad = pad - self._tickdir = rcParams['%s.direction'%name] - if self._tickdir == 'in': - self._xtickmarkers = (mlines.TICKUP, mlines.TICKDOWN) - self._ytickmarkers = (mlines.TICKRIGHT, mlines.TICKLEFT) - self._pad = pad - else: - self._xtickmarkers = (mlines.TICKDOWN, mlines.TICKUP) - self._ytickmarkers = (mlines.TICKLEFT, mlines.TICKRIGHT) - self._pad = pad + size + if labelcolor is None: + labelcolor = rcParams['%s.color' % name] + self._labelcolor = labelcolor - self._loc = loc - self._size = size + if labelsize is None: + labelsize = rcParams['%s.labelsize' % name] + self._labelsize = labelsize + if zorder is None: + if major: + zorder = mlines.Line2D.zorder + 0.01 + else: + zorder = mlines.Line2D.zorder + self._zorder = zorder + + self.apply_tickdir(tickdir) + self.tick1line = self._get_tick1line() self.tick2line = self._get_tick2line() self.gridline = self._get_gridline() @@ -118,6 +147,20 @@ self.update_position(loc) + def apply_tickdir(self, tickdir): + if tickdir is None: + tickdir = rcParams['%s.direction' % self._name] + self._tickdir = tickdir + + if self._tickdir == 'in': + self._xtickmarkers = (mlines.TICKUP, mlines.TICKDOWN) + self._ytickmarkers = (mlines.TICKRIGHT, mlines.TICKLEFT) + self._pad = self._base_pad + else: + self._xtickmarkers = (mlines.TICKDOWN, mlines.TICKUP) + self._ytickmarkers = (mlines.TICKLEFT, mlines.TICKRIGHT) + self._pad = self._base_pad + self._size + def get_children(self): children = [self.tick1line, self.tick2line, self.gridline, self.label1, self.label2] return children @@ -242,15 +285,13 @@ # x in data coords, y in axes coords #t = mtext.Text( trans, vert, horiz = self.axes.get_xaxis_text1_transform(self._pad) - size = rcParams['xtick.labelsize'] t = mtext.Text( x=0, y=0, - fontproperties=font_manager.FontProperties(size=size), - color=rcParams['xtick.color'], + fontproperties=font_manager.FontProperties(size=self._labelsize), + color=self._labelcolor, verticalalignment=vert, horizontalalignment=horiz, ) - t.set_transform(trans) self._set_artist_props(t) return t @@ -262,11 +303,10 @@ # x in data coords, y in axes coords #t = mtext.Text( trans, vert, horiz = self.axes.get_xaxis_text2_transform(self._pad) - t = mtext.Text( x=0, y=1, - fontproperties=font_manager.FontProperties(size=rcParams['xtick.labelsize']), - color=rcParams['xtick.color'], + fontproperties=font_manager.FontProperties(size=self._labelsize), + color=self._labelcolor, verticalalignment=vert, horizontalalignment=horiz, ) @@ -278,10 +318,12 @@ 'Get the default line2D instance' # x in data coords, y in axes coords l = mlines.Line2D(xdata=(0,), ydata=(0,), - color='k', + color=self._color, linestyle = 'None', marker = self._xtickmarkers[0], markersize=self._size, + markeredgewidth=self._width, + zorder=self._zorder, ) l.set_transform(self.axes.get_xaxis_transform(which='tick1')) self._set_artist_props(l) @@ -291,10 +333,12 @@ 'Get the default line2D instance' # x in data coords, y in axes coords l = mlines.Line2D( xdata=(0,), ydata=(1,), - color='k', + color=self._color, linestyle = 'None', marker = self._xtickmarkers[1], markersize=self._size, + markeredgewidth=self._width, + zorder=self._zorder, ) l.set_transform(self.axes.get_xaxis_transform(which='tick2')) @@ -372,13 +416,11 @@ def _get_text1(self): 'Get the default Text instance' # x in axes coords, y in data coords - #t = mtext.Text( trans, vert, horiz = self.axes.get_yaxis_text1_transform(self._pad) - t = mtext.Text( x=0, y=0, - fontproperties=font_manager.FontProperties(size=rcParams['ytick.labelsize']), - color=rcParams['ytick.color'], + fontproperties=font_manager.FontProperties(size=self._labelsize), + color=self._labelcolor, verticalalignment=vert, horizontalalignment=horiz, ) @@ -390,13 +432,11 @@ def _get_text2(self): 'Get the default Text instance' # x in axes coords, y in data coords - #t = mtext.Text( trans, vert, horiz = self.axes.get_yaxis_text2_transform(self._pad) - t = mtext.Text( x=1, y=0, - fontproperties=font_manager.FontProperties(size=rcParams['ytick.labelsize']), - color=rcParams['ytick.color'], + fontproperties=font_manager.FontProperties(size=self._labelsize), + color=self._labelcolor, verticalalignment=vert, horizontalalignment=horiz, ) @@ -408,11 +448,14 @@ 'Get the default line2D instance' # x in axes coords, y in data coords - l = mlines.Line2D( (0,), (0,), color='k', + l = mlines.Line2D( (0,), (0,), + color=self._color, marker = self._ytickmarkers[0], linestyle = 'None', markersize=self._size, - ) + markeredgewidth=self._width, + zorder=self._zorder, + ) l.set_transform(self.axes.get_yaxis_transform(which='tick1')) self._set_artist_props(l) return l @@ -420,12 +463,14 @@ def _get_tick2line(self): 'Get the default line2D instance' # x in axes coords, y in data coords - l = mlines.Line2D( (1,), (0,), color='k', + l = mlines.Line2D( (1,), (0,), + color=self._color, marker = self._ytickmarkers[1], linestyle = 'None', markersize=self._size, + markeredgewidth=self._width, + zorder=self._zorder, ) - l.set_transform(self.axes.get_yaxis_transform(which='tick2')) self._set_artist_props(l) return l @@ -549,6 +594,10 @@ self.minorTicks = [] self.pickradius = pickradius + # Initialize here for testing; later add API + self._major_tick_kw = dict() + self._minor_tick_kw = dict() + self.cla() self.set_scale('linear') @@ -631,10 +680,16 @@ self.label.set_text('') self._set_artist_props(self.label) + self.reset_ticks() + + self.converter = None + self.units = None + self.set_units(None) + + def reset_ticks(self): # build a few default ticks; grow as necessary later; only # define 1 so properties set on ticks will be copied as they # grow - cbook.popall(self.majorTicks) cbook.popall(self.minorTicks) @@ -643,10 +698,84 @@ self._lastNumMajorTicks = 1 self._lastNumMinorTicks = 1 - self.converter = None - self.units = None - self.set_units(None) + def set_tick_params(self, which='major', reset=False, **kw): + """ + Set appearance parameters for ticks and ticklabels. + For documentation of keyword arguments, see + :meth:`matplotlib.axes.Axes.tick_params`. + """ + dicts = [] + if which == 'major' or which == 'both': + dicts.append(self._major_tick_kw) + if which == 'minor' or which == 'both': + dicts.append(self._minor_tick_kw) + kwtrans = self._translate_tick_kw(kw, to_init_kw=True) + for d in dicts: + if reset: + d.clear() + d.update(kwtrans) + self.reset_ticks() + + @staticmethod + def _translate_tick_kw(kw, to_init_kw=True): + # We may want to move the following function to + # a more visible location; or maybe there already + # is something like this. + def _bool(arg): + if cbook.is_string_like(arg): + if arg.lower() == 'on': + return True + if arg.lower() == 'off': + return False + raise ValueError('String "%s" should be "on" or "off"' % arg) + return bool(arg) + # The following lists may be moved to a more + # accessible location. + kwkeys0 = ['size', 'width', 'color', 'tickdir', 'pad', + 'labelsize', 'labelcolor', 'zorder', + 'tick1On', 'tick2On', 'label1On', 'label2On'] + kwkeys1 = ['length', 'direction', 'left', 'bottom', 'right', 'top', + 'labelleft', 'labelbottom', 'labelright', 'labeltop'] + kwkeys = kwkeys0 + kwkeys1 + kwtrans = dict() + if to_init_kw: + if 'length' in kw: + kwtrans['size'] = kw.pop('length') + if 'direction' in kw: + kwtrans['tickdir'] = kw.pop('direction') + if 'left' in kw: + kwtrans['tick1On'] = _bool(kw.pop('left')) + if 'bottom' in kw: + kwtrans['tick1On'] = _bool(kw.pop('bottom')) + if 'right' in kw: + kwtrans['tick2On'] = _bool(kw.pop('right')) + if 'top' in kw: + kwtrans['tick2On'] = _bool(kw.pop('top')) + + if 'labelleft' in kw: + kwtrans['label1On'] = _bool(kw.pop('labelleft')) + if 'labelbottom' in kw: + kwtrans['label1On'] = _bool(kw.pop('labelbottom')) + if 'labelright' in kw: + kwtrans['label2On'] = _bool(kw.pop('labelright')) + if 'labeltop' in kw: + kwtrans['label2On'] = _bool(kw.pop('labeltop')) + if 'colors' in kw: + c = kw.pop('colors') + kwtrans['color'] = c + kwtrans['labelcolor'] = c + # Maybe move the checking up to the caller of this method. + for key in kw: + if key not in kwkeys: + raise ValueError( + "keyword %s is not recognized; valid keywords are %s" + % (key, kwkeys)) + kwtrans.update(kw) + else: + raise NotImplementedError("Inverse translation is deferred") + return kwtrans + def set_clip_path(self, clippath, transform=None): artist.Artist.set_clip_path(self, clippath, transform) majorticks = self.get_major_ticks() @@ -1303,13 +1432,18 @@ return inaxis, {} def _get_tick(self, major): - return XTick(self.axes, 0, '', major=major) + if major: + tick_kw = self._major_tick_kw + else: + tick_kw = self._minor_tick_kw + return XTick(self.axes, 0, '', major=major, **tick_kw) def _get_label(self): # x in axes coords, y in display coords (to be updated at draw # time by _update_label_positions) label = mtext.Text(x=0.5, y=0, - fontproperties = font_manager.FontProperties(size=rcParams['axes.labelsize']), + fontproperties = font_manager.FontProperties( + size=rcParams['axes.labelsize']), color = rcParams['axes.labelcolor'], verticalalignment='top', horizontalalignment='center', @@ -1325,7 +1459,8 @@ def _get_offset_text(self): # x in axes coords, y in display coords (to be updated at draw time) offsetText = mtext.Text(x=1, y=0, - fontproperties = font_manager.FontProperties(size=rcParams['xtick.labelsize']), + fontproperties = font_manager.FontProperties( + size=rcParams['xtick.labelsize']), color = rcParams['xtick.color'], verticalalignment='top', horizontalalignment='right', @@ -1562,7 +1697,11 @@ return inaxis, {} def _get_tick(self, major): - return YTick(self.axes, 0, '', major=major) + if major: + tick_kw = self._major_tick_kw + else: + tick_kw = self._minor_tick_kw + return YTick(self.axes, 0, '', major=major, **tick_kw) def _get_label(self): @@ -1570,7 +1709,8 @@ # y in axes coords label = mtext.Text(x=0, y=0.5, # todo: get the label position - fontproperties=font_manager.FontProperties(size=rcParams['axes.labelsize']), + fontproperties=font_manager.FontProperties( + size=rcParams['axes.labelsize']), color = rcParams['axes.labelcolor'], verticalalignment='center', horizontalalignment='right', @@ -1586,7 +1726,8 @@ def _get_offset_text(self): # x in display coords, y in axes coords (to be updated at draw time) offsetText = mtext.Text(x=0, y=0.5, - fontproperties = font_manager.FontProperties(size=rcParams['ytick.labelsize']), + fontproperties = font_manager.FontProperties( + size=rcParams['ytick.labelsize']), color = rcParams['ytick.color'], verticalalignment = 'baseline', horizontalalignment = 'left', Modified: trunk/matplotlib/lib/matplotlib/pyplot.py =================================================================== --- trunk/matplotlib/lib/matplotlib/pyplot.py 2010-06-20 23:31:49 UTC (rev 8447) +++ trunk/matplotlib/lib/matplotlib/pyplot.py 2010-06-21 08:51:30 UTC (rev 8448) @@ -1936,8 +1936,7 @@ # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost @autogen_docstring(Axes.boxplot) -def boxplot(x, notch=0, sym='b+', vert=1, whis=1.5, positions=None, widths=None, - hold=None, patch_artist=False): +def boxplot(x, notch=0, sym='b+', vert=1, whis=1.5, positions=None, widths=None, patch_artist=False, bootstrap=None, hold=None): ax = gca() # allow callers to override the hold state by passing hold=True|False washold = ax.ishold() @@ -1945,8 +1944,7 @@ if hold is not None: ax.hold(hold) try: - ret = ax.boxplot(x, notch, sym, vert, whis, positions, widths, - patch_artist=patch_artist) + ret = ax.boxplot(x, notch, sym, vert, whis, positions, widths, patch_artist, bootstrap) draw_if_interactive() finally: ax.hold(washold) @@ -2136,7 +2134,7 @@ # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost @autogen_docstring(Axes.hist) -def hist(x, bins=10, range=None, normed=False, weights=None, cumulative=False, bottom=None, histtype='bar', align='mid', orientation='vertical', rwidth=None, log=False, hold=None, **kwargs): +def hist(x, bins=10, range=None, normed=False, weights=None, cumulative=False, bottom=None, histtype='bar', align='mid', orientation='vertical', rwidth=None, log=False, color=None, label=None, hold=None, **kwargs): ax = gca() # allow callers to override the hold state by passing hold=True|False washold = ax.ishold() @@ -2144,7 +2142,7 @@ if hold is not None: ax.hold(hold) try: - ret = ax.hist(x, bins, range, normed, weights, cumulative, bottom, histtype, align, orientation, rwidth, log, **kwargs) + ret = ax.hist(x, bins, range, normed, weights, cumulative, bottom, histtype, align, orientation, rwidth, log, color, label, **kwargs) draw_if_interactive() finally: ax.hold(washold) @@ -2421,7 +2419,6 @@ sci(ret[-1]) return ret - # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost @autogen_docstring(Axes.stem) @@ -2643,13 +2640,21 @@ # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost @docstring.copy_dedent(Axes.locator_params) -def locator_params(axis='both', tight=False, **kwargs): +def locator_params(axis='both', tight=None, **kwargs): ret = gca().locator_params(axis, tight, **kwargs) draw_if_interactive() return ret # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost +...@do...py_dedent(Axes.tick_params) +def tick_params(axis='both', **kwargs): + ret = gca().tick_params(axis, **kwargs) + draw_if_interactive() + return ret + +# This function was autogenerated by boilerplate.py. Do not edit as +# changes will be lost @docstring.copy_dedent(Axes.margins) def margins(*args, **kw): ret = gca().margins(*args, **kw) @@ -2879,3 +2884,6 @@ if im is not None: im.set_cmap(cm.spectral) draw_if_interactive() + + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2010-06-24 14:48:06
|
Revision: 8461 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8461&view=rev Author: mdboom Date: 2010-06-24 14:48:00 +0000 (Thu, 24 Jun 2010) Log Message: ----------- [3020704] set_xlim() problem Bug in PathClipper when vertices fall precisely on the clipping edge. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/tests/test_simplification.py trunk/matplotlib/src/path_converters.h Added Paths: ----------- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_simplification/clipper_edge.pdf trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_simplification/clipper_edge.png trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_simplification/clipper_edge.svg Added: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_simplification/clipper_edge.pdf =================================================================== (Binary files differ) Property changes on: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_simplification/clipper_edge.pdf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_simplification/clipper_edge.png =================================================================== (Binary files differ) Property changes on: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_simplification/clipper_edge.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_simplification/clipper_edge.svg =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_simplification/clipper_edge.svg (rev 0) +++ trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_simplification/clipper_edge.svg 2010-06-24 14:48:00 UTC (rev 8461) @@ -0,0 +1,104 @@ +<?xml version="1.0" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" + "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<!-- Created with matplotlib (http://matplotlib.sourceforge.net/) --> +<svg width="144pt" height="72pt" viewBox="0 0 144 72" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + version="1.1" + id="svg1"> +<filter id="colorAdd"><feComposite in="SourceGraphic" in2="BackgroundImage" operator="arithmetic" k2="1" k3="1"/></filter> +<g id="figure1"> +<g id="patch1"> +<path style="fill: #ffffff; stroke: #ffffff; stroke-width: 1.000000; stroke-linejoin: round; stroke-linecap: square; opacity: 1.000000" d="M0.000000 72.000000L144.000000 72.000000L144.000000 0.000000 +L0.000000 0.000000L0.000000 72.000000"/> +</g> +<g id="axes1"> +<g id="patch2"> +<path style="fill: #ffffff; opacity: 1.000000" d="M0.000000 72.000000L144.000000 72.000000L144.000000 0.000000 +L0.000000 0.000000L0.000000 72.000000"/> +</g> +<g id="line2d1"> +<defs> + <clipPath id="p7a7a30041bcd0eda414889f4295b8ec2"> +<rect x="0.000000" y="0.000000" width="144.000000" height="72.000000"/> + </clipPath> +</defs><path style="fill: none; stroke: #0000ff; stroke-width: 1.000000; stroke-linejoin: round; stroke-linecap: square; opacity: 1.000000" clip-path="url(#p7a7a30041bcd0eda414889f4295b8ec2)" d="M-180.000000 72.000000L36.000000 72.000000L72.000000 14.400000 +L108.000000 72.000000L144.000000 0.000000"/> +</g> +<g id="matplotlib.axis1"> +<g id="xtick1"> +<g id="line2d2"> +<defs><path id="m30e32995789d870ad79a2e54c91cf9c6" d="M0.000000 0.000000L0.000000 -4.000000"/></defs> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m30e32995789d870ad79a2e54c91cf9c6" x="0.000000" y="72.000000"/> +</g></g> +</g> +<g id="xtick2"> +<g id="line2d3"> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m30e32995789d870ad79a2e54c91cf9c6" x="36.000000" y="72.000000"/> +</g></g> +</g> +<g id="xtick3"> +<g id="line2d4"> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m30e32995789d870ad79a2e54c91cf9c6" x="72.000000" y="72.000000"/> +</g></g> +</g> +<g id="xtick4"> +<g id="line2d5"> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m30e32995789d870ad79a2e54c91cf9c6" x="108.000000" y="72.000000"/> +</g></g> +</g> +<g id="xtick5"> +<g id="line2d6"> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m30e32995789d870ad79a2e54c91cf9c6" x="144.000000" y="72.000000"/> +</g></g> +</g> +</g> +<g id="matplotlib.axis2"> +<g id="ytick1"> +<g id="line2d7"> +<defs><path id="m3400efa6b1638b3fea9e19e898273957" d="M0.000000 0.000000L4.000000 0.000000"/></defs> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m3400efa6b1638b3fea9e19e898273957" x="0.000000" y="72.000000"/> +</g></g> +</g> +<g id="ytick2"> +<g id="line2d8"> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m3400efa6b1638b3fea9e19e898273957" x="0.000000" y="57.600000"/> +</g></g> +</g> +<g id="ytick3"> +<g id="line2d9"> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m3400efa6b1638b3fea9e19e898273957" x="0.000000" y="43.200000"/> +</g></g> +</g> +<g id="ytick4"> +<g id="line2d10"> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m3400efa6b1638b3fea9e19e898273957" x="0.000000" y="28.800000"/> +</g></g> +</g> +<g id="ytick5"> +<g id="line2d11"> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m3400efa6b1638b3fea9e19e898273957" x="0.000000" y="14.400000"/> +</g></g> +</g> +<g id="ytick6"> +<g id="line2d12"> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m3400efa6b1638b3fea9e19e898273957" x="0.000000" y="0.000000"/> +</g></g> +</g> +</g> +<g id="patch3"> +<path style="fill: none; stroke: #000000; stroke-width: 1.000000; stroke-linejoin: round; stroke-linecap: square; opacity: 1.000000" d="M0.000000 0.000000L144.000000 0.000000"/> +</g> +<g id="patch4"> +<path style="fill: none; stroke: #000000; stroke-width: 1.000000; stroke-linejoin: round; stroke-linecap: square; opacity: 1.000000" d="M144.000000 72.000000L144.000000 0.000000"/> +</g> +<g id="patch5"> +<path style="fill: none; stroke: #000000; stroke-width: 1.000000; stroke-linejoin: round; stroke-linecap: square; opacity: 1.000000" d="M0.000000 72.000000L144.000000 72.000000"/> +</g> +<g id="patch6"> +<path style="fill: none; stroke: #000000; stroke-width: 1.000000; stroke-linejoin: round; stroke-linecap: square; opacity: 1.000000" d="M0.000000 72.000000L0.000000 0.000000"/> +</g> +</g> +</g> +</svg> Modified: trunk/matplotlib/lib/matplotlib/tests/test_simplification.py =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/test_simplification.py 2010-06-24 13:06:03 UTC (rev 8460) +++ trunk/matplotlib/lib/matplotlib/tests/test_simplification.py 2010-06-24 14:48:00 UTC (rev 8461) @@ -186,7 +186,24 @@ else: rcParams['path.simplify'] = True +@image_comparison(baseline_images=['clipper_edge']) +def test_clipper(): + dat = (0, 1, 0, 2, 0, 3, 0, 4, 0, 5) + fig = plt.figure(figsize=(2, 1)) + fig.subplots_adjust(left = 0, bottom = 0, wspace = 0, hspace = 0) + ax = fig.add_axes((0, 0, 1.0, 1.0), ylim = (0, 5), autoscale_on = False) + ax.plot(dat) + ax.xaxis.set_major_locator(plt.MultipleLocator(1)) + ax.xaxis.set_major_formatter(plt.NullFormatter()) + ax.yaxis.set_major_locator(plt.MultipleLocator(1)) + ax.yaxis.set_major_formatter(plt.NullFormatter()) + ax.xaxis.set_ticks_position('bottom') + ax.yaxis.set_ticks_position('left') + + ax.set_xlim(5, 9) + fig.savefig('clipper_edge') + if __name__=='__main__': import nose nose.runmodule(argv=['-s','--with-doctest'], exit=False) Modified: trunk/matplotlib/src/path_converters.h =================================================================== --- trunk/matplotlib/src/path_converters.h 2010-06-24 13:06:03 UTC (rev 8460) +++ trunk/matplotlib/src/path_converters.h 2010-06-24 14:48:00 UTC (rev 8461) @@ -288,7 +288,7 @@ PathClipper(VertexSource& source, bool do_clipping, double width, double height) : m_source(&source), m_do_clipping(do_clipping), - m_cliprect(0.0, 0.0, width, height), m_moveto(true), + m_cliprect(-1.0, -1.0, width + 1.0, height + 1.0), m_moveto(true), m_has_next(false) { // empty @@ -296,10 +296,13 @@ PathClipper(VertexSource& source, bool do_clipping, const agg::rect_base<double>& rect) : - m_source(&source), m_do_clipping(do_clipping), - m_cliprect(rect), m_moveto(true), m_has_next(false) + m_source(&source), m_do_clipping(do_clipping), + m_cliprect(rect), m_moveto(true), m_has_next(false) { - // empty + m_cliprect.x1 -= 1.0; + m_cliprect.y1 -= 1.0; + m_cliprect.x2 += 1.0; + m_cliprect.y2 += 1.0; } inline void This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2010-06-26 19:05:00
|
Revision: 8470 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8470&view=rev Author: efiring Date: 2010-06-26 19:04:53 +0000 (Sat, 26 Jun 2010) Log Message: ----------- docstrings: use standard spelling and capitalization of MATLAB Modified Paths: -------------- trunk/matplotlib/doc/users/intro.rst trunk/matplotlib/lib/matplotlib/__init__.py trunk/matplotlib/lib/matplotlib/artist.py trunk/matplotlib/lib/matplotlib/axes.py trunk/matplotlib/lib/matplotlib/backend_bases.py trunk/matplotlib/lib/matplotlib/blocking_input.py trunk/matplotlib/lib/matplotlib/contour.py trunk/matplotlib/lib/matplotlib/mlab.py trunk/matplotlib/lib/matplotlib/pylab.py trunk/matplotlib/lib/matplotlib/pyplot.py Modified: trunk/matplotlib/doc/users/intro.rst =================================================================== --- trunk/matplotlib/doc/users/intro.rst 2010-06-26 08:14:01 UTC (rev 8469) +++ trunk/matplotlib/doc/users/intro.rst 2010-06-26 19:04:53 UTC (rev 8470) @@ -3,12 +3,15 @@ matplotlib is a library for making 2D plots of arrays in `Python <http://www.python.org>`_. Although it has its origins in emulating -the MATLAB graphics commands, it is +the MATLAB |reg| [*]_ graphics commands, it is independent of MATLAB, and can be used in a Pythonic, object oriented way. Although matplotlib is written primarily in pure Python, it makes heavy use of `NumPy <http://www.numpy.org>`_ and other extension code to provide good performance even for large arrays. +.. |reg| unicode:: 0xAE + :ltrim: + matplotlib is designed with the philosophy that you should be able to create simple plots with just a few commands, or just one! If you want to see a histogram of your data, you shouldn't need to @@ -87,3 +90,6 @@ embed matplotlib in a Gtk+ EEG application that runs on Windows, Linux and Macintosh OS X. +.. [*] MATLAB is a registered trademark of The MathWorks, Inc. + + Modified: trunk/matplotlib/lib/matplotlib/__init__.py =================================================================== --- trunk/matplotlib/lib/matplotlib/__init__.py 2010-06-26 08:14:01 UTC (rev 8469) +++ trunk/matplotlib/lib/matplotlib/__init__.py 2010-06-26 19:04:53 UTC (rev 8470) @@ -1,9 +1,13 @@ """ This is an object-orient plotting library. -A procedural interface is provided by the companion pylab module, +A procedural interface is provided by the companion pyplot module, which may be imported directly, e.g:: + from pyplot import * + +To include numpy functions, use:: + from pylab import * or using ipython:: @@ -11,9 +15,11 @@ ipython -pylab For the most part, direct use of the object-oriented library is -encouraged when programming rather than working interactively. The -exceptions are the pylab commands :func:`~matplotlib.pyplot.figure`, +encouraged when programming; pyplot is primarily for working +interactively. The +exceptions are the pyplot commands :func:`~matplotlib.pyplot.figure`, :func:`~matplotlib.pyplot.subplot`, +:func:`~matplotlib.pyplot.subplots`, :func:`~matplotlib.backends.backend_qt4agg.show`, and :func:`~pyplot.savefig`, which can greatly simplify scripting. @@ -86,6 +92,10 @@ matplotlib is written by John D. Hunter (jdh2358 at gmail.com) and a host of others. + +Occasionally the internal documentation (python docstrings) will refer +to MATLAB®, a registered trademark of The MathWorks, Inc. + """ from __future__ import generators @@ -897,7 +907,7 @@ # Now allow command line to override -# Allow command line access to the backend with -d (matlab compatible +# Allow command line access to the backend with -d (MATLAB compatible # flag) for s in sys.argv[1:]: Modified: trunk/matplotlib/lib/matplotlib/artist.py =================================================================== --- trunk/matplotlib/lib/matplotlib/artist.py 2010-06-26 08:14:01 UTC (rev 8469) +++ trunk/matplotlib/lib/matplotlib/artist.py 2010-06-26 19:04:53 UTC (rev 8470) @@ -1159,10 +1159,10 @@ >>> lines = plot(x, y1, x, y2) >>> setp(lines, linewidth=2, color='r') - :func:`setp` works with the matlab style string/value pairs or + :func:`setp` works with the MATLAB style string/value pairs or with python kwargs. For example, the following are equivalent:: - >>> setp(lines, 'linewidth', 2, 'color', r') # matlab style + >>> setp(lines, 'linewidth', 2, 'color', r') # MATLAB style >>> setp(lines, linewidth=2, color='r') # python style """ Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-06-26 08:14:01 UTC (rev 8469) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-06-26 19:04:53 UTC (rev 8470) @@ -50,7 +50,7 @@ def _process_plot_format(fmt): """ - Process a matlab(TM) style color/line style format string. Return a + Process a MATLAB style color/line style format string. Return a (*linestyle*, *color*) tuple as a result of the processing. Default values are ('-', 'b'). Example format strings include: @@ -1963,7 +1963,7 @@ grid(self, b=None, which='major', **kwargs) - Set the axes grids on or off; *b* is a boolean. (For Matlab + 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 @@ -5187,7 +5187,7 @@ - *vert* = 1 (default) makes the boxes vertical. - *vert* = 0 makes horizontal boxes. This seems goofy, but - that's how Matlab did it. + that's how MATLAB did it. *whis* (default 1.5) defines the length of the whiskers as a function of the inner quartile range. They extend to the @@ -6744,7 +6744,7 @@ *shading*: [ 'flat' | 'faceted' ] If 'faceted', a black grid is drawn around each rectangle; if 'flat', edges are not drawn. Default is 'flat', contrary to - Matlab. + MATLAB. This kwarg is deprecated; please use 'edgecolors' instead: * shading='flat' -- edgecolors='none' @@ -6765,7 +6765,7 @@ .. _axes-pcolor-grid-orientation: - The grid orientation follows the Matlab(TM) convention: an + The grid orientation follows the MATLAB convention: an array *C* with shape (*nrows*, *ncolumns*) is plotted with the column number as *X* and the row number as *Y*, increasing up; hence it is plotted the way the array would be printed, @@ -6800,7 +6800,7 @@ pcolor(C.T) - Matlab :func:`pcolor` always discards the last row and column + MATLAB :func:`pcolor` always discards the last row and column of *C*, but matplotlib displays the last row and column if *X* and *Y* are not specified, or if *X* and *Y* have one more row and column than *C*. @@ -6942,7 +6942,7 @@ *shading*: [ 'flat' | 'faceted' | 'gouraud' ] If 'faceted', a black grid is drawn around each rectangle; if 'flat', edges are not drawn. Default is 'flat', contrary to - Matlab(TM). + MATLAB. This kwarg is deprecated; please use 'edgecolors' instead: * shading='flat' -- edgecolors='None' @@ -8219,14 +8219,14 @@ raise ValueError('Argument to subplot must be a 3 digits long') rows, cols, num = map(int, s) self._subplotspec = GridSpec(rows, cols)[num-1] - # num - 1 for converting from matlab to python indexing + # num - 1 for converting from MATLAB to python indexing elif len(args)==3: rows, cols, num = args if isinstance(num, tuple) and len(num) == 2: self._subplotspec = GridSpec(rows, cols)[num[0]-1:num[1]] else: self._subplotspec = GridSpec(rows, cols)[num-1] - # num - 1 for converting from matlab to python indexing + # num - 1 for converting from MATLAB to python indexing else: raise ValueError( 'Illegal argument to subplot') Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backend_bases.py 2010-06-26 08:14:01 UTC (rev 8469) +++ trunk/matplotlib/lib/matplotlib/backend_bases.py 2010-06-26 19:04:53 UTC (rev 8470) @@ -702,7 +702,7 @@ def get_rgb(self): """ returns a tuple of three floats from 0-1. color can be a - matlab format string, a html hex color string, or a rgb tuple + MATLAB format string, a html hex color string, or a rgb tuple """ return self._rgb @@ -781,7 +781,7 @@ def set_foreground(self, fg, isRGB=False): """ - Set the foreground color. fg can be a matlab format string, a + Set the foreground color. fg can be a MATLAB format string, a html hex color string, an rgb unit tuple, or a float between 0 and 1. In the latter case, grayscale is used. @@ -2072,7 +2072,7 @@ class FigureManagerBase: """ - Helper class for matlab mode, wraps everything up into a neat bundle + Helper class for pyplot mode, wraps everything up into a neat bundle Public attibutes: Modified: trunk/matplotlib/lib/matplotlib/blocking_input.py =================================================================== --- trunk/matplotlib/lib/matplotlib/blocking_input.py 2010-06-26 08:14:01 UTC (rev 8469) +++ trunk/matplotlib/lib/matplotlib/blocking_input.py 2010-06-26 19:04:53 UTC (rev 8470) @@ -194,7 +194,7 @@ BlockingInput.pop(self,-1) # This will exit even if not in infinite mode. This is - # consistent with matlab and sometimes quite useful, but will + # consistent with MATLAB and sometimes quite useful, but will # require the user to test how many points were actually # returned before using data. self.fig.canvas.stop_event_loop() Modified: trunk/matplotlib/lib/matplotlib/contour.py =================================================================== --- trunk/matplotlib/lib/matplotlib/contour.py 2010-06-26 08:14:01 UTC (rev 8469) +++ trunk/matplotlib/lib/matplotlib/contour.py 2010-06-26 19:04:53 UTC (rev 8470) @@ -1234,8 +1234,8 @@ filled contours, respectively. Except as noted, function signatures and return values are the same for both versions. - :func:`~matplotlib.pyplot.contourf` differs from the Matlab - (TM) version in that it does not draw the polygon edges. + :func:`~matplotlib.pyplot.contourf` differs from the MATLAB + version in that it does not draw the polygon edges. To draw edges, add line contours with calls to :func:`~matplotlib.pyplot.contour`. Modified: trunk/matplotlib/lib/matplotlib/mlab.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mlab.py 2010-06-26 08:14:01 UTC (rev 8469) +++ trunk/matplotlib/lib/matplotlib/mlab.py 2010-06-26 19:04:53 UTC (rev 8470) @@ -1,9 +1,9 @@ """ -Numerical python functions written for compatability with matlab(TM) +Numerical python functions written for compatability with MATLAB commands with the same names. -Matlab(TM) compatible functions +MATLAB compatible functions ------------------------------- :func:`cohere` @@ -41,10 +41,10 @@ Miscellaneous functions ------------------------- -Functions that don't exist in matlab(TM), but are useful anyway: +Functions that don't exist in MATLAB, but are useful anyway: :meth:`cohere_pairs` - Coherence over all pairs. This is not a matlab function, but we + Coherence over all pairs. This is not a MATLAB function, but we compute coherence a lot in my lab, and we compute it for a lot of pairs. This function is optimized to do this efficiently by caching the direct FFTs. @@ -245,7 +245,7 @@ raise ValueError("sides must be one of: 'default', 'onesided', or " "'twosided'") - # Matlab divides by the sampling frequency so that density function + # MATLAB divides by the sampling frequency so that density function # has units of dB/Hz and can be integrated by the plotted frequency # values. Perform the same scaling here. if scale_by_freq: @@ -277,18 +277,18 @@ Pxy[:,i] = np.conjugate(fx[:numFreqs]) * fy[:numFreqs] # Scale the spectrum by the norm of the window to compensate for - # windowing loss; see Bendat & Piersol Sec 11.5.2. + # windowing loss; see Bendat & Piersol Sec 11.5.2. Pxy *= 1 / (np.abs(windowVals)**2).sum() # Also include scaling factors for one-sided densities and dividing by the # sampling frequency, if desired. Scale everything, except the DC component - # and the NFFT/2 component: + # and the NFFT/2 component: Pxy[1:-1] *= scaling_factor - #But do scale those components by Fs, if required + #But do scale those components by Fs, if required if scale_by_freq: - Pxy[[0,-1]] /= Fs - + Pxy[[0,-1]] /= Fs + t = 1./Fs * (ind + NFFT / 2.) freqs = float(Fs) / pad_to * np.arange(numFreqs) @@ -315,7 +315,7 @@ *detrend*: callable The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in - matlab, where the *detrend* parameter is a vector, in + MATLAB, where the *detrend* parameter is a vector, in matplotlib is it a function. The :mod:`~matplotlib.pylab` module defines :func:`~matplotlib.pylab.detrend_none`, :func:`~matplotlib.pylab.detrend_mean`, and @@ -356,7 +356,7 @@ Specifies whether the resulting density values should be scaled by the scaling frequency, which gives density in units of Hz^-1. This allows for integration over the returned frequency values. - The default is True for MatLab compatibility. + The default is True for MATLAB compatibility. """)) @docstring.dedent_interpd @@ -785,7 +785,7 @@ - *fracVar* : the fraction of the variance accounted for by each component returned - A similar function of the same name was in the Matlab (TM) + A similar function of the same name was in the MATLAB R13 Neural Network Toolbox but is not found in later versions; its successor seems to be called "processpcs". """ @@ -1732,7 +1732,7 @@ def isvector(X): """ - Like the Matlab (TM) function with the same name, returns *True* + Like the MATLAB function with the same name, returns *True* if the supplied numpy array or matrix *X* looks like a vector, meaning it has a one non-singleton axis (i.e., it can have multiple axes, but all must have length 1, except for one of @@ -2719,7 +2719,7 @@ # remove masked points. if hasattr(z,'mask'): # make sure mask is not a scalar boolean array. - if a.mask.ndim: + if a.mask.ndim: x = x.compress(z.mask == False) y = y.compress(z.mask == False) z = z.compressed() Modified: trunk/matplotlib/lib/matplotlib/pylab.py =================================================================== --- trunk/matplotlib/lib/matplotlib/pylab.py 2010-06-26 08:14:01 UTC (rev 8469) +++ trunk/matplotlib/lib/matplotlib/pylab.py 2010-06-26 19:04:53 UTC (rev 8470) @@ -3,8 +3,10 @@ plotting library. The following plotting commands are provided; the majority have -Matlab(TM) analogs and similar argument. +MATLAB |reg| [*]_ analogs and similar arguments. +.. |reg| unicode:: 0xAE + _Plotting commands acorr - plot the autocorrelation function annotate - annotate something in the figure @@ -197,6 +199,9 @@ __end +.. [*] MATLAB is a registered trademark of The MathWorks, Inc. + + """ import sys, warnings Modified: trunk/matplotlib/lib/matplotlib/pyplot.py =================================================================== --- trunk/matplotlib/lib/matplotlib/pyplot.py 2010-06-26 08:14:01 UTC (rev 8469) +++ trunk/matplotlib/lib/matplotlib/pyplot.py 2010-06-26 19:04:53 UTC (rev 8470) @@ -1,3 +1,19 @@ +""" +Provides a MATLAB-like plotting framework. + +:mod:`~matplotlib.pylab` combines pyplot with numpy into a single namespace. +This is convenient for interactive work, but for programming it +is recommended that the namespaces be kept separate, e.g.:: + + import numpy as np + import matplotlib.pyplot as plt + + x = np.arange(0, 5, 0.1); + y = np.sin(x) + plt.plot(x, y) + +""" + import sys import matplotlib @@ -197,7 +213,7 @@ If *num* is an integer, and ``figure(num)`` already exists, make it active and return a reference to it. If ``figure(num)`` does not exist - it will be created. Numbering starts at 1, matlab style:: + it will be created. Numbering starts at 1, MATLAB style:: figure(1) @@ -739,7 +755,7 @@ subplot_kw['sharey'] = ax0 axarr[0] = ax0 - # Note off-by-one counting because add_subplot uses the matlab 1-based + # Note off-by-one counting because add_subplot uses the MATLAB 1-based # convention. for i in range(1, nplots): axarr[i] = fig.add_subplot(nrows, ncols, i+1, **subplot_kw) @@ -947,7 +963,7 @@ changes *x* and *y* axis limits such that all data is shown. If all data is already shown, it will move it to the center of the figure without modifying (*xmax* - *xmin*) or (*ymax* - - *ymin*). Note this is slightly different than in matlab. + *ymin*). Note this is slightly different than in MATLAB. >>> axis('image') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2010-06-26 19:29:54
|
Revision: 8471 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8471&view=rev Author: efiring Date: 2010-06-26 19:29:48 +0000 (Sat, 26 Jun 2010) Log Message: ----------- docs: add 4 new pyplot functions Modified Paths: -------------- trunk/matplotlib/doc/_templates/index.html trunk/matplotlib/doc/api/api_changes.rst trunk/matplotlib/lib/matplotlib/pylab.py Modified: trunk/matplotlib/doc/_templates/index.html =================================================================== --- trunk/matplotlib/doc/_templates/index.html 2010-06-26 19:04:53 UTC (rev 8470) +++ trunk/matplotlib/doc/_templates/index.html 2010-06-26 19:29:48 UTC (rev 8471) @@ -620,6 +620,18 @@ </tr> <tr> <th align="left"> + <a href="api/pyplot_api.html#matplotlib.pyplot.locator_params">locator_params</a> + + </th> + + <td align="left"> + adjust parameters used in locating axis ticks + </td> + + </tr> + + <tr> + <th align="left"> <a href="api/pyplot_api.html#matplotlib.pyplot.loglog">loglog</a> </th> @@ -642,6 +654,18 @@ </tr> <tr> <th align="left"> + <a href="api/pyplot_api.html#matplotlib.pyplot.margins">margins</a> + + </th> + + <td align="left"> + set margins used in autoscaling + </td> + + </tr> + + <tr> + <th align="left"> <a href="api/pyplot_api.html#matplotlib.pyplot.pcolor">pcolor</a> </th> @@ -950,6 +974,29 @@ </tr> <tr> <th align="left"> + <a href="api/pyplot_api.html#matplotlib.pyplot.tick_params">tick_params</a> + + </th> + + <td align="left"> + control the appearance of ticks and tick labels + </td> + + </tr> + <tr> + <th align="left"> + <a href="api/pyplot_api.html#matplotlib.pyplot.ticklabel_format">ticklabel_format</a> + + </th> + + <td align="left"> + control the format of tick labels + </td> + + </tr> + + <tr> + <th align="left"> <a href="api/pyplot_api.html#matplotlib.pyplot.title">title</a> </th> Modified: trunk/matplotlib/doc/api/api_changes.rst =================================================================== --- trunk/matplotlib/doc/api/api_changes.rst 2010-06-26 19:04:53 UTC (rev 8470) +++ trunk/matplotlib/doc/api/api_changes.rst 2010-06-26 19:29:48 UTC (rev 8471) @@ -10,9 +10,10 @@ Changes beyond 0.99.x ===================== -* There are three new Axes methods with corresponding pyplot +* There are four new Axes methods with corresponding pyplot functions to facilitate autoscaling, tick location, and tick - label formatting: + label formatting, and the general appearance of ticks and + tick labels: + :meth:`matplotlib.axes.Axes.margins` sets margins used to autoscale the :attr:`matplotlib.axes.Axes.viewLim` based on @@ -25,6 +26,9 @@ method for controlling the :class:`matplotlib.ticker.ScalarFormatter` that is used by default with linear axes. + + :meth:`matplotlib.axes.Axes.tick_params` controls direction, size, + visibility, and color of ticks and their labels. + * The :meth:`matplotlib.axes.Axes.bar` method accepts a *error_kw* kwarg; it is a dictionary of kwargs to be passed to the errorbar function. Modified: trunk/matplotlib/lib/matplotlib/pylab.py =================================================================== --- trunk/matplotlib/lib/matplotlib/pylab.py 2010-06-26 19:04:53 UTC (rev 8470) +++ trunk/matplotlib/lib/matplotlib/pylab.py 2010-06-26 19:29:48 UTC (rev 8471) @@ -56,8 +56,10 @@ imshow - plot image data ishold - return the hold state of the current axes legend - make an axes legend + locator_params - adjust parameters used in locating axis ticks loglog - a log log plot matshow - display a matrix in a new figure preserving aspect + margins - set margins used in autoscaling pcolor - make a pseudocolor plot pcolormesh - make a pseudocolor plot using a quadrilateral mesh pie - make a pie chart @@ -86,6 +88,8 @@ table - add a table to the plot text - add some text at location x,y to the current axes thetagrids - customize the radial theta grids and labels for polar + tick_params - control the appearance of ticks and tick labels + ticklabel_format - control the format of tick labels title - add a title to the current axes xcorr - plot the autocorrelation function of x and y xlim - set/get the xlimits This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2010-06-30 21:07:43
|
Revision: 8479 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8479&view=rev Author: efiring Date: 2010-06-30 21:07:36 +0000 (Wed, 30 Jun 2010) Log Message: ----------- set_xlim, set_ylim: turn off autoscaling; added autoscale method Modified Paths: -------------- trunk/matplotlib/boilerplate.py trunk/matplotlib/lib/matplotlib/axes.py trunk/matplotlib/lib/matplotlib/blocking_input.py trunk/matplotlib/lib/matplotlib/image.py trunk/matplotlib/lib/matplotlib/projections/polar.py trunk/matplotlib/lib/matplotlib/pylab.py trunk/matplotlib/lib/matplotlib/pyplot.py trunk/matplotlib/lib/matplotlib/tests/test_dates.py trunk/matplotlib/lib/matplotlib/widgets.py trunk/matplotlib/lib/mpl_toolkits/mplot3d/axes3d.py Modified: trunk/matplotlib/boilerplate.py =================================================================== --- trunk/matplotlib/boilerplate.py 2010-06-30 16:31:23 UTC (rev 8478) +++ trunk/matplotlib/boilerplate.py 2010-06-30 21:07:36 UTC (rev 8479) @@ -109,6 +109,7 @@ 'locator_params', 'tick_params', 'margins', + 'autoscale', ) cmappable = { Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-06-30 16:31:23 UTC (rev 8478) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-06-30 21:07:36 UTC (rev 8479) @@ -1715,7 +1715,46 @@ """ return self._rasterization_zorder + def autoscale(self, enable=True, axis='both', tight=None): + """ + Convenience method for simple axis view autoscaling. + It turns autoscaling on or off, and then, + if autoscaling for either axis is on, it performs + the autoscaling on the specified axis or axes. + *enable*: [True | False | None] + True (default) turns autoscaling on, False turns it off. + None leaves the autoscaling state unchanged. + + *axis*: ['x' | 'y' | 'both'] + which axis to operate on; default is 'both' + + *tight*: [True | False | None] + If True, set view limits to data limits; + if False, let the locator and margins expand the view limits; + if None, use tight scaling if the only artist is an image, + otherwise treat *tight* as False. + The *tight* setting is retained for future autoscaling + until it is explicitly changed. + + + Returns None. + """ + if enable is None: + scalex = True + scaley = True + else: + scalex = False + scaley = False + if axis in ['x', 'both']: + self._autoscaleXon = bool(enable) + scalex = self._autoscaleXon + if axis in ['y', 'both']: + self._autoscaleYon = bool(enable) + scaley = self._autoscaleYon + self.autoscale_view(tight=tight, scalex=scalex, scaley=scaley) + + def autoscale_view(self, tight=None, scalex=True, scaley=True): """ autoscale the view limits using the data limits. You can @@ -2209,7 +2248,7 @@ def invert_xaxis(self): "Invert the x-axis." left, right = self.get_xlim() - self.set_xlim(right, left) + self.viewLim.intervalx = (right, left) def xaxis_inverted(self): 'Returns True if the x-axis is inverted.' @@ -2233,6 +2272,7 @@ """ Set the lower and upper numerical bounds of the x-axis. This method will honor axes inversion regardless of parameter order. + It will not change the _autoscaleXon attribute. """ if upper is None and iterable(lower): lower,upper = lower @@ -2244,14 +2284,14 @@ if self.xaxis_inverted(): if lower < upper: - self.set_xlim(upper, lower) + self.set_xlim(upper, lower, auto=None) else: - self.set_xlim(lower, upper) + self.set_xlim(lower, upper, auto=None) else: if lower < upper: - self.set_xlim(lower, upper) + self.set_xlim(lower, upper, auto=None) else: - self.set_xlim(upper, lower) + self.set_xlim(upper, lower, auto=None) def get_xlim(self): """ @@ -2259,32 +2299,45 @@ """ return tuple(self.viewLim.intervalx) - def set_xlim(self, xmin=None, xmax=None, emit=True, **kwargs): + def set_xlim(self, xmin=None, xmax=None, emit=True, auto=False): """ call signature:: - set_xlim(self, *args, **kwargs) + set_xlim(self, *args, **kwargs): - Set the limits for the xaxis + Set the data limits for the xaxis - Returns the current xlimits as a length 2 tuple: [*xmin*, *xmax*] - Examples:: - set_xlim((valmin, valmax)) - set_xlim(valmin, valmax) - set_xlim(xmin=1) # xmax unchanged - set_xlim(xmax=1) # xmin unchanged + set_xlim((left, right)) + set_xlim(left, right) + set_xlim(xmin=1) # right unchanged + set_xlim(xmax=1) # left unchanged Keyword arguments: *xmin*: scalar - the min of the ylim + the left xlim *xmax*: scalar - the max of the ylim + the right xlim *emit*: [ True | False ] notify observers of lim change + *auto*: [ True | False | None ] + turn *x* autoscaling on (True), off (False; default), + or leave unchanged (None) + Note: the kwarg terminology may be confusing. The first value, + *xmin*, is the left, and the second, *xmax*, is the right. + For example, suppose *x* is years before present. + Then one might use:: + + set_ylim(5000, 0) + + so 5000 years ago is on the left of the plot and the + present is on the right. + + Returns the current xlimits as a length 2 tuple + ACCEPTS: len(2) sequence of floats """ if xmax is None and iterable(xmin): @@ -2307,6 +2360,8 @@ xmin, xmax = self.xaxis.limit_range_for_scale(xmin, xmax) self.viewLim.intervalx = (xmin, xmax) + if auto is not None: + self._autoscaleXon = bool(auto) if emit: self.callbacks.process('xlim_changed', self) @@ -2391,25 +2446,26 @@ def invert_yaxis(self): "Invert the y-axis." - left, right = self.get_ylim() - self.set_ylim(right, left) + bottom, top = self.get_ylim() + self.viewLim.intervaly = (top, bottom) def yaxis_inverted(self): 'Returns True if the y-axis is inverted.' - left, right = self.get_ylim() - return right < left + bottom, top = self.get_ylim() + return top < bottom def get_ybound(self): "Return y-axis numerical bounds in the form of lowerBound < upperBound" - left, right = self.get_ylim() - if left < right: - return left, right + bottom, top = self.get_ylim() + if bottom < top: + return bottom, top else: - return right, left + return top, bottom def set_ybound(self, lower=None, upper=None): """Set the lower and upper numerical bounds of the y-axis. This method will honor axes inversion regardless of parameter order. + It will not change the _autoscaleYon attribute. """ if upper is None and iterable(lower): lower,upper = lower @@ -2421,14 +2477,14 @@ if self.yaxis_inverted(): if lower < upper: - self.set_ylim(upper, lower) + self.set_ylim(upper, lower, auto=None) else: - self.set_ylim(lower, upper) + self.set_ylim(lower, upper, auto=None) else: if lower < upper: - self.set_ylim(lower, upper) + self.set_ylim(lower, upper, auto=None) else: - self.set_ylim(upper, lower) + self.set_ylim(upper, lower, auto=None) def get_ylim(self): """ @@ -2436,28 +2492,43 @@ """ return tuple(self.viewLim.intervaly) - def set_ylim(self, ymin=None, ymax=None, emit=True, **kwargs): + def set_ylim(self, ymin=None, ymax=None, emit=True, auto=False): """ call signature:: set_ylim(self, *args, **kwargs): - Set the limits for the yaxis; v = [ymin, ymax]:: + Set the data limits for the yaxis - set_ylim((valmin, valmax)) - set_ylim(valmin, valmax) - set_ylim(ymin=1) # ymax unchanged - set_ylim(ymax=1) # ymin unchanged + Examples:: + set_ylim((bottom, top)) + set_ylim(bottom, top) + set_ylim(ymin=1) # top unchanged + set_ylim(ymax=1) # bottom unchanged + Keyword arguments: *ymin*: scalar - the min of the ylim + the bottom ylim *ymax*: scalar - the max of the ylim + the top ylim *emit*: [ True | False ] notify observers of lim change + *auto*: [ True | False | None ] + turn *y* autoscaling on (True), off (False; default), + or leave unchanged (None) + Note: the kwarg terminology may be confusing. The first value, + *ymin*, is the bottom, and the second, *ymax*, is the top. + For example, suppose *y* is depth in the ocean. + Then one might use:: + + set_ylim(5000, 0) + + so 5000 m depth is at the bottom of the plot and the + surface, 0 m, is at the top. + Returns the current ylimits as a length 2 tuple ACCEPTS: len(2) sequence of floats @@ -2480,7 +2551,10 @@ ymin, ymax = mtransforms.nonsingular(ymin, ymax, increasing=False) ymin, ymax = self.yaxis.limit_range_for_scale(ymin, ymax) + self.viewLim.intervaly = (ymin, ymax) + if auto is not None: + self._autoscaleYon = bool(auto) if emit: self.callbacks.process('ylim_changed', self) @@ -6647,14 +6721,10 @@ im.autoscale_None() im.set_url(url) - xmin, xmax, ymin, ymax = im.get_extent() + # update ax.dataLim, and, if autoscaling, set viewLim + # to tightly fit the image, regardless of dataLim. + im.set_extent(im.get_extent()) - corners = (xmin, ymin), (xmax, ymax) - self.update_datalim(corners) - if self._autoscaleXon: - self.set_xlim((xmin, xmax)) - if self._autoscaleYon: - self.set_ylim((ymin, ymax)) self.images.append(im) im._remove_method = lambda h: self.images.remove(h) Modified: trunk/matplotlib/lib/matplotlib/blocking_input.py =================================================================== --- trunk/matplotlib/lib/matplotlib/blocking_input.py 2010-06-30 16:31:23 UTC (rev 8478) +++ trunk/matplotlib/lib/matplotlib/blocking_input.py 2010-06-30 21:07:36 UTC (rev 8479) @@ -19,6 +19,7 @@ from matplotlib import path, verbose from matplotlib.cbook import is_sequence_of_strings +import matplotlib.lines as mlines class BlockingInput(object): """ @@ -222,18 +223,10 @@ # If desired plot up click if self.show_clicks: - - # make sure we don't mess with the axes zoom - xlim = event.inaxes.get_xlim() - ylim = event.inaxes.get_ylim() - - # plot the clicks - self.marks.extend( - event.inaxes.plot([event.xdata,], [event.ydata,], 'r+') ) - - # before we draw, make sure to reset the limits - event.inaxes.set_xlim(xlim) - event.inaxes.set_ylim(ylim) + line = mlines.Line2D([event.xdata], [event.ydata], + marker='+', color='r') + event.inaxes.add_line(line) + self.marks.append(line) self.fig.canvas.draw() @@ -247,16 +240,9 @@ if self.show_clicks: - # make sure we don't mess with the axes zoom - xlim = event.inaxes.get_xlim() - ylim = event.inaxes.get_ylim() - mark = self.marks.pop(index) mark.remove() - # before we draw, make sure to reset the limits - event.inaxes.set_xlim(xlim) - event.inaxes.set_ylim(ylim) self.fig.canvas.draw() # NOTE: I do NOT understand why the above 3 lines does not work # for the keyboard backspace event on windows XP wxAgg. @@ -275,20 +261,11 @@ def cleanup(self,event=None): # clean the figure if self.show_clicks: - if event: - # make sure we don't mess with the axes zoom - xlim = event.inaxes.get_xlim() - ylim = event.inaxes.get_ylim() for mark in self.marks: mark.remove() self.marks = [] - if event: - # before we draw, make sure to reset the limits - event.inaxes.set_xlim(xlim) - event.inaxes.set_ylim(ylim) - self.fig.canvas.draw() # Call base class to remove callbacks Modified: trunk/matplotlib/lib/matplotlib/image.py =================================================================== --- trunk/matplotlib/lib/matplotlib/image.py 2010-06-30 16:31:23 UTC (rev 8478) +++ trunk/matplotlib/lib/matplotlib/image.py 2010-06-30 21:07:36 UTC (rev 8479) @@ -605,6 +605,12 @@ def set_extent(self, extent): """ extent is data axes (left, right, bottom, top) for making image plots + + This updates ax.dataLim, and, if autoscaling, sets viewLim + to tightly fit the image, regardless of dataLim. Autoscaling + state is not changed, so following this with ax.autoscale_view + will redo the autoscaling in accord with dataLim. + """ self._extent = extent @@ -612,9 +618,9 @@ corners = (xmin, ymin), (xmax, ymax) self.axes.update_datalim(corners) if self.axes._autoscaleXon: - self.axes.set_xlim((xmin, xmax)) + self.axes.set_xlim((xmin, xmax), auto=None) if self.axes._autoscaleYon: - self.axes.set_ylim((ymin, ymax)) + self.axes.set_ylim((ymin, ymax), auto=None) def get_extent(self): 'get the image extent: left, right, bottom, top' Modified: trunk/matplotlib/lib/matplotlib/projections/polar.py =================================================================== --- trunk/matplotlib/lib/matplotlib/projections/polar.py 2010-06-30 16:31:23 UTC (rev 8478) +++ trunk/matplotlib/lib/matplotlib/projections/polar.py 2010-06-30 21:07:36 UTC (rev 8479) @@ -336,12 +336,13 @@ def get_rmin(self): return self.viewLim.ymin - def set_rlim(self, rmin=None, rmax=None): - self.viewLim.y0 = rmin - self.viewLim.y1 = rmax + def set_rlim(self, *args, **kwargs): + if 'rmin' in kwargs: + kwargs['ymin'] = kwargs.pop('rmin') + if 'rmax' in kwargs: + kwargs['ymax'] = kwargs.pop('rmax') + return self.set_ylim(*args, **kwargs) - set_ylim = set_rlim - def set_yscale(self, *args, **kwargs): Axes.set_yscale(self, *args, **kwargs) self.yaxis.set_major_locator( Modified: trunk/matplotlib/lib/matplotlib/pylab.py =================================================================== --- trunk/matplotlib/lib/matplotlib/pylab.py 2010-06-30 16:31:23 UTC (rev 8478) +++ trunk/matplotlib/lib/matplotlib/pylab.py 2010-06-30 21:07:36 UTC (rev 8479) @@ -17,6 +17,7 @@ axhspan - draw a horizontal bar across axes axvspan - draw a vertical bar across axes axis - Set or return the current axis limits + autoscale - turn axis autoscaling on or off, and apply it bar - make a bar chart barh - a horizontal bar chart broken_barh - a set of horizontal bars with gaps Modified: trunk/matplotlib/lib/matplotlib/pyplot.py =================================================================== --- trunk/matplotlib/lib/matplotlib/pyplot.py 2010-06-30 16:31:23 UTC (rev 8478) +++ trunk/matplotlib/lib/matplotlib/pyplot.py 2010-06-30 21:07:36 UTC (rev 8479) @@ -2132,7 +2132,7 @@ # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost @autogen_docstring(Axes.hexbin) -def hexbin(x, y, C=None, gridsize=100, bins=None, xscale='linear', yscale='linear', extent=None, cmap=None, norm=None, vmin=None, vmax=None, alpha=1.0, linewidths=None, edgecolors='none', reduce_C_function=np.mean, mincnt=None, marginals=False, hold=None, **kwargs): +def hexbin(x, y, C=None, gridsize=100, bins=None, xscale='linear', yscale='linear', extent=None, cmap=None, norm=None, vmin=None, vmax=None, alpha=None, linewidths=None, edgecolors='none', reduce_C_function=np.mean, mincnt=None, marginals=False, hold=None, **kwargs): ax = gca() # allow callers to override the hold state by passing hold=True|False washold = ax.ishold() @@ -2186,7 +2186,7 @@ # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost @autogen_docstring(Axes.imshow) -def imshow(X, cmap=None, norm=None, aspect=None, interpolation=None, alpha=1.0, vmin=None, vmax=None, origin=None, extent=None, shape=None, filternorm=1, filterrad=4.0, imlim=None, resample=None, url=None, hold=None, **kwargs): +def imshow(X, cmap=None, norm=None, aspect=None, interpolation=None, alpha=None, vmin=None, vmax=None, origin=None, extent=None, shape=None, filternorm=1, filterrad=4.0, imlim=None, resample=None, url=None, hold=None, **kwargs): ax = gca() # allow callers to override the hold state by passing hold=True|False washold = ax.ishold() @@ -2366,7 +2366,7 @@ # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost @autogen_docstring(Axes.scatter) -def scatter(x, y, s=20, c='b', marker='o', cmap=None, norm=None, vmin=None, vmax=None, alpha=1.0, linewidths=None, faceted=True, verts=None, hold=None, **kwargs): +def scatter(x, y, s=20, c='b', marker='o', cmap=None, norm=None, vmin=None, vmax=None, alpha=None, linewidths=None, faceted=True, verts=None, hold=None, **kwargs): ax = gca() # allow callers to override the hold state by passing hold=True|False washold = ax.ishold() @@ -2608,8 +2608,8 @@ # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost @docstring.copy_dedent(Axes.grid) -def grid(b=None, **kwargs): - ret = gca().grid(b, **kwargs) +def grid(b=None, which='major', **kwargs): + ret = gca().grid(b, which, **kwargs) draw_if_interactive() return ret @@ -2679,6 +2679,14 @@ # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost +...@do...py_dedent(Axes.autoscale) +def autoscale(enable=True, axis='both', tight=None): + ret = gca().autoscale(enable, axis, tight) + draw_if_interactive() + return ret + +# This function was autogenerated by boilerplate.py. Do not edit as +# changes will be lost def autumn(): ''' set the default colormap to autumn and apply to current image if any. @@ -2902,4 +2910,3 @@ draw_if_interactive() - Modified: trunk/matplotlib/lib/matplotlib/tests/test_dates.py =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/test_dates.py 2010-06-30 16:31:23 UTC (rev 8478) +++ trunk/matplotlib/lib/matplotlib/tests/test_dates.py 2010-06-30 21:07:36 UTC (rev 8479) @@ -77,7 +77,7 @@ tf = datetime.datetime(2000, 1, 20) fig = plt.figure() ax = fig.add_subplot(1,1,1) - ax.set_xlim((t0,tf)) + ax.set_xlim((t0,tf), auto=True) ax.plot([],[]) from matplotlib.dates import DayLocator, DateFormatter, HourLocator ax.xaxis.set_major_locator(DayLocator()) Modified: trunk/matplotlib/lib/matplotlib/widgets.py =================================================================== --- trunk/matplotlib/lib/matplotlib/widgets.py 2010-06-30 16:31:23 UTC (rev 8478) +++ trunk/matplotlib/lib/matplotlib/widgets.py 2010-06-30 21:07:36 UTC (rev 8479) @@ -131,7 +131,7 @@ event.canvas.release_mouse(self.ax) if not self.eventson: return - if event.inaxes != self.ax: + if event.inaxes != self.ax: return for cid, func in self.observers.items(): func(event) @@ -253,10 +253,10 @@ self.drag_active = True event.canvas.grab_mouse(self.ax) - if not self.drag_active: + if not self.drag_active: return - - elif ((event.name == 'button_release_event') + + elif ((event.name == 'button_release_event') or (event.name == 'button_press_event' and event.inaxes != self.ax)): self.drag_active = False event.canvas.release_mouse(self.ax) @@ -1134,7 +1134,7 @@ self.validButtons = button elif isinstance(button, int): self.validButtons = [button] - + assert(spancoords in ('data', 'pixels')) self.spancoords = spancoords @@ -1165,7 +1165,7 @@ if self.validButtons is not None: if not event.button in self.validButtons: return True - + # If no button was pressed yet ignore the event if it was out # of the axes if self.eventpress == None: Modified: trunk/matplotlib/lib/mpl_toolkits/mplot3d/axes3d.py =================================================================== --- trunk/matplotlib/lib/mpl_toolkits/mplot3d/axes3d.py 2010-06-30 16:31:23 UTC (rev 8478) +++ trunk/matplotlib/lib/mpl_toolkits/mplot3d/axes3d.py 2010-06-30 21:07:36 UTC (rev 8479) @@ -93,8 +93,8 @@ ydwl = (0.95/self.dist) ydw = (0.9/self.dist) - Axes.set_xlim(self, -xdwl, xdw) - Axes.set_ylim(self, -ydwl, ydw) + Axes.set_xlim(self, -xdwl, xdw, auto=None) + Axes.set_ylim(self, -ydwl, ydw, auto=None) def create_axes(self): self.w_xaxis = axis3d.XAxis('x', self.xy_viewLim.intervalx, @@ -361,7 +361,7 @@ button or buttons to use to zoom the 3D axes. Default = 3. ============ ======================================================= - + """ self.button_pressed = None canv = self.figure.canvas @@ -1083,21 +1083,21 @@ dx, dy, dz can be arrays or scalars. *color* can be: - + - A single color value, to color all bars the same color. - + - An array of colors of length N bars, to color each bar independently. - + - An array of colors of length 6, to color the faces of the bars similarly. - + - An array of colors of length 6 * N bars, to color each face independently. When coloring the faces of the boxes specifically, this is the order of the coloring: - + 1. -Z (bottom of box) 2. +Z (top of box) 3. -Y This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2010-06-30 21:14:40
|
Revision: 8480 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8480&view=rev Author: efiring Date: 2010-06-30 21:14:31 +0000 (Wed, 30 Jun 2010) Log Message: ----------- doc changes for last commit Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/doc/api/api_changes.rst Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2010-06-30 21:07:36 UTC (rev 8479) +++ trunk/matplotlib/CHANGELOG 2010-06-30 21:14:31 UTC (rev 8480) @@ -1,3 +1,11 @@ +2010-06-30 Added autoscale convenience method and corresponding + pyplot function for simplified control of autoscaling; + and changed axis, set_xlim, and set_ylim so that by + default, they turn off the autoscaling on the relevent + axis or axes. Therefore one can call set_xlim before + plotting a line, for example, and the limits will be + retained. - EF + 2010-06-20 Added Axes.tick_params and corresponding pyplot function to control tick and tick label appearance after an Axes has been created. - EF Modified: trunk/matplotlib/doc/api/api_changes.rst =================================================================== --- trunk/matplotlib/doc/api/api_changes.rst 2010-06-30 21:07:36 UTC (rev 8479) +++ trunk/matplotlib/doc/api/api_changes.rst 2010-06-30 21:14:31 UTC (rev 8480) @@ -10,11 +10,22 @@ Changes beyond 0.99.x ===================== -* There are four new Axes methods with corresponding pyplot +* The default behavior of :meth:`matplotlib.axes.Axes.set_xlim`, + :meth:`matplotlib.axes.Axes.set_ylim`, and + :meth:`matplotlib.axes.Axes.axis`, and their corresponding + pyplot functions, has been changed: when view limits are + set explicitly with one of these methods, autoscaling is turned + off for the matching axis. A new *auto* kwarg is available to + control this behavior. + +* There are five new Axes methods with corresponding pyplot functions to facilitate autoscaling, tick location, and tick label formatting, and the general appearance of ticks and tick labels: + + :meth:`matplotlib.axes.Axes.autoscale` turns autoscaling + on or off, and applies it. + + :meth:`matplotlib.axes.Axes.margins` sets margins used to autoscale the :attr:`matplotlib.axes.Axes.viewLim` based on the :attr:`matplotlib.axes.Axes.dataLim`. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2010-07-02 17:22:55
|
Revision: 8482 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8482&view=rev Author: jdh2358 Date: 2010-07-02 17:22:49 +0000 (Fri, 02 Jul 2010) Log Message: ----------- added christophs dvipng_hack_alpha import fix Modified Paths: -------------- trunk/matplotlib/CXX/WrapPython.h trunk/matplotlib/lib/matplotlib/texmanager.py Modified: trunk/matplotlib/CXX/WrapPython.h =================================================================== --- trunk/matplotlib/CXX/WrapPython.h 2010-07-01 18:24:00 UTC (rev 8481) +++ trunk/matplotlib/CXX/WrapPython.h 2010-07-02 17:22:49 UTC (rev 8482) @@ -44,11 +44,7 @@ #endif // Prevent multiple conflicting definitions of swab from stdlib.h and unistd.h -#if defined(__sun) || defined(sun) -#if defined(_XPG4) #undef _XPG4 -#endif -#endif // Python.h will redefine these and generate warning in the process #undef _XOPEN_SOURCE Modified: trunk/matplotlib/lib/matplotlib/texmanager.py =================================================================== --- trunk/matplotlib/lib/matplotlib/texmanager.py 2010-07-01 18:24:00 UTC (rev 8481) +++ trunk/matplotlib/lib/matplotlib/texmanager.py 2010-07-02 17:22:49 UTC (rev 8482) @@ -91,7 +91,7 @@ if not os.path.exists(texcache): os.mkdir(texcache) - _dvipng_hack_alpha = dvipng_hack_alpha() + _dvipng_hack_alpha = None # mappable cache of rgba_arrayd = {} @@ -516,8 +516,11 @@ if rcParams['text.dvipnghack'] is not None: hack = rcParams['text.dvipnghack'] else: + if self._dvipng_hack_alpha is None: + self._dvipng_hack_alpha = dvipng_hack_alpha() hack = self._dvipng_hack_alpha + if hack: # hack the alpha channel # dvipng assumed a constant background, whereas we want to This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2010-07-02 18:06:34
|
Revision: 8484 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8484&view=rev Author: jdh2358 Date: 2010-07-02 18:06:25 +0000 (Fri, 02 Jul 2010) Log Message: ----------- fix swab bug so mpl will compile on solaris with cxx 6 Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/CXX/WrapPython.h Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2010-07-02 17:24:37 UTC (rev 8483) +++ trunk/matplotlib/CHANGELOG 2010-07-02 18:06:25 UTC (rev 8484) @@ -1,3 +1,7 @@ +2010-07-02 Modified CXX/WrapPython.h to fix "swab bug" on solaris so + mpl can compile on Solaris with CXX6 in the trunk. Closes + tracker bug 3022815 - JDH + 2010-06-30 Added autoscale convenience method and corresponding pyplot function for simplified control of autoscaling; and changed axis, set_xlim, and set_ylim so that by Modified: trunk/matplotlib/CXX/WrapPython.h =================================================================== --- trunk/matplotlib/CXX/WrapPython.h 2010-07-02 17:24:37 UTC (rev 8483) +++ trunk/matplotlib/CXX/WrapPython.h 2010-07-02 18:06:25 UTC (rev 8484) @@ -48,7 +48,10 @@ #if defined(_XPG4) #undef _XPG4 #endif +#if defined(_XPG3) +#undef _XPG3 #endif +#endif // Python.h will redefine these and generate warning in the process #undef _XOPEN_SOURCE This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2010-07-02 18:19:15
|
Revision: 8485 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8485&view=rev Author: jdh2358 Date: 2010-07-02 18:19:08 +0000 (Fri, 02 Jul 2010) Log Message: ----------- fix typos in gridspec docs Modified Paths: -------------- trunk/matplotlib/doc/users/gridspec.rst trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/doc/users/gridspec.rst =================================================================== --- trunk/matplotlib/doc/users/gridspec.rst 2010-07-02 18:06:25 UTC (rev 8484) +++ trunk/matplotlib/doc/users/gridspec.rst 2010-07-02 18:19:08 UTC (rev 8485) @@ -118,7 +118,7 @@ ========================== You can create GridSpec from the SubplotSpec, in which case its layout -parameters are set to that of the locataion of the given SubplotSpec. :: +parameters are set to that of the location of the given SubplotSpec. :: gs0 = gridspec.GridSpec(1, 2) @@ -134,13 +134,13 @@ By default, GridSpec creates cells of equal sizes. You can adjust relative heights and widths of rows and columns. Note that absolute -values are meaningless, onlt their relative ratios matter. :: +values are meaningless, only their relative ratios matter. :: gs = gridspec.GridSpec(2, 2, width_ratios=[1,2], height_ratios=[4,1] ) - + ax1 = plt.subplot(gs[0]) ax2 = plt.subplot(gs[1]) ax3 = plt.subplot(gs[2]) Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-07-02 18:06:25 UTC (rev 8484) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-07-02 18:19:08 UTC (rev 8485) @@ -8254,7 +8254,7 @@ triplot.__doc__ = mtri.triplot.__doc__ -from gridspec import GridSpec, SubplotSpec +from matplotlib.gridspec import GridSpec, SubplotSpec class SubplotBase: """ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2010-07-02 19:03:12
|
Revision: 8487 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8487&view=rev Author: jdh2358 Date: 2010-07-02 19:03:05 +0000 (Fri, 02 Jul 2010) Log Message: ----------- use class var rather than self for texmanager hack state Modified Paths: -------------- trunk/matplotlib/examples/pylab_examples/tex_demo.py trunk/matplotlib/lib/matplotlib/texmanager.py Modified: trunk/matplotlib/examples/pylab_examples/tex_demo.py =================================================================== --- trunk/matplotlib/examples/pylab_examples/tex_demo.py 2010-07-02 18:45:17 UTC (rev 8486) +++ trunk/matplotlib/examples/pylab_examples/tex_demo.py 2010-07-02 19:03:05 UTC (rev 8487) @@ -29,5 +29,5 @@ title(r"\TeX\ is Number $\displaystyle\sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}$!", fontsize=16, color='r') grid(True) - +#savefig('tex_demo') show() Modified: trunk/matplotlib/lib/matplotlib/texmanager.py =================================================================== --- trunk/matplotlib/lib/matplotlib/texmanager.py 2010-07-02 18:45:17 UTC (rev 8486) +++ trunk/matplotlib/lib/matplotlib/texmanager.py 2010-07-02 19:03:05 UTC (rev 8487) @@ -92,7 +92,7 @@ os.mkdir(texcache) _dvipng_hack_alpha = None - + #_dvipng_hack_alpha = dvipng_hack_alpha() # mappable cache of rgba_arrayd = {} grey_arrayd = {} @@ -455,7 +455,7 @@ report = 'No dvipng error report available.' if exit_status: raise RuntimeError('dvipng was not able to \ -process the flowing file:\n%s\nHere is the full report generated by dvipng: \ +process the following file:\n%s\nHere is the full report generated by dvipng: \ \n\n'% dvifile + report) else: mpl.verbose.report(report, 'debug') try: os.remove(outfile) @@ -516,9 +516,9 @@ if rcParams['text.dvipnghack'] is not None: hack = rcParams['text.dvipnghack'] else: - if self._dvipng_hack_alpha is None: - self._dvipng_hack_alpha = dvipng_hack_alpha() - hack = self._dvipng_hack_alpha + if TexManager._dvipng_hack_alpha is None: + TexManager._dvipng_hack_alpha = dvipng_hack_alpha() + hack = TexManager._dvipng_hack_alpha if hack: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2010-07-02 22:44:33
|
Revision: 8488 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8488&view=rev Author: efiring Date: 2010-07-02 22:44:27 +0000 (Fri, 02 Jul 2010) Log Message: ----------- tick_params works with existing ticks instead of starting with new ones Modified Paths: -------------- trunk/matplotlib/examples/pylab_examples/multiple_yaxis_with_spines.py trunk/matplotlib/lib/matplotlib/axis.py trunk/matplotlib/lib/matplotlib/projections/geo.py trunk/matplotlib/lib/matplotlib/projections/polar.py Modified: trunk/matplotlib/examples/pylab_examples/multiple_yaxis_with_spines.py =================================================================== --- trunk/matplotlib/examples/pylab_examples/multiple_yaxis_with_spines.py 2010-07-02 19:03:05 UTC (rev 8487) +++ trunk/matplotlib/examples/pylab_examples/multiple_yaxis_with_spines.py 2010-07-02 22:44:27 UTC (rev 8488) @@ -54,8 +54,13 @@ par1.yaxis.label.set_color(p2.get_color()) par2.yaxis.label.set_color(p3.get_color()) + tkw = dict(size=4, width=1.5) + host.tick_params(axis='y', colors=p1.get_color(), **tkw) + par1.tick_params(axis='y', colors=p2.get_color(), **tkw) + par2.tick_params(axis='y', colors=p3.get_color(), **tkw) + host.tick_params(axis='x', **tkw) + lines = [p1, p2, p3] host.legend(lines, [l.get_label() for l in lines]) - plt.draw() plt.show() Modified: trunk/matplotlib/lib/matplotlib/axis.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axis.py 2010-07-02 19:03:05 UTC (rev 8487) +++ trunk/matplotlib/lib/matplotlib/axis.py 2010-07-02 22:44:27 UTC (rev 8488) @@ -84,7 +84,8 @@ """ artist.Artist.__init__(self) - if gridOn is None: gridOn = rcParams['axes.grid'] + if gridOn is None: + gridOn = rcParams['axes.grid'] self.set_figure(axes.figure) self.axes = axes @@ -148,18 +149,11 @@ self.update_position(loc) def apply_tickdir(self, tickdir): - if tickdir is None: - tickdir = rcParams['%s.direction' % self._name] - self._tickdir = tickdir + """ + Calculate self._pad and self._tickmarkers + """ + pass - if self._tickdir == 'in': - self._xtickmarkers = (mlines.TICKUP, mlines.TICKDOWN) - self._ytickmarkers = (mlines.TICKRIGHT, mlines.TICKLEFT) - self._pad = self._base_pad - else: - self._xtickmarkers = (mlines.TICKDOWN, mlines.TICKUP) - self._ytickmarkers = (mlines.TICKLEFT, mlines.TICKRIGHT) - self._pad = self._base_pad + self._size def get_children(self): children = [self.tick1line, self.tick2line, self.gridline, self.label1, self.label2] @@ -271,20 +265,81 @@ def set_view_interval(self, vmin, vmax, ignore=False): raise NotImplementedError('Derived must override') + def _apply_params(self, **kw): + switchkw = ['gridOn', 'tick1On', 'tick2On', 'label1On', 'label2On'] + switches = [k for k in kw if k in switchkw] + for k in switches: + setattr(self, k, kw.pop(k)) + dirpad = [k for k in kw if k in ['pad', 'tickdir']] + if dirpad: + self._base_pad = kw.pop('pad', self._base_pad) + self.apply_tickdir(kw.pop('tickdir', self._tickdir)) + trans = self._get_text1_transform()[0] + self.label1.set_transform(trans) + trans = self._get_text2_transform()[0] + self.label2.set_transform(trans) + self.tick1line.set_marker(self._tickmarkers[0]) + self.tick2line.set_marker(self._tickmarkers[1]) + tick_kw = dict([kv for kv in kw.items() + if kv[0] in ['color', 'zorder']]) + if tick_kw: + self.tick1line.set(**tick_kw) + self.tick2line.set(**tick_kw) + for k, v in tick_kw.items(): + setattr(self, '_'+k, v) + tick_list = [kv for kv in kw.items() if kv[0] in ['size', 'width']] + for k, v in tick_list: + setattr(self, '_'+k, v) + if k == 'size': + self.tick1line.set_markersize(v) + self.tick2line.set_markersize(v) + else: + self.tick1line.set_markeredgewidth(v) + self.tick2line.set_markeredgewidth(v) + label_list = [k for k in kw.items() + if k[0] in ['labelsize', 'labelcolor']] + if label_list: + label_kw = dict([(k[5:], v) for (k, v) in label_list]) + self.label1.set(**label_kw) + self.label2.set(**label_kw) + for k, v in label_kw.items(): + setattr(self, '_'+k, v) + + class XTick(Tick): """ Contains all the Artists needed to make an x tick - the tick line, the label text and the grid line """ __name__ = 'xtick' + + def _get_text1_transform(self): + return self.axes.get_xaxis_text1_transform(self._pad) + + def _get_text2_transform(self): + return self.axes.get_xaxis_text2_transform(self._pad) + + def apply_tickdir(self, tickdir): + if tickdir is None: + tickdir = rcParams['%s.direction' % self._name] + self._tickdir = tickdir + + if self._tickdir == 'in': + self._tickmarkers = (mlines.TICKUP, mlines.TICKDOWN) + self._pad = self._base_pad + else: + self._tickmarkers = (mlines.TICKDOWN, mlines.TICKUP) + self._pad = self._base_pad + self._size + + def _get_text1(self): 'Get the default Text instance' # the y loc is 3 points below the min of y axis # get the affine as an a,b,c,d,tx,ty list # x in data coords, y in axes coords #t = mtext.Text( - trans, vert, horiz = self.axes.get_xaxis_text1_transform(self._pad) + trans, vert, horiz = self._get_text1_transform() t = mtext.Text( x=0, y=0, fontproperties=font_manager.FontProperties(size=self._labelsize), @@ -302,7 +357,7 @@ 'Get the default Text 2 instance' # x in data coords, y in axes coords #t = mtext.Text( - trans, vert, horiz = self.axes.get_xaxis_text2_transform(self._pad) + trans, vert, horiz = self._get_text2_transform() t = mtext.Text( x=0, y=1, fontproperties=font_manager.FontProperties(size=self._labelsize), @@ -320,7 +375,7 @@ l = mlines.Line2D(xdata=(0,), ydata=(0,), color=self._color, linestyle = 'None', - marker = self._xtickmarkers[0], + marker = self._tickmarkers[0], markersize=self._size, markeredgewidth=self._width, zorder=self._zorder, @@ -335,7 +390,7 @@ l = mlines.Line2D( xdata=(0,), ydata=(1,), color=self._color, linestyle = 'None', - marker = self._xtickmarkers[1], + marker = self._tickmarkers[1], markersize=self._size, markeredgewidth=self._width, zorder=self._zorder, @@ -412,11 +467,30 @@ """ __name__ = 'ytick' + def _get_text1_transform(self): + return self.axes.get_yaxis_text1_transform(self._pad) + + def _get_text2_transform(self): + return self.axes.get_yaxis_text2_transform(self._pad) + + def apply_tickdir(self, tickdir): + if tickdir is None: + tickdir = rcParams['%s.direction' % self._name] + self._tickdir = tickdir + + if self._tickdir == 'in': + self._tickmarkers = (mlines.TICKRIGHT, mlines.TICKLEFT) + self._pad = self._base_pad + else: + self._tickmarkers = (mlines.TICKLEFT, mlines.TICKRIGHT) + self._pad = self._base_pad + self._size + + # how far from the y axis line the right of the ticklabel are def _get_text1(self): 'Get the default Text instance' # x in axes coords, y in data coords - trans, vert, horiz = self.axes.get_yaxis_text1_transform(self._pad) + trans, vert, horiz = self._get_text1_transform() t = mtext.Text( x=0, y=0, fontproperties=font_manager.FontProperties(size=self._labelsize), @@ -432,7 +506,7 @@ def _get_text2(self): 'Get the default Text instance' # x in axes coords, y in data coords - trans, vert, horiz = self.axes.get_yaxis_text2_transform(self._pad) + trans, vert, horiz = self._get_text2_transform() t = mtext.Text( x=1, y=0, fontproperties=font_manager.FontProperties(size=self._labelsize), @@ -450,7 +524,7 @@ l = mlines.Line2D( (0,), (0,), color=self._color, - marker = self._ytickmarkers[0], + marker = self._tickmarkers[0], linestyle = 'None', markersize=self._size, markeredgewidth=self._width, @@ -465,7 +539,7 @@ # x in axes coords, y in data coords l = mlines.Line2D( (1,), (0,), color=self._color, - marker = self._ytickmarkers[1], + marker = self._tickmarkers[1], linestyle = 'None', markersize=self._size, markeredgewidth=self._width, @@ -715,7 +789,15 @@ if reset: d.clear() d.update(kwtrans) - self.reset_ticks() + if reset: + self.reset_ticks() + else: + if which == 'major' or which == 'both': + for tick in self.majorTicks: + tick._apply_params(**self._major_tick_kw) + if which == 'minor' or which == 'both': + for tick in self.minorTicks: + tick._apply_params(**self._minor_tick_kw) @staticmethod def _translate_tick_kw(kw, to_init_kw=True): @@ -733,7 +815,7 @@ # The following lists may be moved to a more # accessible location. kwkeys0 = ['size', 'width', 'color', 'tickdir', 'pad', - 'labelsize', 'labelcolor', 'zorder', + 'labelsize', 'labelcolor', 'zorder', 'gridOn', 'tick1On', 'tick2On', 'label1On', 'label2On'] kwkeys1 = ['length', 'direction', 'left', 'bottom', 'right', 'top', 'labelleft', 'labelbottom', 'labelright', 'labeltop'] @@ -1144,21 +1226,26 @@ if len(kwargs): b = True which = which.lower() if which in ['minor', 'both']: - if b is None: self._gridOnMinor = not self._gridOnMinor - else: self._gridOnMinor = b + 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) + self._minor_tick_kw['gridOn'] = self._gridOnMinor if which in ['major', 'both']: - if b is None: self._gridOnMajor = not self._gridOnMajor - else: self._gridOnMajor = b + if b is None: + self._gridOnMajor = not self._gridOnMajor + else: + self._gridOnMajor = b for tick in self.majorTicks: # don't use get_ticks here! if tick is None: continue tick.gridOn = self._gridOnMajor if len(kwargs): artist.setp(tick.gridline,**kwargs) + self._major_tick_kw['gridOn'] = self._gridOnMajor - def update_units(self, data): """ introspect *data* for units converter and update the @@ -1552,50 +1639,30 @@ """ Set the ticks position (top, bottom, both, default or none) both sets the ticks to appear on both positions, but does not - change the tick labels. default resets the tick positions to - the default: ticks on both positions, labels at bottom. none - can be used if you don't want any ticks. + change the tick labels. 'default' resets the tick positions to + the default: ticks on both positions, labels at bottom. 'none' + can be used if you don't want any ticks. 'none' and 'both' + affect only the ticks, not the labels. ACCEPTS: [ 'top' | 'bottom' | 'both' | 'default' | 'none' ] """ - assert position in ('top', 'bottom', 'both', 'default', 'none') - - - # The first ticks of major & minor ticks should always be - # included, otherwise, the information can be lost. Thus, use - # majorTicks instead of get_major_ticks() which may return - # empty list. - ticks = list( self.majorTicks ) # a copy - ticks.extend( self.minorTicks ) - if position == 'top': - for t in ticks: - t.tick1On = False - t.tick2On = True - t.label1On = False - t.label2On = True + self.set_tick_params(which='both', top=True, labeltop=True, + bottom=False, labelbottom=False) elif position == 'bottom': - for t in ticks: - t.tick1On = True - t.tick2On = False - t.label1On = True - t.label2On = False + self.set_tick_params(which='both', top=False, labeltop=False, + bottom=True, labelbottom=True) + elif position == 'both': + self.set_tick_params(which='both', top=True, + bottom=True) + elif position == 'none': + self.set_tick_params(which='both', top=False, + bottom=False) elif position == 'default': - for t in ticks: - t.tick1On = True - t.tick2On = True - t.label1On = True - t.label2On = False - elif position == 'none': - for t in ticks: - t.tick1On = False - t.tick2On = False + self.set_tick_params(which='both', top=True, labeltop=False, + bottom=True, labelbottom=True) else: - for t in ticks: - t.tick1On = True - t.tick2On = True - for t in ticks: - t.update_position(t._loc) + raise ValueError("invalid position: %s" % position) def tick_top(self): 'use ticks only on top' @@ -1829,45 +1896,23 @@ ACCEPTS: [ 'left' | 'right' | 'both' | 'default' | 'none' ] """ - assert position in ('left', 'right', 'both', 'default', 'none') - - # The first ticks of major & minor ticks should always be - # included, otherwise, the information can be lost. Thus, use - # majorTicks instead of get_major_ticks() which may return - # empty list. - ticks = list( self.majorTicks ) # a copy - ticks.extend( self.minorTicks ) - if position == 'right': - self.set_offset_position('right') - for t in ticks: - t.tick1On = False - t.tick2On = True - t.label1On = False - t.label2On = True + self.set_tick_params(which='both', right=True, labelright=True, + left=False, labelleft=False) elif position == 'left': - self.set_offset_position('left') - for t in ticks: - t.tick1On = True - t.tick2On = False - t.label1On = True - t.label2On = False + self.set_tick_params(which='both', right=False, labelright=False, + left=True, labelleft=True) + elif position == 'both': + self.set_tick_params(which='both', right=True, + left=True) + elif position == 'none': + self.set_tick_params(which='both', right=False, labelright=False, + left=False, labelleft=False) elif position == 'default': - self.set_offset_position('left') - for t in ticks: - t.tick1On = True - t.tick2On = True - t.label1On = True - t.label2On = False - elif position == 'none': - for t in ticks: - t.tick1On = False - t.tick2On = False + self.set_tick_params(which='both', right=True, labelright=False, + left=True, labelleft=True) else: - self.set_offset_position('left') - for t in ticks: - t.tick1On = True - t.tick2On = True + raise ValueError("invalid position: %s" % position) def tick_right(self): 'use ticks only on right' Modified: trunk/matplotlib/lib/matplotlib/projections/geo.py =================================================================== --- trunk/matplotlib/lib/matplotlib/projections/geo.py 2010-07-02 19:03:05 UTC (rev 8487) +++ trunk/matplotlib/lib/matplotlib/projections/geo.py 2010-07-02 22:44:27 UTC (rev 8488) @@ -55,6 +55,9 @@ self.yaxis.set_minor_locator(NullLocator()) self.xaxis.set_ticks_position('none') self.yaxis.set_ticks_position('none') + self.yaxis.set_tick_params(label1On=True) + # Why do we need to turn on yaxis tick labels, but + # xaxis tick labels are already on? self.grid(rcParams['axes.grid']) Modified: trunk/matplotlib/lib/matplotlib/projections/polar.py =================================================================== --- trunk/matplotlib/lib/matplotlib/projections/polar.py 2010-07-02 19:03:05 UTC (rev 8487) +++ trunk/matplotlib/lib/matplotlib/projections/polar.py 2010-07-02 22:44:27 UTC (rev 8488) @@ -226,6 +226,9 @@ self.grid(rcParams['polaraxes.grid']) self.xaxis.set_ticks_position('none') self.yaxis.set_ticks_position('none') + self.yaxis.set_tick_params(label1On=True) + # Why do we need to turn on yaxis tick labels, but + # xaxis tick labels are already on? def _init_axis(self): "move this out of __init__ because non-separable axes don't use it" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2010-07-05 19:03:16
|
Revision: 8494 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8494&view=rev Author: efiring Date: 2010-07-05 19:03:09 +0000 (Mon, 05 Jul 2010) Log Message: ----------- tkagg and fltkagg backends now have blocking show() like all the others Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py trunk/matplotlib/lib/matplotlib/rcsetup.py trunk/matplotlib/matplotlibrc.template Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2010-07-05 01:26:53 UTC (rev 8493) +++ trunk/matplotlib/CHANGELOG 2010-07-05 19:03:09 UTC (rev 8494) @@ -1,3 +1,8 @@ +2010-07-05 TkAgg and FltkAgg backends are now consistent with other + interactive backends: when used in scripts from the + command line (not from ipython -pylab), show blocks, + and can be called more than once. + 2010-07-02 Modified CXX/WrapPython.h to fix "swab bug" on solaris so mpl can compile on Solaris with CXX6 in the trunk. Closes tracker bug 3022815 - JDH Modified: trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py 2010-07-05 01:26:53 UTC (rev 8493) +++ trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py 2010-07-05 19:03:09 UTC (rev 8494) @@ -97,15 +97,8 @@ """ for manager in Gcf.get_all_fig_managers(): manager.show() - #mainloop, if an fltk program exist no need to call that - #threaded (and interractive) version - if show._needmain: - Fltk.Fl.run() - show._needmain = False + Fltk.Fl.run() -show._needmain = True - - def new_figure_manager(num, *args, **kwargs): """ Create a new figure manager instance Modified: trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py 2010-07-05 01:26:53 UTC (rev 8493) +++ trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py 2010-07-05 19:03:09 UTC (rev 8494) @@ -64,43 +64,15 @@ figManager.show() -def show(block=False): +def show(): """ Show all figures. - Temporary, experimental kwarg *block* defaults to False to - provide the behavior present throughout mpl history to date: - interactive mode is forced on, and show does not block. - - Set *block* to True to test the proposed new behavior, - consistent with other backends, in which show does not affect - interactive mode, and always blocks until all figures are closed. - In addition, the rcParam['tk.pythoninspect'] is ignored. - - Use this kwarg only for testing; other backends do not accept - a kwarg to show, and might never do so. """ for manager in Gcf.get_all_fig_managers(): manager.show() - if block: - # proposed new behavior; seems to make this backend consistent - # with others, with no drawbacks identified yet. - Tk.mainloop() - else: - # long-time behavior: non-blocking, forces interactive mode - import matplotlib - matplotlib.interactive(True) - if rcParams['tk.pythoninspect']: - os.environ['PYTHONINSPECT'] = '1' - if show._needmain: - Tk.mainloop() - show._needmain = False + Tk.mainloop() -show._needmain = True # This can go away if we eliminate block=False option. - - - - def new_figure_manager(num, *args, **kwargs): """ Create a new figure manager instance Modified: trunk/matplotlib/lib/matplotlib/rcsetup.py =================================================================== --- trunk/matplotlib/lib/matplotlib/rcsetup.py 2010-07-05 01:26:53 UTC (rev 8493) +++ trunk/matplotlib/lib/matplotlib/rcsetup.py 2010-07-05 19:03:09 UTC (rev 8494) @@ -297,6 +297,11 @@ warnings.warn("Deprecated negative_linestyle specification; use 'solid' or 'dashed'") return (0, dashes) # (offset, (solid, blank)) +def validate_tkpythoninspect(s): + # Introduced 2010/07/05 + warnings.warn("tk.pythoninspect is obsolete, and has no effect") + return validate_bool(s) + validate_legend_loc = ValidateInStrings('legend_loc',[ 'best', 'upper right', @@ -526,7 +531,7 @@ 'cairo.format' : ['png', validate_cairo_format], 'tk.window_focus' : [False, validate_bool], # Maintain shell focus for TkAgg - 'tk.pythoninspect' : [False, validate_bool], # Set PYTHONINSPECT + 'tk.pythoninspect' : [False, validate_tkpythoninspect], # obsolete 'ps.papersize' : ['letter', validate_ps_papersize], # Set the papersize/type 'ps.useafm' : [False, validate_bool], # Set PYTHONINSPECT 'ps.usedistiller' : [False, validate_ps_distiller], # use ghostscript or xpdf to distill ps output Modified: trunk/matplotlib/matplotlibrc.template =================================================================== --- trunk/matplotlib/matplotlibrc.template 2010-07-05 01:26:53 UTC (rev 8493) +++ trunk/matplotlib/matplotlibrc.template 2010-07-05 19:03:09 UTC (rev 8494) @@ -319,7 +319,6 @@ # tk backend params #tk.window_focus : False # Maintain shell focus for TkAgg -#tk.pythoninspect : False # tk sets PYTHONINSEPCT # ps backend params #ps.papersize : letter # auto, letter, legal, ledger, A0-A10, B0-B10 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2010-07-05 20:47:45
|
Revision: 8496 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8496&view=rev Author: efiring Date: 2010-07-05 20:47:39 +0000 (Mon, 05 Jul 2010) Log Message: ----------- set_xlim, set_ylim accept descriptive kwargs: left, right, bottom, top Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/doc/api/api_changes.rst trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2010-07-05 19:39:59 UTC (rev 8495) +++ trunk/matplotlib/CHANGELOG 2010-07-05 20:47:39 UTC (rev 8496) @@ -1,7 +1,11 @@ +2010-07-05 Preferred kwarg names in set_xlim are now 'left' and + 'right'; in set_ylim, 'bottom' and 'top'; original + kwargs are still accepted without complaint. - EF + 2010-07-05 TkAgg and FltkAgg backends are now consistent with other interactive backends: when used in scripts from the command line (not from ipython -pylab), show blocks, - and can be called more than once. + and can be called more than once. - EF 2010-07-02 Modified CXX/WrapPython.h to fix "swab bug" on solaris so mpl can compile on Solaris with CXX6 in the trunk. Closes Modified: trunk/matplotlib/doc/api/api_changes.rst =================================================================== --- trunk/matplotlib/doc/api/api_changes.rst 2010-07-05 19:39:59 UTC (rev 8495) +++ trunk/matplotlib/doc/api/api_changes.rst 2010-07-05 20:47:39 UTC (rev 8496) @@ -16,7 +16,10 @@ pyplot functions, has been changed: when view limits are set explicitly with one of these methods, autoscaling is turned off for the matching axis. A new *auto* kwarg is available to - control this behavior. + control this behavior. The limit kwargs have been renamed to + *left* and *right* instead of *xmin* and *xmax*, and *bottom* + and *top* instead of *ymin* and *ymax*. The old names may still + be used, however. * There are five new Axes methods with corresponding pyplot functions to facilitate autoscaling, tick location, and tick Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-07-05 19:39:59 UTC (rev 8495) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-07-05 20:47:39 UTC (rev 8496) @@ -2298,11 +2298,11 @@ def get_xlim(self): """ - Get the x-axis range [*xmin*, *xmax*] + Get the x-axis range [*left*, *right*] """ return tuple(self.viewLim.intervalx) - def set_xlim(self, xmin=None, xmax=None, emit=True, auto=False): + def set_xlim(self, left=None, right=None, emit=True, auto=False, **kw): """ call signature:: @@ -2314,23 +2314,23 @@ set_xlim((left, right)) set_xlim(left, right) - set_xlim(xmin=1) # right unchanged - set_xlim(xmax=1) # left unchanged + set_xlim(left=1) # right unchanged + set_xlim(right=1) # left unchanged Keyword arguments: - *xmin*: scalar - the left xlim - *xmax*: scalar - the right xlim + *left*: scalar + the left xlim; *xmin*, the previous name, may still be used + *right*: scalar + the right xlim; *xmax*, the previous name, may still be used *emit*: [ True | False ] notify observers of lim change *auto*: [ True | False | None ] turn *x* autoscaling on (True), off (False; default), or leave unchanged (None) - Note: the kwarg terminology may be confusing. The first value, - *xmin*, is the left, and the second, *xmax*, is the right. + Note: the *left* (formerly *xmin*) value may be greater than + the *right* (formerly *xmax*). For example, suppose *x* is years before present. Then one might use:: @@ -2343,26 +2343,34 @@ ACCEPTS: len(2) sequence of floats """ - if xmax is None and iterable(xmin): - xmin,xmax = xmin + if 'xmin' in kw: + left = kw.pop('xmin') + if 'xmax' in kw: + right = kw.pop('xmax') + if kw: + raise ValueError("unrecognized kwargs: %s" % kw.keys()) + if right is None and iterable(left): + left,right = left - self._process_unit_info(xdata=(xmin, xmax)) - if xmin is not None: - xmin = self.convert_xunits(xmin) - if xmax is not None: - xmax = self.convert_xunits(xmax) + self._process_unit_info(xdata=(left, right)) + if left is not None: + left = self.convert_xunits(left) + if right is not None: + right = self.convert_xunits(right) - old_xmin,old_xmax = self.get_xlim() - if xmin is None: xmin = old_xmin - if xmax is None: xmax = old_xmax + old_left, old_right = self.get_xlim() + if left is None: left = old_left + if right is None: right = old_right - if xmin==xmax: - warnings.warn('Attempting to set identical xmin==xmax results in singular transformations; automatically expanding. xmin=%s, xmax=%s'%(xmin, xmax)) - xmin, xmax = mtransforms.nonsingular(xmin, xmax, increasing=False) - xmin, xmax = self.xaxis.limit_range_for_scale(xmin, xmax) + if left==right: + warnings.warn(('Attempting to set identical left==right results\n' + + 'in singular transformations; automatically expanding.\n' + + 'left=%s, right=%s') % (left, right)) + left, right = mtransforms.nonsingular(left, right, increasing=False) + left, right = self.xaxis.limit_range_for_scale(left, right) - self.viewLim.intervalx = (xmin, xmax) + self.viewLim.intervalx = (left, right) if auto is not None: self._autoscaleXon = bool(auto) @@ -2377,7 +2385,7 @@ other.figure.canvas is not None): other.figure.canvas.draw_idle() - return xmin, xmax + return left, right def get_xscale(self): 'return the xaxis scale string: %s' % ( @@ -2492,11 +2500,11 @@ def get_ylim(self): """ - Get the y-axis range [*ymin*, *ymax*] + Get the y-axis range [*bottom*, *top*] """ return tuple(self.viewLim.intervaly) - def set_ylim(self, ymin=None, ymax=None, emit=True, auto=False): + def set_ylim(self, bottom=None, top=None, emit=True, auto=False, **kw): """ call signature:: @@ -2508,23 +2516,23 @@ set_ylim((bottom, top)) set_ylim(bottom, top) - set_ylim(ymin=1) # top unchanged - set_ylim(ymax=1) # bottom unchanged + set_ylim(bottom=1) # top unchanged + set_ylim(top=1) # bottom unchanged Keyword arguments: - *ymin*: scalar - the bottom ylim - *ymax*: scalar - the top ylim + *bottom*: scalar + the bottom ylim; the previous name, *ymin*, may still be used + *top*: scalar + the top ylim; the previous name, *ymax*, may still be used *emit*: [ True | False ] notify observers of lim change *auto*: [ True | False | None ] turn *y* autoscaling on (True), off (False; default), or leave unchanged (None) - Note: the kwarg terminology may be confusing. The first value, - *ymin*, is the bottom, and the second, *ymax*, is the top. + Note: the *bottom* (formerly *ymin*) value may be greater than + the *top* (formerly *ymax*). For example, suppose *y* is depth in the ocean. Then one might use:: @@ -2537,26 +2545,35 @@ ACCEPTS: len(2) sequence of floats """ - if ymax is None and iterable(ymin): - ymin,ymax = ymin + if 'ymin' in kw: + bottom = kw.pop('ymin') + if 'ymax' in kw: + top = kw.pop('ymax') + if kw: + raise ValueError("unrecognized kwargs: %s" % kw.keys()) - if ymin is not None: - ymin = self.convert_yunits(ymin) - if ymax is not None: - ymax = self.convert_yunits(ymax) + if top is None and iterable(bottom): + bottom,top = bottom - old_ymin,old_ymax = self.get_ylim() + if bottom is not None: + bottom = self.convert_yunits(bottom) + if top is not None: + top = self.convert_yunits(top) - if ymin is None: ymin = old_ymin - if ymax is None: ymax = old_ymax + old_bottom, old_top = self.get_ylim() - if ymin==ymax: - warnings.warn('Attempting to set identical ymin==ymax results in singular transformations; automatically expanding. ymin=%s, ymax=%s'%(ymin, ymax)) + if bottom is None: bottom = old_bottom + if top is None: top = old_top - ymin, ymax = mtransforms.nonsingular(ymin, ymax, increasing=False) - ymin, ymax = self.yaxis.limit_range_for_scale(ymin, ymax) + if bottom==top: + warnings.warn(('Attempting to set identical bottom==top results\n' + + 'in singular transformations; automatically expanding.\n' + + 'bottom=%s, top=%s') % (bottom, top)) - self.viewLim.intervaly = (ymin, ymax) + bottom, top = mtransforms.nonsingular(bottom, top, increasing=False) + bottom, top = self.yaxis.limit_range_for_scale(bottom, top) + + self.viewLim.intervaly = (bottom, top) if auto is not None: self._autoscaleYon = bool(auto) @@ -2571,7 +2588,7 @@ other.figure.canvas is not None): other.figure.canvas.draw_idle() - return ymin, ymax + return bottom, top def get_yscale(self): 'return the xaxis scale string: %s' % ( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2010-07-05 23:09:57
|
Revision: 8497 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8497&view=rev Author: jdh2358 Date: 2010-07-05 23:09:51 +0000 (Mon, 05 Jul 2010) Log Message: ----------- support 3d plots in arbitrary axes; thanks Ben Root Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/examples/api/compound_path.py trunk/matplotlib/lib/mpl_toolkits/mplot3d/axes3d.py Added Paths: ----------- trunk/matplotlib/examples/mplot3d/subplot3d_demo.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2010-07-05 20:47:39 UTC (rev 8496) +++ trunk/matplotlib/CHANGELOG 2010-07-05 23:09:51 UTC (rev 8497) @@ -1,3 +1,8 @@ +2010-07-05 Added Ben Root's patch to put 3D plots in arbitrary axes, + allowing you to mix 3d and 2d in different axes/subplots or + to have multiple 3D plots in one figure. See + examples/mplot3d/subplot3d_demo.py - JDH + 2010-07-05 Preferred kwarg names in set_xlim are now 'left' and 'right'; in set_ylim, 'bottom' and 'top'; original kwargs are still accepted without complaint. - EF Modified: trunk/matplotlib/examples/api/compound_path.py =================================================================== --- trunk/matplotlib/examples/api/compound_path.py 2010-07-05 20:47:39 UTC (rev 8496) +++ trunk/matplotlib/examples/api/compound_path.py 2010-07-05 23:09:51 UTC (rev 8497) @@ -21,7 +21,7 @@ vertices = np.array(vertices, float) path = Path(vertices, codes) -pathpatch = PathPatch(path, facecolor='red', edgecolor='green') +pathpatch = PathPatch(path, facecolor='None', edgecolor='green') fig = plt.figure() ax = fig.add_subplot(111) Added: trunk/matplotlib/examples/mplot3d/subplot3d_demo.py =================================================================== --- trunk/matplotlib/examples/mplot3d/subplot3d_demo.py (rev 0) +++ trunk/matplotlib/examples/mplot3d/subplot3d_demo.py 2010-07-05 23:09:51 UTC (rev 8497) @@ -0,0 +1,30 @@ +from mpl_toolkits.mplot3d.axes3d import Axes3D +from matplotlib import cm +#from matplotlib.ticker import LinearLocator, FixedLocator, FormatStrFormatter +import matplotlib.pyplot as plt +import numpy as np + +fig = plt.figure() + +ax = fig.add_subplot(1, 2, 1, projection='3d') +X = np.arange(-5, 5, 0.25) +Y = np.arange(-5, 5, 0.25) +X, Y = np.meshgrid(X, Y) +R = np.sqrt(X**2 + Y**2) +Z = np.sin(R) +surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.jet, + linewidth=0, antialiased=False) +ax.set_zlim3d(-1.01, 1.01) + +#ax.w_zaxis.set_major_locator(LinearLocator(10)) +#ax.w_zaxis.set_major_formatter(FormatStrFormatter('%.03f')) + +fig.colorbar(surf, shrink=0.5, aspect=5) + +from mpl_toolkits.mplot3d.axes3d import get_test_data +ax = fig.add_subplot(1, 2, 2, projection='3d') +X, Y, Z = get_test_data(0.05) +ax.plot_wireframe(X, Y, Z, rstride=10, cstride=10) + +plt.show() + Modified: trunk/matplotlib/lib/mpl_toolkits/mplot3d/axes3d.py =================================================================== --- trunk/matplotlib/lib/mpl_toolkits/mplot3d/axes3d.py 2010-07-05 20:47:39 UTC (rev 8496) +++ trunk/matplotlib/lib/mpl_toolkits/mplot3d/axes3d.py 2010-07-05 23:09:51 UTC (rev 8497) @@ -37,6 +37,7 @@ """ 3D axes object. """ + name = '3d' def __init__(self, fig, rect=None, *args, **kwargs): ''' @@ -1210,3 +1211,11 @@ Z = Z * 500 return X, Y, Z + + +######################################################## +# Register Axes3D as a 'projection' object available +# for use just like any other axes +######################################################## +import matplotlib.projections as proj +proj.projection_registry.register(Axes3D) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2010-07-06 01:25:04
|
Revision: 8499 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8499&view=rev Author: jdh2358 Date: 2010-07-06 01:24:58 +0000 (Tue, 06 Jul 2010) Log Message: ----------- fix some code that breaks python 2.4 Modified Paths: -------------- trunk/matplotlib/examples/api/hinton_demo.py trunk/matplotlib/lib/mpl_toolkits/axisartist/angle_helper.py Modified: trunk/matplotlib/examples/api/hinton_demo.py =================================================================== --- trunk/matplotlib/examples/api/hinton_demo.py 2010-07-06 01:05:28 UTC (rev 8498) +++ trunk/matplotlib/examples/api/hinton_demo.py 2010-07-06 01:24:58 UTC (rev 8499) @@ -8,7 +8,7 @@ def hinton(W, maxWeight=None, ax=None): """ - Draws a Hinton diagram for visualizing a weight matrix. + Draws a Hinton diagram for visualizing a weight matrix. """ if not ax: fig = plt.figure() @@ -23,13 +23,14 @@ ax.yaxis.set_major_locator(NullLocator()) for (x,y),w in np.ndenumerate(W): - color = 'white' if w > 0 else 'black' + if w > 0: color = 'white' + else: color = 'black' size = np.sqrt(np.abs(w)) rect = Rectangle([x - size / 2, y - size / 2], size, size, facecolor=color, edgecolor=color) ax.add_patch(rect) ax.autoscale_view() - + # Reverse the yaxis limits ax.set_ylim(*ax.get_ylim()[::-1]) Modified: trunk/matplotlib/lib/mpl_toolkits/axisartist/angle_helper.py =================================================================== --- trunk/matplotlib/lib/mpl_toolkits/axisartist/angle_helper.py 2010-07-06 01:05:28 UTC (rev 8498) +++ trunk/matplotlib/lib/mpl_toolkits/axisartist/angle_helper.py 2010-07-06 01:24:58 UTC (rev 8499) @@ -179,7 +179,9 @@ def __call__(self, direction, factor, values): # hour if len(values) == 0: return [] - ss = [[-1, 1][v>0] for v in values] + #ss = [[-1, 1][v>0] for v in values] #not py24 compliant + values = np.asarray(values) + ss = np.where(values>0, 1, -1) values = np.abs(values)/15. if factor == 1: @@ -221,7 +223,9 @@ def __call__(self, direction, factor, values): if len(values) == 0: return [] - ss = [[-1, 1][v>0] for v in values] + #ss = [[-1, 1][v>0] for v in values] #not py24 compliant + values = np.asarray(values) + ss = np.where(values>0, 1, -1) values = np.abs(values) if factor == 1: return ["$%d^{\circ}$" % (s*int(v),) for (s, v) in zip(ss, values)] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2010-07-06 03:05:05
|
Revision: 8501 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8501&view=rev Author: jdh2358 Date: 2010-07-06 03:04:59 +0000 (Tue, 06 Jul 2010) Log Message: ----------- add some links and fixes to whats new; bump the version num Modified Paths: -------------- trunk/matplotlib/doc/users/whats_new.rst trunk/matplotlib/lib/matplotlib/__init__.py Modified: trunk/matplotlib/doc/users/whats_new.rst =================================================================== --- trunk/matplotlib/doc/users/whats_new.rst 2010-07-06 01:43:34 UTC (rev 8500) +++ trunk/matplotlib/doc/users/whats_new.rst 2010-07-06 03:04:59 UTC (rev 8501) @@ -27,7 +27,7 @@ Jae-Joon Lee has written :mod:`~matplotlib.gridspec`, a new module for doing complex subplot layouts, featuring row and column spans and -more. See :ref:`gridspec` for a tutorial overview. +more. See :ref:`gridspec-guide` for a tutorial overview. .. plot:: users/plotting/examples/demo_gridspec01.py @@ -116,15 +116,18 @@ --------------------------------- The matplotlib trunk is probably in as good a shape as it has ever -been, thanks to improved software carpentry. We now have a buildbot -which runs a suite of nose regression tests on every svn commit, -auto-generating a set of images and comparing them against a set of -known-goods, sending emails to developers on failures with a -pixel-by-pixel image comparison. Releases and release bugfixes happen -in branches, allowing active new feature development to happen in the -trunk while keeping the release branches stable. Thanks to Andrew -Straw, Michael Droettboom and other matplotlib developers for the -heavy lifting. +been, thanks to improved `software carpentry +<http://software-carpentry.org/>`_. We now have a `buildbot +<http://buildbot.net/trac>`_ which runs a suite of `nose +<http://code.google.com/p/python-nose/>`_ regression tests on every +svn commit, auto-generating a set of images and comparing them against +a set of known-goods, sending emails to developers on failures with a +pixel-by-pixel `image comparison +<http://mpl.code.astraw.com/overview.html>`_. Releases and release +bugfixes happen in branches, allowing active new feature development +to happen in the trunk while keeping the release branches stable. +Thanks to Andrew Straw, Michael Droettboom and other matplotlib +developers for the heavy lifting. Bugfix marathon ---------------- Modified: trunk/matplotlib/lib/matplotlib/__init__.py =================================================================== --- trunk/matplotlib/lib/matplotlib/__init__.py 2010-07-06 01:43:34 UTC (rev 8500) +++ trunk/matplotlib/lib/matplotlib/__init__.py 2010-07-06 03:04:59 UTC (rev 8501) @@ -4,9 +4,9 @@ A procedural interface is provided by the companion pyplot module, which may be imported directly, e.g:: - from pyplot import * + from matplotlib.pyplot import * -To include numpy functions, use:: +To include numpy functions too, use:: from pylab import * @@ -90,8 +90,8 @@ for the first time. In particular, it must be called **before** importing pylab (if pylab is imported). -matplotlib is written by John D. Hunter (jdh2358 at gmail.com) and a -host of others. +matplotlib was initially written by John D. Hunter (jdh2358 at +gmail.com) and is now developed and maintained by a host of others. Occasionally the internal documentation (python docstrings) will refer to MATLAB®, a registered trademark of The MathWorks, Inc. @@ -99,7 +99,7 @@ """ from __future__ import generators -__version__ = '1.0rc1' +__version__ = '1.0.0svn' __revision__ = '$Revision$' __date__ = '$Date$' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2010-07-06 13:56:37
|
Revision: 8503 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8503&view=rev Author: jdh2358 Date: 2010-07-06 13:56:31 +0000 (Tue, 06 Jul 2010) Log Message: ----------- tagging for release 1.0 Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/doc/pyplots/tex_demo.png trunk/matplotlib/examples/pylab_examples/tex_demo.py trunk/matplotlib/lib/matplotlib/__init__.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2010-07-06 08:50:34 UTC (rev 8502) +++ trunk/matplotlib/CHANGELOG 2010-07-06 13:56:31 UTC (rev 8503) @@ -1,3 +1,6 @@ +2010-07-06 Tagging for mpl 1.0 at r8502 + + 2010-07-05 Added Ben Root's patch to put 3D plots in arbitrary axes, allowing you to mix 3d and 2d in different axes/subplots or to have multiple 3D plots in one figure. See Modified: trunk/matplotlib/doc/pyplots/tex_demo.png =================================================================== (Binary files differ) Modified: trunk/matplotlib/examples/pylab_examples/tex_demo.py =================================================================== --- trunk/matplotlib/examples/pylab_examples/tex_demo.py 2010-07-06 08:50:34 UTC (rev 8502) +++ trunk/matplotlib/examples/pylab_examples/tex_demo.py 2010-07-06 13:56:31 UTC (rev 8503) @@ -29,5 +29,5 @@ title(r"\TeX\ is Number $\displaystyle\sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}$!", fontsize=16, color='r') grid(True) -#savefig('tex_demo') +savefig('tex_demo') show() Modified: trunk/matplotlib/lib/matplotlib/__init__.py =================================================================== --- trunk/matplotlib/lib/matplotlib/__init__.py 2010-07-06 08:50:34 UTC (rev 8502) +++ trunk/matplotlib/lib/matplotlib/__init__.py 2010-07-06 13:56:31 UTC (rev 8503) @@ -99,7 +99,7 @@ """ from __future__ import generators -__version__ = '1.0.0svn' +__version__ = '1.0.0' __revision__ = '$Revision$' __date__ = '$Date$' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2010-07-06 15:31:35
|
Revision: 8518 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8518&view=rev Author: mdboom Date: 2010-07-06 15:31:29 +0000 (Tue, 06 Jul 2010) Log Message: ----------- Merged revisions 8514,8517 via svnmerge from https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v1_0_maint ........ r8514 | jdh2358 | 2010-07-06 10:48:31 -0400 (Tue, 06 Jul 2010) | 1 line update coding guide to point to 1.0 release branch ........ r8517 | mdboom | 2010-07-06 11:30:34 -0400 (Tue, 06 Jul 2010) | 1 line Testing merging ........ Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/doc/devel/coding_guide.rst Property Changed: ---------------- trunk/matplotlib/ Property changes on: trunk/matplotlib ___________________________________________________________________ Modified: svnmerge-integrated - /branches/mathtex:1-7263 /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-7253 /branches/v1_0_maint:1-8512 /trunk/matplotlib:1-7315 + /branches/mathtex:1-7263 /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-7253 /branches/v1_0_maint:1-8517 /trunk/matplotlib:1-7315 Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2010-07-06 15:30:34 UTC (rev 8517) +++ trunk/matplotlib/CHANGELOG 2010-07-06 15:31:29 UTC (rev 8518) @@ -1,3 +1,5 @@ +2010-07-06 Testing merging + 2010-07-06 Tagging for mpl 1.0 at r8502 Modified: trunk/matplotlib/doc/devel/coding_guide.rst =================================================================== --- trunk/matplotlib/doc/devel/coding_guide.rst 2010-07-06 15:30:34 UTC (rev 8517) +++ trunk/matplotlib/doc/devel/coding_guide.rst 2010-07-06 15:31:29 UTC (rev 8518) @@ -24,17 +24,13 @@ svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/\ matplotlib mpl --username=youruser --password=yourpass -Branch checkouts, eg the maintenance branch:: +Branch checkouts, eg the 1.0.x maintenance branch:: svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/\ - v0_99_maint mpl99 --username=youruser --password=yourpass + v1_0_maint mpl1 --username=youruser --password=yourpass -The current release of the trunk is in the 0.99.x maintenance branch:: - svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/\ - v0_99_maint mpl99 --username=youruser --password=yourpass - Committing changes ------------------ @@ -96,7 +92,7 @@ svnmerge.py merge -S BRANCHNAME Where BRANCHNAME is the name of the branch to merge *from*, - e.g. v0_99_maint. + e.g. v1_0_maint. If you wish to merge only specific revisions (in an unusual situation), do:: @@ -130,17 +126,17 @@ with this. * Creating a new branch from the trunk (if the release version is - 0.99 at revision 6573):: + 1.0 at revision 8503):: > svn copy \ - https://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib@7315 \ - https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_99_maint \ - -m "Creating maintenance branch for 0.99" + https://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib@8503 \ + https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v1_0_maint \ + -m "Creating maintenance branch for 1.0" * You can add a new branch for the trunk to "track" using "svnmerge.py init", e.g., from a working copy of the trunk:: - > svnmerge.py init https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_99_maint + > svnmerge.py init https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v1_0_maint property 'svnmerge-integrated' set on '.' After doing a "svn commit" on this, this merge tracking is available @@ -150,7 +146,7 @@ * Tracking can later be removed with the "svnmerge.py uninit" command, e.g.:: - > svnmerge.py -S v0_99_maint uninit + > svnmerge.py -S v1_0_maint uninit .. _using-git: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2010-07-06 15:32:38
|
Revision: 8520 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8520&view=rev Author: mdboom Date: 2010-07-06 15:32:32 +0000 (Tue, 06 Jul 2010) Log Message: ----------- Merged revisions 8519 via svnmerge from https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v1_0_maint ........ r8519 | mdboom | 2010-07-06 11:31:53 -0400 (Tue, 06 Jul 2010) | 1 line Testing merging (removing bogus content) ........ Modified Paths: -------------- trunk/matplotlib/CHANGELOG Property Changed: ---------------- trunk/matplotlib/ Property changes on: trunk/matplotlib ___________________________________________________________________ Modified: svnmerge-integrated - /branches/mathtex:1-7263 /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-7253 /branches/v1_0_maint:1-8517 /trunk/matplotlib:1-7315 + /branches/mathtex:1-7263 /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-7253 /branches/v1_0_maint:1-8519 /trunk/matplotlib:1-7315 Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2010-07-06 15:31:53 UTC (rev 8519) +++ trunk/matplotlib/CHANGELOG 2010-07-06 15:32:32 UTC (rev 8520) @@ -1,5 +1,3 @@ -2010-07-06 Testing merging - 2010-07-06 Tagging for mpl 1.0 at r8502 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2010-07-06 15:49:30
|
Revision: 8522 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8522&view=rev Author: jdh2358 Date: 2010-07-06 15:49:23 +0000 (Tue, 06 Jul 2010) Log Message: ----------- Merged revisions 8521 via svnmerge from https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v1_0_maint ........ r8521 | jdh2358 | 2010-07-06 10:48:16 -0500 (Tue, 06 Jul 2010) | 1 line update download site in site docs ........ Modified Paths: -------------- trunk/matplotlib/doc/_templates/indexsidebar.html Property Changed: ---------------- trunk/matplotlib/ trunk/matplotlib/doc/pyplots/README trunk/matplotlib/doc/sphinxext/gen_gallery.py trunk/matplotlib/doc/sphinxext/gen_rst.py trunk/matplotlib/examples/misc/multiprocess.py trunk/matplotlib/examples/mplot3d/contour3d_demo.py trunk/matplotlib/examples/mplot3d/contourf3d_demo.py trunk/matplotlib/examples/mplot3d/polys3d_demo.py trunk/matplotlib/examples/mplot3d/scatter3d_demo.py trunk/matplotlib/examples/mplot3d/surface3d_demo.py trunk/matplotlib/examples/mplot3d/wire3d_demo.py trunk/matplotlib/lib/matplotlib/sphinxext/mathmpl.py trunk/matplotlib/lib/matplotlib/sphinxext/only_directives.py trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_spines/spines_axes_positions.png Property changes on: trunk/matplotlib ___________________________________________________________________ Modified: svnmerge-integrated - /branches/mathtex:1-7263 /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-7253 /branches/v1_0_maint:1-8519 /trunk/matplotlib:1-7315 + /trunk/matplotlib:1-7315 /branches/v0_98_5_maint:1-7253 /branches/v0_91_maint:1-6428 /branches/mathtex:1-7263 /branches/v1_0_maint:1-8521 Modified: svn:mergeinfo - /branches/v0_91_maint:5753-5771 /branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint:7323-7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 + /branches/v0_91_maint:5753-5771 /branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint:7323-7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 /branches/v1_0_maint:8521 Modified: trunk/matplotlib/doc/_templates/indexsidebar.html =================================================================== --- trunk/matplotlib/doc/_templates/indexsidebar.html 2010-07-06 15:48:16 UTC (rev 8521) +++ trunk/matplotlib/doc/_templates/indexsidebar.html 2010-07-06 15:49:23 UTC (rev 8522) @@ -5,7 +5,7 @@ to support matplotlib development.</p> -<p>matplotlib 0.99.1 is available for <a href="https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.1/">download</a>. See <a href="{{ pathto('users/whats_new') }}">what's new</a> and tips on <a href="{{ +<p>matplotlib 1.0.0 is available for <a href="https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.0/">download</a>. See <a href="{{ pathto('users/whats_new') }}">what's new</a> and tips on <a href="{{ pathto('users/installing') }}">installing</a> </p> Property changes on: trunk/matplotlib/doc/pyplots/README ___________________________________________________________________ Modified: svn:mergeinfo - /branches/v0_98_5_maint/doc/pyplots/README:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint/doc/pyplots/README:7323-7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 + /branches/v0_98_5_maint/doc/pyplots/README:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint/doc/pyplots/README:7323-7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 /branches/v1_0_maint/doc/pyplots/README:8521 Property changes on: trunk/matplotlib/doc/sphinxext/gen_gallery.py ___________________________________________________________________ Modified: svn:mergeinfo - /branches/v0_91_maint/doc/_templates/gen_gallery.py:5753-5771 /branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py:6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint/doc/sphinxext/gen_gallery.py:7323-7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 + /branches/v0_91_maint/doc/_templates/gen_gallery.py:5753-5771 /branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py:6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint/doc/sphinxext/gen_gallery.py:7323-7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 /branches/v1_0_maint/doc/sphinxext/gen_gallery.py:8521 Property changes on: trunk/matplotlib/doc/sphinxext/gen_rst.py ___________________________________________________________________ Modified: svn:mergeinfo - /branches/v0_91_maint/doc/examples/gen_rst.py:5753-5771 /branches/v0_98_5_maint/doc/sphinxext/gen_rst.py:6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint/doc/sphinxext/gen_rst.py:7323-7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 + /branches/v0_91_maint/doc/examples/gen_rst.py:5753-5771 /branches/v0_98_5_maint/doc/sphinxext/gen_rst.py:6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint/doc/sphinxext/gen_rst.py:7323-7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 /branches/v1_0_maint/doc/sphinxext/gen_rst.py:8521 Property changes on: trunk/matplotlib/examples/misc/multiprocess.py ___________________________________________________________________ Modified: svn:mergeinfo - /branches/v0_91_maint/examples/misc/log.py:5753-5771 /branches/v0_98_5_maint/examples/misc/log.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080 /branches/v0_99_maint/examples/misc/multiprocess.py:7323-7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 + /branches/v0_91_maint/examples/misc/log.py:5753-5771 /branches/v0_98_5_maint/examples/misc/log.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080 /branches/v0_99_maint/examples/misc/multiprocess.py:7323-7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 /branches/v1_0_maint/examples/misc/multiprocess.py:8521 Property changes on: trunk/matplotlib/examples/mplot3d/contour3d_demo.py ___________________________________________________________________ Modified: svn:mergeinfo - /branches/v0_91_maint/examples/mplot3d/contour.py:5753-5771 /branches/v0_98_5_maint/examples/mplot3d/contour.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080 /branches/v0_99_maint/examples/mplot3d/contour3d_demo.py:7323-7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 + /branches/v0_91_maint/examples/mplot3d/contour.py:5753-5771 /branches/v0_98_5_maint/examples/mplot3d/contour.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080 /branches/v0_99_maint/examples/mplot3d/contour3d_demo.py:7323-7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 /branches/v1_0_maint/examples/mplot3d/contour3d_demo.py:8521 Property changes on: trunk/matplotlib/examples/mplot3d/contourf3d_demo.py ___________________________________________________________________ Modified: svn:mergeinfo - /branches/v0_91_maint/examples/mplot3d/contourf.py:5753-5771 /branches/v0_98_5_maint/examples/mplot3d/contourf.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080 /branches/v0_99_maint/examples/mplot3d/contourf3d_demo.py:7323-7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 + /branches/v0_91_maint/examples/mplot3d/contourf.py:5753-5771 /branches/v0_98_5_maint/examples/mplot3d/contourf.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080 /branches/v0_99_maint/examples/mplot3d/contourf3d_demo.py:7323-7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 /branches/v1_0_maint/examples/mplot3d/contourf3d_demo.py:8521 Property changes on: trunk/matplotlib/examples/mplot3d/polys3d_demo.py ___________________________________________________________________ Modified: svn:mergeinfo - /branches/v0_91_maint/examples/mplot3d/polys.py:5753-5771 /branches/v0_98_5_maint/examples/mplot3d/polys.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080 /branches/v0_99_maint/examples/mplot3d/polys3d_demo.py:7323-7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 + /branches/v0_91_maint/examples/mplot3d/polys.py:5753-5771 /branches/v0_98_5_maint/examples/mplot3d/polys.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080 /branches/v0_99_maint/examples/mplot3d/polys3d_demo.py:7323-7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 /branches/v1_0_maint/examples/mplot3d/polys3d_demo.py:8521 Property changes on: trunk/matplotlib/examples/mplot3d/scatter3d_demo.py ___________________________________________________________________ Modified: svn:mergeinfo - /branches/v0_91_maint/examples/mplot3d/scatter.py:5753-5771 /branches/v0_98_5_maint/examples/mplot3d/scatter.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080 /branches/v0_99_maint/examples/mplot3d/scatter3d_demo.py:7323-7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 + /branches/v0_91_maint/examples/mplot3d/scatter.py:5753-5771 /branches/v0_98_5_maint/examples/mplot3d/scatter.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080 /branches/v0_99_maint/examples/mplot3d/scatter3d_demo.py:7323-7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 /branches/v1_0_maint/examples/mplot3d/scatter3d_demo.py:8521 Property changes on: trunk/matplotlib/examples/mplot3d/surface3d_demo.py ___________________________________________________________________ Modified: svn:mergeinfo - /branches/v0_91_maint/examples/mplot3d/surface.py:5753-5771 /branches/v0_98_5_maint/examples/mplot3d/surface.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080 /branches/v0_99_maint/examples/mplot3d/surface3d_demo.py:7323-7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 + /branches/v0_91_maint/examples/mplot3d/surface.py:5753-5771 /branches/v0_98_5_maint/examples/mplot3d/surface.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080 /branches/v0_99_maint/examples/mplot3d/surface3d_demo.py:7323-7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 /branches/v1_0_maint/examples/mplot3d/surface3d_demo.py:8521 Property changes on: trunk/matplotlib/examples/mplot3d/wire3d_demo.py ___________________________________________________________________ Modified: svn:mergeinfo - /branches/v0_91_maint/examples/mplot3d/wire.py:5753-5771 /branches/v0_98_5_maint/examples/mplot3d/wire.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080 /branches/v0_99_maint/examples/mplot3d/wire3d_demo.py:7323-7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 + /branches/v0_91_maint/examples/mplot3d/wire.py:5753-5771 /branches/v0_98_5_maint/examples/mplot3d/wire.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080 /branches/v0_99_maint/examples/mplot3d/wire3d_demo.py:7323-7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 /branches/v1_0_maint/examples/mplot3d/wire3d_demo.py:8521 Property changes on: trunk/matplotlib/lib/matplotlib/sphinxext/mathmpl.py ___________________________________________________________________ Modified: svn:mergeinfo - /branches/v0_91_maint/doc/sphinxext/mathmpl.py:5753-5771 /branches/v0_98_5_maint/lib/matplotlib/sphinxext/mathmpl.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint/lib/matplotlib/sphinxext/mathmpl.py:7323-7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 + /branches/v0_91_maint/doc/sphinxext/mathmpl.py:5753-5771 /branches/v0_98_5_maint/lib/matplotlib/sphinxext/mathmpl.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint/lib/matplotlib/sphinxext/mathmpl.py:7323-7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 /branches/v1_0_maint/lib/matplotlib/sphinxext/mathmpl.py:8521 Property changes on: trunk/matplotlib/lib/matplotlib/sphinxext/only_directives.py ___________________________________________________________________ Modified: svn:mergeinfo - /branches/v0_91_maint/doc/sphinxext/only_directives.py:5753-5771 /branches/v0_98_5_maint/lib/matplotlib/sphinxext/only_directives.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint/lib/matplotlib/sphinxext/only_directives.py:7323-7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 + /branches/v0_91_maint/doc/sphinxext/only_directives.py:5753-5771 /branches/v0_98_5_maint/lib/matplotlib/sphinxext/only_directives.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint/lib/matplotlib/sphinxext/only_directives.py:7323-7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 /branches/v1_0_maint/lib/matplotlib/sphinxext/only_directives.py:8521 Property changes on: trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py ___________________________________________________________________ Modified: svn:mergeinfo - /branches/v0_91_maint/doc/sphinxext/plot_directive.py:5753-5771 /branches/v0_98_5_maint/lib/matplotlib/sphinxext/plot_directive.py:6920-6925,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint/lib/matplotlib/sphinxext/plot_directive.py:7323-7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 + /branches/v0_91_maint/doc/sphinxext/plot_directive.py:5753-5771 /branches/v0_98_5_maint/lib/matplotlib/sphinxext/plot_directive.py:6920-6925,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint/lib/matplotlib/sphinxext/plot_directive.py:7323-7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 /branches/v1_0_maint/lib/matplotlib/sphinxext/plot_directive.py:8521 Property changes on: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_spines/spines_axes_positions.png ___________________________________________________________________ Modified: svn:mergeinfo - /branches/v0_99_maint/lib/matplotlib/tests/baseline_images/test_spines/spines_axes_positions.png:7323-7337,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 + /branches/v0_99_maint/lib/matplotlib/tests/baseline_images/test_spines/spines_axes_positions.png:7323-7337,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867,7874,7884,7896,7901-7903,7916,7919,7924,7928,7944,7952,7970,7972,7981,7983,7989-7991,7998,8001,8003,8016-8057,8068,8070,8092-8116,8121-8135 /branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_spines/spines_axes_positions.png:8521 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2010-07-06 20:25:57
|
Revision: 8523 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8523&view=rev Author: mdboom Date: 2010-07-06 20:25:51 +0000 (Tue, 06 Jul 2010) Log Message: ----------- Support optional JPEG and TIFF saving if PIL is installed. Modified Paths: -------------- trunk/matplotlib/FILETYPES trunk/matplotlib/lib/matplotlib/backend_bases.py trunk/matplotlib/lib/matplotlib/backends/backend_agg.py Modified: trunk/matplotlib/FILETYPES =================================================================== --- trunk/matplotlib/FILETYPES 2010-07-06 15:49:23 UTC (rev 8522) +++ trunk/matplotlib/FILETYPES 2010-07-06 20:25:51 UTC (rev 8523) @@ -5,30 +5,33 @@ Each cell specifies the backend that actually handles the file format. A cell with a '+' in it denotes the rasterizer and the file writing -infrastructure as separate pieces. +infrastructure as separate pieces. +--------+-----+-----+-----+-------+-----+------+------+-----+-----+-----+-----+-----+-----+ | |bmp |emf |eps |jpeg |pcx |pdf |png |ps |raw |svg |svgz |tiff |xpm | +--------+-----+-----+-----+-------+-----+------+------+-----+-----+-----+-----+-----+-----+ -|Agg | |emf |ps | | |pdf |agg * |ps |agg |svg |svg | | | +|Agg | |emf |ps |agg + | |pdf |agg * |ps |agg |svg |svg |agg +| | +| | | | |pil | | | | | | | |pil | | +--------+-----+-----+-----+-------+-----+------+------+-----+-----+-----+-----+-----+-----+ |Cairo | |emf |ps | | |cairo |cairo |cairo|agg |cairo|cairo| | | |[1] | | |[2] | | | |* | | | | | | | +--------+-----+-----+-----+-------+-----+------+------+-----+-----+-----+-----+-----+-----+ -|CocoaAgg| |emf |ps | | |pdf |agg * |ps |agg |svg |svg | | | +|CocoaAgg| |emf |ps |agg + | |pdf |agg * |ps |agg |svg |svg |agg +| | +| | | | |pil | | | | | | | |pil | | +--------+-----+-----+-----+-------+-----+------+------+-----+-----+-----+-----+-----+-----+ |Emf | |emf *| | | | | | | | | | | | +--------+-----+-----+-----+-------+-----+------+------+-----+-----+-----+-----+-----+-----+ -|FltkAgg | |emf |ps | | |pdf |agg * |ps |agg |svg |svg | | | +|FltkAgg | |emf |ps |agg + | |pdf |agg * |ps |agg |svg |svg |agg +| | +| | | | |pil | | | | | | | |pil | | +--------+-----+-----+-----+-------+-----+------+------+-----+-----+-----+-----+-----+-----+ |Gd | | | | | | |gd * | | | | | | | +--------+-----+-----+-----+-------+-----+------+------+-----+-----+-----+-----+-----+-----+ -|Gtk | |emf |ps |gdk + | |pdf |gdk + |ps |agg |svg |svg | | | -|(gdk) | | | |pixbuf | | |pixbuf| | | | | | | +|Gtk | |emf |ps |gdk + | |pdf |gdk + |ps |agg |svg |svg |agg +| | +|(gdk) | | | |pixbuf | | |pixbuf| | | | |pil | | | | | | | | | |* | | | | | | | +--------+-----+-----+-----+-------+-----+------+------+-----+-----+-----+-----+-----+-----+ -|GtkAgg | |emf |ps |agg + | |pdf |agg + |ps |agg |svg |svg | | | -| | | | |pixbuf | | |pixbuf| | | | | | | +|GtkAgg | |emf |ps |agg + | |pdf |agg + |ps |agg |svg |svg |agg +| | +| | | | |pixbuf | | |pixbuf| | | | |pil | | | | | | | | | |* | | | | | | | +--------+-----+-----+-----+-------+-----+------+------+-----+-----+-----+-----+-----+-----+ |GtkCairo| |emf |ps |cairo +| |cairo |cairo |cairo|agg |cairo|cairo| | | @@ -41,18 +44,22 @@ +--------+-----+-----+-----+-------+-----+------+------+-----+-----+-----+-----+-----+-----+ |Ps | | |ps | | | | |ps * | | | | | | +--------+-----+-----+-----+-------+-----+------+------+-----+-----+-----+-----+-----+-----+ -|QtAgg | |emf |ps | | |pdf |agg * |ps |agg |svg |svg | | | +|QtAgg | |emf |ps |agg + | |pdf |agg * |ps |agg |svg |svg |agg +| | +| | | | |pil | | | | | | | |pil | | +--------+-----+-----+-----+-------+-----+------+------+-----+-----+-----+-----+-----+-----+ -|Qt4Agg | |emf |ps | | |pdf |agg * |ps |agg |svg |svg | | | +|Qt4Agg | |emf |ps |agg + | |pdf |agg * |ps |agg |svg |svg |agg +| | +| | | | |pil | | | | | | | |pil | | +--------+-----+-----+-----+-------+-----+------+------+-----+-----+-----+-----+-----+-----+ |Svg | | | | | | | | | |svg *|svg | | | +--------+-----+-----+-----+-------+-----+------+------+-----+-----+-----+-----+-----+-----+ -|TkAgg | |emf |ps | | |pdf |agg * |ps |agg |svg |svg | | | +|TkAgg | |emf |ps |agg + | |pdf |agg * |ps |agg |svg |svg |agg +| | +| | | | |pil | | | | | | | |pil | | +--------+-----+-----+-----+-------+-----+------+------+-----+-----+-----+-----+-----+-----+ |Wx |wx + |emf |ps |wx + wx|wx + |pdf |wx + |ps |agg |svg |svg |wx + |wx + | | |wx | | | |wx | |wx * | | | | |wx |wx | +--------+-----+-----+-----+-------+-----+------+------+-----+-----+-----+-----+-----+-----+ -|WxAgg | |emf |ps | | |pdf |agg * |ps |agg |svg |svg | | | +|WxAgg | |emf |ps |agg + | |pdf |agg * |ps |agg |svg |svg |agg +| | +| | | | |pil | | | | | | | |pil | | +--------+-----+-----+-----+-------+-----+------+------+-----+-----+-----+-----+-----+-----+ * Default filetype for the backend Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backend_bases.py 2010-07-06 15:49:23 UTC (rev 8522) +++ trunk/matplotlib/lib/matplotlib/backend_bases.py 2010-07-06 20:25:51 UTC (rev 8523) @@ -41,8 +41,12 @@ import matplotlib.textpath as textpath from matplotlib.path import Path +try: + import Image + _has_pil = True +except ImportError: + _has_pil = False - _backend_d = {} def register_backend(format, backend_class): @@ -1721,6 +1725,40 @@ svg = self.switch_backends(FigureCanvasSVG) return svg.print_svgz(*args, **kwargs) + if _has_pil: + filetypes['jpg'] = filetypes['jpeg'] = 'Joint Photographic Experts Group' + def print_jpg(self, filename_or_obj, *args, **kwargs): + """ + Supported kwargs: + + *quality*: The image quality, on a scale from 1 (worst) to + 95 (best). The default is 75. Values above 95 should + be avoided; 100 completely disables the JPEG + quantization stage. + + *optimize*: If present, indicates that the encoder should + make an extra pass over the image in order to select + optimal encoder settings. + + *progressive*: If present, indicates that this image + should be stored as a progressive JPEG file. + """ + from backends.backend_agg import FigureCanvasAgg # lazy import + agg = self.switch_backends(FigureCanvasAgg) + buf, size = agg.print_to_buffer() + image = Image.frombuffer('RGBA', size, buf, 'raw', 'RGBA', 0, 1) + return image.save(filename_or_obj, **kwargs) + print_jpeg = print_jpg + + filetypes['tif'] = filetypes['tiff'] = 'Tagged Image File Format' + def print_tif(self, filename_or_obj, *args, **kwargs): + from backends.backend_agg import FigureCanvasAgg # lazy import + agg = self.switch_backends(FigureCanvasAgg) + buf, size = agg.print_to_buffer() + image = Image.frombuffer('RGBA', size, buf, 'raw', 'RGBA', 0, 1) + return image.save(filename_or_obj) + print_tiff = print_tif + def get_supported_filetypes(self): return self.filetypes Modified: trunk/matplotlib/lib/matplotlib/backends/backend_agg.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2010-07-06 15:49:23 UTC (rev 8522) +++ trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2010-07-06 20:25:51 UTC (rev 8523) @@ -445,3 +445,13 @@ renderer.width, renderer.height, filename_or_obj, self.figure.dpi) renderer.dpi = original_dpi + + def print_to_buffer(self): + FigureCanvasAgg.draw(self) + renderer = self.get_renderer() + original_dpi = renderer.dpi + renderer.dpi = self.figure.dpi + result = (renderer._renderer.buffer_rgba(0, 0), + (int(renderer.width), int(renderer.height))) + renderer.dpi = original_dpi + return result This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |