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






Showing 4 results of 4

From: <mme...@us...> - 2008年08月28日 13:50:42
Revision: 6055
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6055&view=rev
Author: mmetz_bn
Date: 2008年08月28日 13:50:39 +0000 (2008年8月28日)
Log Message:
-----------
support for multi-hist with different length
Modified Paths:
--------------
 trunk/matplotlib/CHANGELOG
 trunk/matplotlib/examples/pylab_examples/histogram_demo_extended.py
 trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG	2008年08月28日 13:12:46 UTC (rev 6054)
+++ trunk/matplotlib/CHANGELOG	2008年08月28日 13:50:39 UTC (rev 6055)
@@ -1,3 +1,6 @@
+2008年08月28日 Added support for multiple histograms with data of
+ different length - MM
+
 2008年08月28日 Fix step plots with log scale - MGD
 
 2008年08月28日 Fix masked arrays with markers in non-Agg backends - MGD
Modified: trunk/matplotlib/examples/pylab_examples/histogram_demo_extended.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/histogram_demo_extended.py	2008年08月28日 13:12:46 UTC (rev 6054)
+++ trunk/matplotlib/examples/pylab_examples/histogram_demo_extended.py	2008年08月28日 13:50:39 UTC (rev 6055)
@@ -78,5 +78,16 @@
 
 n, bins, patches = P.hist(x, 10, normed=1, histtype='barstacked')
 
+#
+# finally: make a multiple-histogram of data-sets with different length
+#
+x0 = mu + sigma*P.randn(10000)
+x1 = mu + sigma*P.randn(7000)
+x2 = mu + sigma*P.randn(3000)
 
+P.figure()
+
+n, bins, patches = P.hist( [x0,x1,x2], 10, histtype='bar')
+
+
 P.show()
\ No newline at end of file
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py	2008年08月28日 13:12:46 UTC (rev 6054)
+++ trunk/matplotlib/lib/matplotlib/axes.py	2008年08月28日 13:50:39 UTC (rev 6055)
@@ -6157,7 +6157,7 @@
 - 'step' generates a lineplot that is by default
 unfilled
 
- - 'stepfilled' generates a lineplot that this by default
+ - 'stepfilled' generates a lineplot that is by default
 filled.
 
 *align*: ['left' | 'mid' | 'right' ]
@@ -6209,26 +6209,27 @@
 raise DeprecationWarning(
 'hist now uses the rwidth to give relative width and not absolute width')
 
- # todo: make hist() work with list of arrays with different lengths
- x = np.asarray(x).copy()
- if len(x.shape)==2 and min(x.shape)==1:
- x.shape = max(x.shape),
+ try:
+ x = np.transpose(np.asarray(x).copy())
+ if len(x.shape)==1:
+ x.shape = (1,x.shape[0])
+ elif len(x.shape)==2 and x.shape[1]<x.shape[0]:
+ warnings.warn('2D hist should be nsamples x nvariables; this looks transposed')
+ except ValueError:
+ # multiple hist with data of different length 
+ if iterable(x[0]) and not is_string_like(x[0]):
+ tx = []
+ for i in xrange(len(x)):
+ tx.append( np.asarray(x[i]).copy() )
+ x = tx
 
- if len(x.shape)==2 and x.shape[0]<x.shape[1]:
- warnings.warn('2D hist should be nsamples x nvariables; this looks transposed')
-
- if len(x.shape)==2:
- n = []
- for i in xrange(x.shape[1]):
- # this will automatically overwrite bins,
- # so that each histogram uses the same bins
- m, bins = np.histogram(x[:,i], bins, range=range,
- normed=bool(normed), new=True)
- n.append(m)
- else:
- n, bins = np.histogram(x, bins, range=range,
+ n = []
+ for i in xrange(len(x)):
+ # this will automatically overwrite bins,
+ # so that each histogram uses the same bins
+ m, bins = np.histogram(x[i], bins, range=range,
 normed=bool(normed), new=True)
- n = [n,]
+ n.append(m)
 
 if cumulative:
 slc = slice(None)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <md...@us...> - 2008年08月28日 13:12:50
Revision: 6054
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6054&view=rev
Author: mdboom
Date: 2008年08月28日 13:12:46 +0000 (2008年8月28日)
Log Message:
-----------
Fix step plots with log scale
Modified Paths:
--------------
 trunk/matplotlib/CHANGELOG
 trunk/matplotlib/lib/matplotlib/lines.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG	2008年08月28日 12:45:37 UTC (rev 6053)
+++ trunk/matplotlib/CHANGELOG	2008年08月28日 13:12:46 UTC (rev 6054)
@@ -1,3 +1,5 @@
+2008年08月28日 Fix step plots with log scale - MGD
+
 2008年08月28日 Fix masked arrays with markers in non-Agg backends - MGD
 
 2008年08月28日 Fix clip_on kwarg so it actually works correctly - MGD
Modified: trunk/matplotlib/lib/matplotlib/lines.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/lines.py	2008年08月28日 12:45:37 UTC (rev 6053)
+++ trunk/matplotlib/lib/matplotlib/lines.py	2008年08月28日 13:12:46 UTC (rev 6054)
@@ -14,7 +14,7 @@
 from cbook import iterable, is_string_like, is_numlike, ls_mapper, dedent
 from colors import colorConverter
 from path import Path
-from transforms import Affine2D, Bbox, TransformedPath
+from transforms import Affine2D, Bbox, TransformedPath, IdentityTransform
 
 from matplotlib import rcParams
 # special-purpose marker identifiers:
@@ -675,7 +675,8 @@
 steps[0::2, 1], steps[1:-1:2, 1] = vertices[:, 1], vertices[1:, 1]
 
 path = Path(steps)
- self._draw_solid(renderer, gc, path, trans)
+ path = path.transformed(self.get_transform())
+ self._draw_solid(renderer, gc, path, IdentityTransform())
 
 
 def _draw_steps_post(self, renderer, gc, path, trans):
@@ -686,7 +687,8 @@
 steps[0::2, 1], steps[1::2, 1] = vertices[:, 1], vertices[:-1, 1]
 
 path = Path(steps)
- self._draw_solid(renderer, gc, path, trans)
+ path = path.transformed(self.get_transform())
+ self._draw_solid(renderer, gc, path, IdentityTransform())
 
 
 def _draw_steps_mid(self, renderer, gc, path, trans):
@@ -700,7 +702,8 @@
 steps[0::2, 1], steps[1::2, 1] = vertices[:, 1], vertices[:, 1]
 
 path = Path(steps)
- self._draw_solid(renderer, gc, path, trans)
+ path = path.transformed(self.get_transform())
+ self._draw_solid(renderer, gc, path, IdentityTransform())
 
 
 def _draw_dashed(self, renderer, gc, path, trans):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <md...@us...> - 2008年08月28日 12:45:40
Revision: 6053
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6053&view=rev
Author: mdboom
Date: 2008年08月28日 12:45:37 +0000 (2008年8月28日)
Log Message:
-----------
Fix clip_on kwarg to work correctly.
Modified Paths:
--------------
 trunk/matplotlib/CHANGELOG
 trunk/matplotlib/lib/matplotlib/backend_bases.py
 trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
 trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
 trunk/matplotlib/lib/matplotlib/backends/backend_svg.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG	2008年08月28日 12:42:52 UTC (rev 6052)
+++ trunk/matplotlib/CHANGELOG	2008年08月28日 12:45:37 UTC (rev 6053)
@@ -1,3 +1,5 @@
+2008年08月28日 Fix masked arrays with markers in non-Agg backends - MGD
+
 2008年08月28日 Fix clip_on kwarg so it actually works correctly - MGD
 
 2008年08月25日 Fix locale problems in SVG backend - MGD
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py	2008年08月28日 12:42:52 UTC (rev 6052)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py	2008年08月28日 12:45:37 UTC (rev 6053)
@@ -97,10 +97,12 @@
 once and reuse it multiple times.
 """
 tpath = trans.transform_path(path)
- for x, y in tpath.vertices:
- self.draw_path(gc, marker_path,
- marker_trans + transforms.Affine2D().translate(x, y),
- rgbFace)
+ for vertices, codes in tpath.iter_segments():
+ if len(vertices):
+ x,y = vertices[-2:]
+ self.draw_path(gc, marker_path,
+ marker_trans + transforms.Affine2D().translate(x, y),
+ rgbFace)
 
 def draw_path_collection(self, master_transform, cliprect, clippath,
 clippath_trans, paths, all_transforms, offsets,
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py	2008年08月28日 12:42:52 UTC (rev 6052)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py	2008年08月28日 12:45:37 UTC (rev 6053)
@@ -1247,11 +1247,13 @@
 
 output(Op.gsave)
 lastx, lasty = 0, 0
- for x, y in tpath.vertices:
- dx, dy = x - lastx, y - lasty
- output(1, 0, 0, 1, dx, dy, Op.concat_matrix,
- marker, Op.use_xobject)
- lastx, lasty = x, y
+ for vertices, code in tpath.iter_segments():
+ if len(vertices):
+ x, y = vertices[-2:]
+ dx, dy = x - lastx, y - lasty
+ output(1, 0, 0, 1, dx, dy, Op.concat_matrix,
+ marker, Op.use_xobject)
+ lastx, lasty = x, y
 output(Op.grestore)
 
 def _setup_textpos(self, x, y, angle, oldx=0, oldy=0, oldangle=0):
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_ps.py	2008年08月28日 12:42:52 UTC (rev 6052)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_ps.py	2008年08月28日 12:45:37 UTC (rev 6053)
@@ -510,8 +510,10 @@
 ps_cmd.extend(['stroke', 'grestore', '} bind def'])
 
 tpath = trans.transform_path(path)
- for x, y in tpath.vertices:
- ps_cmd.append("%g %g o" % (x, y))
+ for vertices, code in tpath.iter_segments():
+ if len(vertices):
+ x, y = vertices[-2:]
+ ps_cmd.append("%g %g o" % (x, y))
 
 ps = '\n'.join(ps_cmd)
 self._draw_ps(ps, gc, rgbFace, fill=False, stroke=False)
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_svg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_svg.py	2008年08月28日 12:42:52 UTC (rev 6052)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_svg.py	2008年08月28日 12:45:37 UTC (rev 6053)
@@ -209,10 +209,12 @@
 write('<g %s>' % clippath)
 trans_and_flip = self._make_flip_transform(trans)
 tpath = trans_and_flip.transform_path(path)
- for x, y in tpath.vertices:
- details = 'xlink:href="#%s" x="%f" y="%f"' % (name, x, y)
- style = self._get_style(gc, rgbFace)
- self._svgwriter.write ('<use style="%s" %s/>\n' % (style, details))
+ for vertices, code in tpath.iter_segments():
+ if len(vertices):
+ x, y = vertices[-2:]
+ details = 'xlink:href="#%s" x="%f" y="%f"' % (name, x, y)
+ style = self._get_style(gc, rgbFace)
+ self._svgwriter.write ('<use style="%s" %s/>\n' % (style, details))
 write('</g>')
 
 def draw_path_collection(self, master_transform, cliprect, clippath,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <md...@us...> - 2008年08月28日 12:42:55
Revision: 6052
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6052&view=rev
Author: mdboom
Date: 2008年08月28日 12:42:52 +0000 (2008年8月28日)
Log Message:
-----------
Fix clip_on kwarg to work correctly.
Modified Paths:
--------------
 trunk/matplotlib/CHANGELOG
 trunk/matplotlib/lib/matplotlib/artist.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG	2008年08月26日 13:24:00 UTC (rev 6051)
+++ trunk/matplotlib/CHANGELOG	2008年08月28日 12:42:52 UTC (rev 6052)
@@ -1,3 +1,5 @@
+2008年08月28日 Fix clip_on kwarg so it actually works correctly - MGD
+
 2008年08月25日 Fix locale problems in SVG backend - MGD
 
 2008年08月22日 fix quiver so masked values are not plotted - JSW
Modified: trunk/matplotlib/lib/matplotlib/artist.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/artist.py	2008年08月26日 13:24:00 UTC (rev 6051)
+++ trunk/matplotlib/lib/matplotlib/artist.py	2008年08月28日 12:42:52 UTC (rev 6052)
@@ -39,7 +39,7 @@
 self._alpha = 1.0
 self.clipbox = None
 self._clippath = None
- self._clipon = False
+ self._clipon = True
 self._lod = False
 self._label = ''
 self._picker = None
@@ -292,7 +292,6 @@
 ACCEPTS: a :class:`matplotlib.transform.Bbox` instance
 """
 self.clipbox = clipbox
- self._clipon = clipbox is not None or self._clippath is not None
 self.pchanged()
 
 def set_clip_path(self, path, transform=None):
@@ -341,7 +340,6 @@
 print type(path), type(transform)
 raise TypeError("Invalid arguments to set_clip_path")
 
- self._clipon = self.clipbox is not None or self._clippath is not None
 self.pchanged()
 
 def get_alpha(self):
@@ -361,7 +359,7 @@
 
 def get_clip_on(self):
 'Return whether artist uses clipping'
- return self._clipon and (self.clipbox is not None or self._clippath is not None)
+ return self._clipon
 
 def get_clip_box(self):
 'Return artist clipbox'
@@ -388,16 +386,17 @@
 ACCEPTS: [True | False]
 """
 self._clipon = b
- if not b:
- self.clipbox = None
- self._clippath = None
 self.pchanged()
 
 def _set_gc_clip(self, gc):
 'set the clip properly for the gc'
- if self.clipbox is not None:
- gc.set_clip_rectangle(self.clipbox)
- gc.set_clip_path(self._clippath)
+ if self._clipon:
+ if self.clipbox is not None:
+ gc.set_clip_rectangle(self.clipbox)
+ gc.set_clip_path(self._clippath)
+ else:
+ gc.set_clip_rectangle(None)
+ gc.set_clip_path(None)
 
 def draw(self, renderer, *args, **kwargs):
 'Derived classes drawing method'
@@ -511,7 +510,7 @@
 def findobj(self, match=None):
 """
 pyplot signature:
- findobj(o=gcf(), match=None) 
+ findobj(o=gcf(), match=None)
 
 recursively find all :class:matplotlib.artist.Artist instances
 contained in self
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

Showing 4 results of 4

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 によって変換されたページ (->オリジナル) /