From: <md...@us...> - 2008-12-29 14:23:28
|
Revision: 6710 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6710&view=rev Author: mdboom Date: 2008-12-29 14:23:24 +0000 (Mon, 29 Dec 2008) Log Message: ----------- Update hatch documentation. Modified Paths: -------------- trunk/matplotlib/examples/pylab_examples/hatch_demo.py trunk/matplotlib/lib/matplotlib/patches.py Modified: trunk/matplotlib/examples/pylab_examples/hatch_demo.py =================================================================== --- trunk/matplotlib/examples/pylab_examples/hatch_demo.py 2008-12-29 14:10:22 UTC (rev 6709) +++ trunk/matplotlib/examples/pylab_examples/hatch_demo.py 2008-12-29 14:23:24 UTC (rev 6710) @@ -1,8 +1,6 @@ """ -Hatching (pattern filled polygons) is supported currently on PS and PDF -backend only. See the set_patch method in -http://matplotlib.sf.net/matplotlib.patches.html#Patch -for details +Hatching (pattern filled polygons) is supported currently in the PS, +PDF, SVG and Agg backends only. """ import matplotlib.pyplot as plt Modified: trunk/matplotlib/lib/matplotlib/patches.py =================================================================== --- trunk/matplotlib/lib/matplotlib/patches.py 2008-12-29 14:10:22 UTC (rev 6709) +++ trunk/matplotlib/lib/matplotlib/patches.py 2008-12-29 14:23:24 UTC (rev 6710) @@ -228,11 +228,11 @@ 'return whether fill is set' return self.fill - def set_hatch(self, h): + def set_hatch(self, hatch): """ Set the hatching pattern - hatch can be one of:: + *hatch* can be one of:: / - diagonal hatching \ - back diagonal @@ -247,11 +247,9 @@ CURRENT LIMITATIONS: - 1. Hatching is supported in the PostScript and the PDF backend only. + 1. Hatching is supported in the PostScript, PDF, SVG and Agg + backends only. - 2. Hatching is done with solid black lines of width 0. - - ACCEPTS: [ '/' | '\\' | '|' | '-' | '#' | 'x' ] (ps & pdf backend only) """ self._hatch = h @@ -2655,7 +2653,7 @@ """ path = make_path_regular(path) - + if aspect_ratio is not None: # Squeeze the given height by the aspect_ratio @@ -2808,27 +2806,27 @@ [(x3+ddxB, y3+ddyB)]]), path.codes)] _fillable = [False] - + if self.beginarrow: if self.fillbegin: p = np.concatenate([verticesA, [verticesA[0], verticesA[0]], ]) - c = np.concatenate([codesA, [Path.LINETO, Path.CLOSEPOLY]]) + c = np.concatenate([codesA, [Path.LINETO, Path.CLOSEPOLY]]) _path.append(Path(p, c)) _fillable.append(True) else: _path.append(Path(verticesA, codesA)) _fillable.append(False) - + if self.endarrow: if self.fillend: _fillable.append(True) p = np.concatenate([verticesB, [verticesB[0], verticesB[0]], ]) - c = np.concatenate([codesB, [Path.LINETO, Path.CLOSEPOLY]]) + c = np.concatenate([codesB, [Path.LINETO, Path.CLOSEPOLY]]) _path.append(Path(p, c)) else: _fillable.append(False) _path.append(Path(verticesB, codesB)) - + return _path, _fillable @@ -2926,7 +2924,7 @@ super(ArrowStyle.CurveFilledA, self).__init__( \ beginarrow=True, endarrow=False, - fillbegin=True, fillend=False, + fillbegin=True, fillend=False, head_length=head_length, head_width=head_width ) _style_list["<|-"] = CurveFilledA @@ -2948,7 +2946,7 @@ super(ArrowStyle.CurveFilledB, self).__init__( \ beginarrow=False, endarrow=True, - fillbegin=False, fillend=True, + fillbegin=False, fillend=True, head_length=head_length, head_width=head_width ) _style_list["-|>"] = CurveFilledB @@ -2970,7 +2968,7 @@ super(ArrowStyle.CurveFilledAB, self).__init__( \ beginarrow=True, endarrow=True, - fillbegin=True, fillend=True, + fillbegin=True, fillend=True, head_length=head_length, head_width=head_width ) _style_list["<|-|>"] = CurveFilledAB @@ -3532,7 +3530,7 @@ if cbook.iterable(fillable): _path = concatenate_paths(_path) - + return self.get_transform().inverted().transform_path(_path) @@ -3604,8 +3602,8 @@ if not cbook.iterable(fillable): path = [path] fillable = [fillable] - + affine = transforms.IdentityTransform() renderer.open_group('patch', self.get_gid()) @@ -3615,6 +3613,6 @@ renderer.draw_path(gc, p, affine, rgbFace) else: renderer.draw_path(gc, p, affine, None) - + renderer.close_group('patch') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |