From: <jd...@us...> - 2008-06-23 14:47:23
|
Revision: 5645 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5645&view=rev Author: jdh2358 Date: 2008-06-23 07:46:13 -0700 (Mon, 23 Jun 2008) Log Message: ----------- commited olle's linestyle patch patch Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/patches.py Modified: trunk/matplotlib/lib/matplotlib/patches.py =================================================================== --- trunk/matplotlib/lib/matplotlib/patches.py 2008-06-23 12:58:30 UTC (rev 5644) +++ trunk/matplotlib/lib/matplotlib/patches.py 2008-06-23 14:46:13 UTC (rev 5645) @@ -55,6 +55,7 @@ edgecolor=None, facecolor=None, linewidth=None, + linestyle=None, antialiased = None, hatch = None, fill=True, @@ -67,11 +68,13 @@ artist.Artist.__init__(self) if linewidth is None: linewidth = mpl.rcParams['patch.linewidth'] + if linestyle is None: linestyle = "solid" if antialiased is None: antialiased = mpl.rcParams['patch.antialiased'] self.set_edgecolor(edgecolor) self.set_facecolor(facecolor) self.set_linewidth(linewidth) + self.set_linestyle(linestyle) self.set_antialiased(antialiased) self.set_hatch(hatch) self.fill = fill @@ -118,6 +121,7 @@ self.set_fill(other.get_fill()) self.set_hatch(other.get_hatch()) self.set_linewidth(other.get_linewidth()) + self.set_linestyle(other.get_linestyle) self.set_transform(other.get_data_transform()) self.set_figure(other.get_figure()) self.set_alpha(other.get_alpha()) @@ -149,6 +153,10 @@ def get_linewidth(self): return self._linewidth get_lw = get_linewidth + + def get_linestyle(self): + return self._linestyle + get_ls = get_linestyle def set_antialiased(self, aa): """ @@ -189,7 +197,17 @@ if w is None: w = mpl.rcParams['patch.linewidth'] self._linewidth = w set_lw = set_linewidth + + def set_linestyle(self, ls): + """ + Set the patch linestyle + ACCEPTS: ['solid' | 'dashed' | 'dashdot' | 'dotted'] + """ + if ls is None: ls = "solid" + self._linestyle = ls + set_ls = set_linestyle + def set_fill(self, b): """ Set whether to fill the patch @@ -243,6 +261,7 @@ else: gc.set_foreground(self._edgecolor) gc.set_linewidth(self._linewidth) + gc.set_linestyle(self._linestyle) gc.set_alpha(self._alpha) gc.set_antialiased(self._antialiased) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |