SourceForge logo
SourceForge logo
Menu

matplotlib-checkins — Commit notification. DO NOT POST to this list, just subscribe to it.

You can subscribe to this list here.

2007 Jan
Feb
Mar
Apr
May
Jun
Jul
(115)
Aug
(120)
Sep
(137)
Oct
(170)
Nov
(461)
Dec
(263)
2008 Jan
(120)
Feb
(74)
Mar
(35)
Apr
(74)
May
(245)
Jun
(356)
Jul
(240)
Aug
(115)
Sep
(78)
Oct
(225)
Nov
(98)
Dec
(271)
2009 Jan
(132)
Feb
(84)
Mar
(74)
Apr
(56)
May
(90)
Jun
(79)
Jul
(83)
Aug
(296)
Sep
(214)
Oct
(76)
Nov
(82)
Dec
(66)
2010 Jan
(46)
Feb
(58)
Mar
(51)
Apr
(77)
May
(58)
Jun
(126)
Jul
(128)
Aug
(64)
Sep
(50)
Oct
(44)
Nov
(48)
Dec
(54)
2011 Jan
(68)
Feb
(52)
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
(1)
2018 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S



1
(3)
2
3
4
(1)
5
(8)
6
(5)
7
8
9
10
11
(1)
12
13
(3)
14
(1)
15
(2)
16
(2)
17
(6)
18
(1)
19
(3)
20
21
(1)
22
23
(5)
24
(4)
25
26
(1)
27
(1)
28
(1)
29
(3)
30
(4)


Showing results of 56

<< < 1 2 3 (Page 3 of 3)
Revision: 7024
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7024&view=rev
Author: efiring
Date: 2009年04月05日 01:37:26 +0000 (2009年4月05日)
Log Message:
-----------
Fix PatchCollection bug 2723527; thanks to Thomas Robitaille
Modified Paths:
--------------
 branches/v0_98_5_maint/lib/matplotlib/collections.py
Modified: branches/v0_98_5_maint/lib/matplotlib/collections.py
===================================================================
--- branches/v0_98_5_maint/lib/matplotlib/collections.py	2009年04月04日 22:52:53 UTC (rev 7023)
+++ branches/v0_98_5_maint/lib/matplotlib/collections.py	2009年04月05日 01:37:26 UTC (rev 7024)
@@ -1108,7 +1108,7 @@
 
 facecolors = [determine_facecolor(p) for p in patches]
 edgecolors = [p.get_edgecolor() for p in patches]
- linewidths = [p.get_linewidths() for p in patches]
+ linewidths = [p.get_linewidth() for p in patches]
 antialiaseds = [p.get_antialiased() for p in patches]
 
 Collection.__init__(
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7025
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7025&view=rev
Author: efiring
Date: 2009年04月05日 02:16:44 +0000 (2009年4月05日)
Log Message:
-----------
Fix PatchCollection bug 2732455 by letting to_rgba handle 'none'
Modified Paths:
--------------
 branches/v0_98_5_maint/lib/matplotlib/colors.py
Modified: branches/v0_98_5_maint/lib/matplotlib/colors.py
===================================================================
--- branches/v0_98_5_maint/lib/matplotlib/colors.py	2009年04月05日 01:37:26 UTC (rev 7024)
+++ branches/v0_98_5_maint/lib/matplotlib/colors.py	2009年04月05日 02:16:44 UTC (rev 7025)
@@ -318,10 +318,18 @@
 Returns an *RGBA* tuple of four floats from 0-1.
 
 For acceptable values of *arg*, see :meth:`to_rgb`.
+ In addition, if *arg* is "none" (case-insensitive),
+ then (0,0,0,0) will be returned.
 If *arg* is an *RGBA* sequence and *alpha* is not *None*,
 *alpha* will replace the original *A*.
 """
 try:
+ if arg.lower() == 'none':
+ return (0.0, 0.0, 0.0, 0.0)
+ except AttributeError:
+ pass
+
+ try:
 if not cbook.is_string_like(arg) and cbook.iterable(arg):
 if len(arg) == 4:
 if [x for x in arg if (float(x) < 0) or (x > 1)]:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <ef...@us...> - 2009年04月04日 22:52:59
Revision: 7023
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7023&view=rev
Author: efiring
Date: 2009年04月04日 22:52:53 +0000 (2009年4月04日)
Log Message:
-----------
Add log scale option to clip non-positive values instead of masking
Modified Paths:
--------------
 trunk/matplotlib/CHANGELOG
 trunk/matplotlib/doc/api/api_changes.rst
 trunk/matplotlib/examples/pylab_examples/log_demo.py
 trunk/matplotlib/lib/matplotlib/axes.py
 trunk/matplotlib/lib/matplotlib/scale.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG	2009年04月01日 20:44:58 UTC (rev 7022)
+++ trunk/matplotlib/CHANGELOG	2009年04月04日 22:52:53 UTC (rev 7023)
@@ -1,3 +1,6 @@
+2009年04月04日 Allow log axis scale to clip non-positive values to
+ small positive value; this is useful for errorbars. - EF
+
 2009年03月28日 Make images handle nan in their array argument.
 A helper, cbook.safe_masked_invalid() was added. - EF
 
Modified: trunk/matplotlib/doc/api/api_changes.rst
===================================================================
--- trunk/matplotlib/doc/api/api_changes.rst	2009年04月01日 20:44:58 UTC (rev 7022)
+++ trunk/matplotlib/doc/api/api_changes.rst	2009年04月04日 22:52:53 UTC (rev 7023)
@@ -19,6 +19,12 @@
 
 Changes for 0.98.x
 ==================
+* Added new keyword parameters *nonposx*, *nonposy* to
+ :class:`matplotlib.axes.Axes` methods that set log scale
+ parameters. The default is still to mask out non-positive
+ values, but the kwargs accept 'clip', which causes non-positive
+ values to be replaced with a very small positive value.
+
 * Added new :func:`matplotlib.pyplot.fignum_exists` and
 :func:`matplotlib.pyplot.get_fignums`; they merely expose
 information that had been hidden in :mod:`matplotlib._pylab_helpers`.
Modified: trunk/matplotlib/examples/pylab_examples/log_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/log_demo.py	2009年04月01日 20:44:58 UTC (rev 7022)
+++ trunk/matplotlib/examples/pylab_examples/log_demo.py	2009年04月04日 22:52:53 UTC (rev 7023)
@@ -6,21 +6,33 @@
 t = np.arange(0.01, 20.0, 0.01)
 
 # log y axis
-plt.subplot(311)
+plt.subplot(221)
 plt.semilogy(t, np.exp(-t/5.0))
-plt.ylabel('semilogy')
+plt.title('semilogy')
 plt.grid(True)
 
 # log x axis
-plt.subplot(312)
+plt.subplot(222)
 plt.semilogx(t, np.sin(2*np.pi*t))
-plt.ylabel('semilogx')
+plt.title('semilogx')
 plt.grid(True)
 
 # log x and y axis
-plt.subplot(313)
+plt.subplot(223)
 plt.loglog(t, 20*np.exp(-t/10.0), basex=4)
 plt.grid(True)
-plt.ylabel('loglog base 4 on x')
+plt.title('loglog base 4 on x')
 
+# with errorbars: clip non-positive values
+ax = plt.subplot(224)
+ax.set_xscale("log", nonposx='clip')
+ax.set_yscale("log", nonposy='clip')
+
+x = 10.0**np.linspace(0.0, 2.0, 20)
+y = x**2.0
+plt.errorbar(x, y, xerr=0.1*x, yerr=5.0+0.75*y)
+ax.set_ylim(ymin=0.1)
+ax.set_title('Errorbars go negative')
+
+
 plt.show()
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py	2009年04月01日 20:44:58 UTC (rev 7022)
+++ trunk/matplotlib/lib/matplotlib/axes.py	2009年04月04日 22:52:53 UTC (rev 7023)
@@ -3455,6 +3455,10 @@
 plot; see :meth:`matplotlib.axes.Axes.set_xscale` /
 :meth:`matplotlib.axes.Axes.set_yscale` for details
 
+ *nonposx*/*nonposy*: ['mask' | 'clip' ]
+ non-positive values in *x* or *y* can be masked as
+ invalid, or clipped to a very small positive number
+
 The remaining valid kwargs are
 :class:`~matplotlib.lines.Line2D` properties:
 
@@ -3469,9 +3473,11 @@
 
 dx = {'basex': kwargs.pop('basex', 10),
 'subsx': kwargs.pop('subsx', None),
+ 'nonposx': kwargs.pop('nonposx', 'mask'),
 }
 dy = {'basey': kwargs.pop('basey', 10),
 'subsy': kwargs.pop('subsy', None),
+ 'nonposy': kwargs.pop('nonposy', 'mask'),
 }
 
 self.set_xscale('log', **dx)
@@ -3508,6 +3514,10 @@
 plot; see :meth:`~matplotlib.axes.Axes.set_xscale` for
 details.
 
+ *nonposx*: ['mask' | 'clip' ]
+ non-positive values in *x* can be masked as
+ invalid, or clipped to a very small positive number
+
 The remaining valid kwargs are
 :class:`~matplotlib.lines.Line2D` properties:
 
@@ -3521,6 +3531,7 @@
 if not self._hold: self.cla()
 d = {'basex': kwargs.pop( 'basex', 10),
 'subsx': kwargs.pop( 'subsx', None),
+ 'nonposx': kwargs.pop('nonposx', 'mask'),
 }
 
 self.set_xscale('log', **d)
@@ -3554,6 +3565,10 @@
 plot; see :meth:`~matplotlib.axes.Axes.set_yscale` for
 details.
 
+ *nonposy*: ['mask' | 'clip' ]
+ non-positive values in *y* can be masked as
+ invalid, or clipped to a very small positive number
+
 The remaining valid kwargs are
 :class:`~matplotlib.lines.Line2D` properties:
 
@@ -3567,6 +3582,7 @@
 if not self._hold: self.cla()
 d = {'basey': kwargs.pop('basey', 10),
 'subsy': kwargs.pop('subsy', None),
+ 'nonposy': kwargs.pop('nonposy', 'mask'),
 }
 self.set_yscale('log', **d)
 b = self._hold
Modified: trunk/matplotlib/lib/matplotlib/scale.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/scale.py	2009年04月01日 20:44:58 UTC (rev 7022)
+++ trunk/matplotlib/lib/matplotlib/scale.py	2009年04月04日 22:52:53 UTC (rev 7023)
@@ -87,6 +87,10 @@
 return ma.MaskedArray(a, mask=mask)
 return a
 
+def _clip_non_positives(a):
+ a[a <= 0.0] = 1e-300
+ return a
+
 class LogScale(ScaleBase):
 """
 A standard logarithmic scale. Care is taken so non-positive
@@ -104,14 +108,24 @@
 
 name = 'log'
 
- class Log10Transform(Transform):
+ class LogTransformBase(Transform):
 input_dims = 1
 output_dims = 1
 is_separable = True
+
+ def __init__(self, nonpos):
+ Transform.__init__(self)
+ if nonpos == 'mask':
+ self._handle_nonpos = _mask_non_positives
+ else:
+ self._handle_nonpos = _clip_non_positives
+
+
+ class Log10Transform(LogTransformBase):
 base = 10.0
 
 def transform(self, a):
- a = _mask_non_positives(a * 10.0)
+ a = self._handle_nonpos(a * 10.0)
 if isinstance(a, MaskedArray):
 return ma.log10(a)
 return np.log10(a)
@@ -131,14 +145,11 @@
 def inverted(self):
 return LogScale.Log10Transform()
 
- class Log2Transform(Transform):
- input_dims = 1
- output_dims = 1
- is_separable = True
+ class Log2Transform(LogTransformBase):
 base = 2.0
 
 def transform(self, a):
- a = _mask_non_positives(a * 2.0)
+ a = self._handle_nonpos(a * 2.0)
 if isinstance(a, MaskedArray):
 return ma.log(a) / np.log(2)
 return np.log2(a)
@@ -158,14 +169,11 @@
 def inverted(self):
 return LogScale.Log2Transform()
 
- class NaturalLogTransform(Transform):
- input_dims = 1
- output_dims = 1
- is_separable = True
+ class NaturalLogTransform(LogTransformBase):
 base = np.e
 
 def transform(self, a):
- a = _mask_non_positives(a * np.e)
+ a = self._handle_nonpos(a * np.e)
 if isinstance(a, MaskedArray):
 return ma.log(a)
 return np.log(a)
@@ -190,12 +198,16 @@
 output_dims = 1
 is_separable = True
 
- def __init__(self, base):
+ def __init__(self, base, nonpos):
 Transform.__init__(self)
 self.base = base
+ if nonpos == 'mask':
+ self._handle_nonpos = _mask_non_positives
+ else:
+ self._handle_nonpos = _clip_non_positives
 
 def transform(self, a):
- a = _mask_non_positives(a * self.base)
+ a = self._handle_nonpos(a * self.base)
 if isinstance(a, MaskedArray):
 return ma.log(a) / np.log(self.base)
 return np.log(a) / np.log(self.base)
@@ -224,6 +236,10 @@
 *basex*/*basey*:
 The base of the logarithm
 
+ *nonposx*/*nonposy*: ['mask' | 'clip' ]
+ non-positive values in *x* or *y* can be masked as
+ invalid, or clipped to a very small positive number
+
 *subsx*/*subsy*:
 Where to place the subticks between each major tick.
 Should be a sequence of integers. For example, in a log10
@@ -235,18 +251,23 @@
 if axis.axis_name == 'x':
 base = kwargs.pop('basex', 10.0)
 subs = kwargs.pop('subsx', None)
+ nonpos = kwargs.pop('nonposx', 'mask')
 else:
 base = kwargs.pop('basey', 10.0)
 subs = kwargs.pop('subsy', None)
+ nonpos = kwargs.pop('nonposy', 'mask')
 
+ if nonpos not in ['mask', 'clip']:
+ raise ValueError("nonposx, nonposy kwarg must be 'mask' or 'clip'")
+
 if base == 10.0:
- self._transform = self.Log10Transform()
+ self._transform = self.Log10Transform(nonpos)
 elif base == 2.0:
- self._transform = self.Log2Transform()
+ self._transform = self.Log2Transform(nonpos)
 elif base == np.e:
- self._transform = self.NaturalLogTransform()
+ self._transform = self.NaturalLogTransform(nonpos)
 else:
- self._transform = self.LogTransform(base)
+ self._transform = self.LogTransform(base, nonpos)
 
 self.base = base
 self.subs = subs
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jd...@us...> - 2009年04月01日 20:45:03
Revision: 7022
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7022&view=rev
Author: jdh2358
Date: 2009年04月01日 20:44:58 +0000 (2009年4月01日)
Log Message:
-----------
added compound path demo
Added Paths:
-----------
 trunk/matplotlib/examples/api/compound_path.py
Removed Paths:
-------------
 trunk/matplotlib/examples/api/complex_path.py
Deleted: trunk/matplotlib/examples/api/complex_path.py
===================================================================
--- trunk/matplotlib/examples/api/complex_path.py	2009年04月01日 20:44:27 UTC (rev 7021)
+++ trunk/matplotlib/examples/api/complex_path.py	2009年04月01日 20:44:58 UTC (rev 7022)
@@ -1,35 +0,0 @@
-"""
-Make a compund path -- in this case two simple polygons, a rectangle
-and a triangle. Use CLOSEOPOLY and MOVETO for the different parts of
-the compound path
-"""
-import numpy as np
-from matplotlib.path import Path
-from matplotlib.patches import PathPatch
-import matplotlib.pyplot as plt
-
-
-vertices = []
-codes = []
-
-codes = [Path.MOVETO] + [Path.LINETO]*3 + [Path.CLOSEPOLY]
-vertices = [(1,1), (1,2), (2, 2), (2, 1), (0,0)]
-
-codes += [Path.MOVETO] + [Path.LINETO]*2 + [Path.CLOSEPOLY]
-vertices += [(4,4), (5,5), (5, 4), (0,0)]
-
-vertices = np.array(vertices, float)
-path = Path(vertices, codes)
-
-pathpatch = PathPatch(path, facecolor='red', edgecolor='green')
-
-fig = plt.figure()
-ax = fig.add_subplot(111)
-ax.add_patch(pathpatch)
-ax.set_title('A compound path')
-
-ax.dataLim.update_from_data_xy(vertices)
-ax.autoscale_view()
-
-
-plt.show()
Copied: trunk/matplotlib/examples/api/compound_path.py (from rev 7021, trunk/matplotlib/examples/api/complex_path.py)
===================================================================
--- trunk/matplotlib/examples/api/compound_path.py	 (rev 0)
+++ trunk/matplotlib/examples/api/compound_path.py	2009年04月01日 20:44:58 UTC (rev 7022)
@@ -0,0 +1,35 @@
+"""
+Make a compund path -- in this case two simple polygons, a rectangle
+and a triangle. Use CLOSEOPOLY and MOVETO for the different parts of
+the compound path
+"""
+import numpy as np
+from matplotlib.path import Path
+from matplotlib.patches import PathPatch
+import matplotlib.pyplot as plt
+
+
+vertices = []
+codes = []
+
+codes = [Path.MOVETO] + [Path.LINETO]*3 + [Path.CLOSEPOLY]
+vertices = [(1,1), (1,2), (2, 2), (2, 1), (0,0)]
+
+codes += [Path.MOVETO] + [Path.LINETO]*2 + [Path.CLOSEPOLY]
+vertices += [(4,4), (5,5), (5, 4), (0,0)]
+
+vertices = np.array(vertices, float)
+path = Path(vertices, codes)
+
+pathpatch = PathPatch(path, facecolor='red', edgecolor='green')
+
+fig = plt.figure()
+ax = fig.add_subplot(111)
+ax.add_patch(pathpatch)
+ax.set_title('A compound path')
+
+ax.dataLim.update_from_data_xy(vertices)
+ax.autoscale_view()
+
+
+plt.show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jd...@us...> - 2009年04月01日 20:44:34
Revision: 7021
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7021&view=rev
Author: jdh2358
Date: 2009年04月01日 20:44:27 +0000 (2009年4月01日)
Log Message:
-----------
added compound path demo
Added Paths:
-----------
 trunk/matplotlib/examples/api/complex_path.py
Added: trunk/matplotlib/examples/api/complex_path.py
===================================================================
--- trunk/matplotlib/examples/api/complex_path.py	 (rev 0)
+++ trunk/matplotlib/examples/api/complex_path.py	2009年04月01日 20:44:27 UTC (rev 7021)
@@ -0,0 +1,35 @@
+"""
+Make a compund path -- in this case two simple polygons, a rectangle
+and a triangle. Use CLOSEOPOLY and MOVETO for the different parts of
+the compound path
+"""
+import numpy as np
+from matplotlib.path import Path
+from matplotlib.patches import PathPatch
+import matplotlib.pyplot as plt
+
+
+vertices = []
+codes = []
+
+codes = [Path.MOVETO] + [Path.LINETO]*3 + [Path.CLOSEPOLY]
+vertices = [(1,1), (1,2), (2, 2), (2, 1), (0,0)]
+
+codes += [Path.MOVETO] + [Path.LINETO]*2 + [Path.CLOSEPOLY]
+vertices += [(4,4), (5,5), (5, 4), (0,0)]
+
+vertices = np.array(vertices, float)
+path = Path(vertices, codes)
+
+pathpatch = PathPatch(path, facecolor='red', edgecolor='green')
+
+fig = plt.figure()
+ax = fig.add_subplot(111)
+ax.add_patch(pathpatch)
+ax.set_title('A compound path')
+
+ax.dataLim.update_from_data_xy(vertices)
+ax.autoscale_view()
+
+
+plt.show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jr...@us...> - 2009年04月01日 17:28:21
Revision: 7020
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7020&view=rev
Author: jrevans
Date: 2009年04月01日 17:28:11 +0000 (2009年4月01日)
Log Message:
-----------
Updated 'fill' to handle unitized data. Added a unit-test for it.
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/axes.py
 trunk/matplotlib/test/mplTest/units/__init__.py
Added Paths:
-----------
 trunk/matplotlib/test/test_plots/TestFill.py
 trunk/matplotlib/test/test_plots/baseline/TestFill/
 trunk/matplotlib/test/test_plots/baseline/TestFill/fill_units.png
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py	2009年03月31日 17:59:53 UTC (rev 7019)
+++ trunk/matplotlib/lib/matplotlib/axes.py	2009年04月01日 17:28:11 UTC (rev 7020)
@@ -216,9 +216,10 @@
 if self.axes.xaxis is not None and self.axes.yaxis is not None:
 bx = self.axes.xaxis.update_units(x)
 by = self.axes.yaxis.update_units(y)
- # right now multicol is not supported if either x or y are
- # unit enabled but this can be fixed..
- if bx or by: return x, y, False
+ if bx:
+ x = self.axes.convert_xunits(x)
+ if by:
+ y = self.axes.convert_yunits(y)
 
 x = ma.asarray(x)
 y = ma.asarray(y)
@@ -310,8 +311,6 @@
 ret.append(seg)
 
 def makefill(x, y):
- x = self.axes.convert_xunits(x)
- y = self.axes.convert_yunits(y)
 facecolor = self._get_next_cycle_color()
 seg = mpatches.Polygon(np.hstack(
 (x[:,np.newaxis],y[:,np.newaxis])),
@@ -358,8 +357,6 @@
 
 def makefill(x, y):
 facecolor = color
- x = self.axes.convert_xunits(x)
- y = self.axes.convert_yunits(y)
 seg = mpatches.Polygon(np.hstack(
 (x[:,np.newaxis],y[:,np.newaxis])),
 facecolor = facecolor,
Modified: trunk/matplotlib/test/mplTest/units/__init__.py
===================================================================
--- trunk/matplotlib/test/mplTest/units/__init__.py	2009年03月31日 17:59:53 UTC (rev 7019)
+++ trunk/matplotlib/test/mplTest/units/__init__.py	2009年04月01日 17:28:11 UTC (rev 7020)
@@ -71,6 +71,7 @@
 
 # Angles
 deg = UnitDbl( 1.0, "deg" )
+rad = UnitDbl( 1.0, "rad" )
 
 # Time
 sec = UnitDbl( 1.0, "sec" )
Added: trunk/matplotlib/test/test_plots/TestFill.py
===================================================================
--- trunk/matplotlib/test/test_plots/TestFill.py	 (rev 0)
+++ trunk/matplotlib/test/test_plots/TestFill.py	2009年04月01日 17:28:11 UTC (rev 7020)
@@ -0,0 +1,87 @@
+#=======================================================================
+"""The Fill unit-test class implementation."""
+#=======================================================================
+
+from mplTest import *
+
+#=======================================================================
+# Add import modules below.
+import matplotlib
+matplotlib.use( "Agg", warn = False )
+
+import pylab
+import numpy as npy
+from datetime import datetime
+#
+#=======================================================================
+
+#=======================================================================
+class TestFill( MplTestCase ):
+ """Test the various axes fill methods."""
+
+ # Uncomment any appropriate tags
+ tags = [
+ # 'gui', # requires the creation of a gui window
+ 'agg', # uses agg in the backend
+ 'agg-only', # uses only agg in the backend
+ # 'wx', # uses wx in the backend
+ # 'qt', # uses qt in the backend
+ # 'ps', # uses the postscript backend
+ # 'units', # uses units in the test
+ 'PIL', # uses PIL for image comparison
+ ]
+
+ #--------------------------------------------------------------------
+ def setUp( self ):
+ """Setup any data needed for the unit test."""
+ units.register()
+
+ #--------------------------------------------------------------------
+ def tearDown( self ):
+ """Clean-up any generated files here."""
+ pass
+
+ #--------------------------------------------------------------------
+ def test_fill_units( self ):
+ """Test the fill method with unitized-data."""
+
+ fname = self.outFile( "fill_units.png" )
+
+ # generate some data
+ t = units.Epoch( "ET", dt=datetime(2009, 4, 27) )
+ value = 10.0 * units.deg
+ day = units.Duration( "ET", 24.0 * 60.0 * 60.0 )
+
+ fig = pylab.figure()
+
+ # Top-Left
+ ax1 = fig.add_subplot( 221 )
+ ax1.plot( [t], [value], yunits='deg', color='red' )
+ ax1.fill( [733525.0, 733525.0, 733526.0, 733526.0],
+ [0.0, 0.0, 90.0, 0.0], 'b' )
+
+ # Top-Right
+ ax2 = fig.add_subplot( 222 )
+ ax2.plot( [t], [value], yunits='deg', color='red' )
+ ax2.fill( [t, t, t+day, t+day],
+ [0.0, 0.0, 90.0, 0.0], 'b' )
+
+ # Bottom-Left
+ ax3 = fig.add_subplot( 223 )
+ ax3.plot( [t], [value], yunits='deg', color='red' )
+ ax1.fill( [733525.0, 733525.0, 733526.0, 733526.0],
+ [0*units.deg, 0*units.deg, 90*units.deg, 0*units.deg], 'b' )
+
+ # Bottom-Right
+ ax4 = fig.add_subplot( 224 )
+ ax4.plot( [t], [value], yunits='deg', color='red' )
+ ax4.fill( [t, t, t+day, t+day],
+ [0*units.deg, 0*units.deg, 90*units.deg, 0*units.deg],
+ facecolor="blue" )
+
+ fig.autofmt_xdate()
+ fig.savefig( fname )
+ self.checkImage( fname )
+
+ #--------------------------------------------------------------------
+
Added: trunk/matplotlib/test/test_plots/baseline/TestFill/fill_units.png
===================================================================
(Binary files differ)
Property changes on: trunk/matplotlib/test/test_plots/baseline/TestFill/fill_units.png
___________________________________________________________________
Added: svn:mime-type
 + application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

Showing results of 56

<< < 1 2 3 (Page 3 of 3)
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /