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

Showing 4 results of 4

From: <ef...@us...> - 2010年04月22日 08:27:26
Revision: 8267
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8267&view=rev
Author: efiring
Date: 2010年04月22日 08:27:18 +0000 (2010年4月22日)
Log Message:
-----------
Axes.hist: remove unnecessary copying of input array.
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py	2010年04月22日 07:49:13 UTC (rev 8266)
+++ trunk/matplotlib/lib/matplotlib/axes.py	2010年04月22日 08:27:18 UTC (rev 8267)
@@ -7289,17 +7289,16 @@
 
 if isinstance(x, np.ndarray):
 # TODO: support masked arrays;
- # Why is the copy needed?
- x = np.array(x, copy=True, subok=False)
+ x = np.asarray(x)
 if x.ndim == 2:
- x = x.T
+ x = x.T # 2-D input with columns as datasets; switch to rows
 elif x.ndim == 1:
- x.shape = (1, x.shape[0])
+ x = x.reshape(1, x.shape[0]) # new view, single row
 else:
 raise ValueError("x must be 1D or 2D")
 if x.shape[1] < x.shape[0]:
- warnings.warn('2D hist input should be nsamples x nvariables; '
- 'this looks transposed')
+ warnings.warn('2D hist input should be nsamples x nvariables;\n '
+ 'this looks transposed (shape is %d x %d)' % x.shape[::-1])
 else:
 # multiple hist with data of different length
 x = [np.array(xi) for xi in x]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <ef...@us...> - 2010年04月22日 07:49:20
Revision: 8266
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8266&view=rev
Author: efiring
Date: 2010年04月22日 07:49:13 +0000 (2010年4月22日)
Log Message:
-----------
Axes.autoscale_view: ensure finite ranges; rearrange code for readability
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py	2010年04月22日 03:34:10 UTC (rev 8265)
+++ trunk/matplotlib/lib/matplotlib/axes.py	2010年04月22日 07:49:13 UTC (rev 8266)
@@ -1710,45 +1710,41 @@
 setting *scaley* to *False*. The autoscaling preserves any
 axis direction reversal that has already been done.
 """
+ if tight is not None:
+ self._tight = bool(tight)
 # if image data only just use the datalim
+ _tight = self._tight or (len(self.images)>0 and
+ len(self.lines)==0 and
+ len(self.patches)==0)
+
 if scalex and self._autoscaleXon:
 xshared = self._shared_x_axes.get_siblings(self)
 dl = [ax.dataLim for ax in xshared]
 bb = mtransforms.BboxBase.union(dl)
 x0, x1 = bb.intervalx
+ x0, x1 = mtransforms.nonsingular(x0, x1, increasing=False)
 if self._xmargin > 0:
 delta = (x1 - x0) * self._xmargin
 x0 -= delta
 x1 += delta
+ if not _tight:
+ x0, x1 = self.xaxis.get_major_locator().view_limits(x0, x1)
+ self.set_xbound(x0, x1)
 
 if scaley and self._autoscaleYon:
 yshared = self._shared_y_axes.get_siblings(self)
 dl = [ax.dataLim for ax in yshared]
 bb = mtransforms.BboxBase.union(dl)
 y0, y1 = bb.intervaly
+ y0, y1 = mtransforms.nonsingular(y0, y1, increasing=False)
 if self._ymargin > 0:
 delta = (y1 - y0) * self._ymargin
 y0 -= delta
 y1 += delta
+ if not _tight:
+ y0, y1 = self.yaxis.get_major_locator().view_limits(y0, y1)
+ self.set_ybound(y0, y1)
 
- if tight is not None:
- self._tight = bool(tight)
- if (self._tight or (len(self.images)>0 and
- len(self.lines)==0 and
- len(self.patches)==0)):
- if scalex and self._autoscaleXon:
- self.set_xbound(x0, x1)
- if scaley and self._autoscaleYon:
- self.set_ybound(y0, y1)
- return
-
- if scalex and self._autoscaleXon:
- XL = self.xaxis.get_major_locator().view_limits(x0, x1)
- self.set_xbound(XL)
- if scaley and self._autoscaleYon:
- YL = self.yaxis.get_major_locator().view_limits(y0, y1)
- self.set_ybound(YL)
-
 #### Drawing
 
 @allow_rasterization
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8265
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8265&view=rev
Author: efiring
Date: 2010年04月22日 03:34:10 +0000 (2010年4月22日)
Log Message:
-----------
examples/cursor_demo: update to use axhline, axvline
Modified Paths:
--------------
 trunk/matplotlib/examples/pylab_examples/cursor_demo.py
Modified: trunk/matplotlib/examples/pylab_examples/cursor_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/cursor_demo.py	2010年04月22日 03:22:55 UTC (rev 8264)
+++ trunk/matplotlib/examples/pylab_examples/cursor_demo.py	2010年04月22日 03:34:10 UTC (rev 8265)
@@ -15,22 +15,19 @@
 class Cursor:
 def __init__(self, ax):
 self.ax = ax
- self.lx, = ax.plot( (0,0), (0,0), 'k-' ) # the horiz line
- self.ly, = ax.plot( (0,0), (0,0), 'k-' ) # the vert line
+ self.lx = ax.axhline(color='k') # the horiz line
+ self.ly = ax.axvline(color='k') # the vert line
 
 # text location in axes coords
 self.txt = ax.text( 0.7, 0.9, '', transform=ax.transAxes)
 
 def mouse_move(self, event):
 if not event.inaxes: return
- ax = event.inaxes
- minx, maxx = ax.get_xlim()
- miny, maxy = ax.get_ylim()
 
 x, y = event.xdata, event.ydata
 # update the line positions
- self.lx.set_data( (minx, maxx), (y, y) )
- self.ly.set_data( (x, x), (miny, maxy) )
+ self.lx.set_ydata(y )
+ self.ly.set_xdata(x )
 
 self.txt.set_text( 'x=%1.2f, y=%1.2f'%(x,y) )
 draw()
@@ -43,8 +40,8 @@
 """
 def __init__(self, ax, x, y):
 self.ax = ax
- self.lx, = ax.plot( (0,0), (0,0), 'k-' ) # the horiz line
- self.ly, = ax.plot( (0,0), (0,0), 'k-' ) # the vert line
+ self.lx = ax.axhline(color='k') # the horiz line
+ self.ly = ax.axvline(color='k') # the vert line
 self.x = x
 self.y = y
 # text location in axes coords
@@ -53,9 +50,6 @@
 def mouse_move(self, event):
 
 if not event.inaxes: return
- ax = event.inaxes
- minx, maxx = ax.get_xlim()
- miny, maxy = ax.get_ylim()
 
 x, y = event.xdata, event.ydata
 
@@ -63,8 +57,8 @@
 x = self.x[indx]
 y = self.y[indx]
 # update the line positions
- self.lx.set_data( (minx, maxx), (y, y) )
- self.ly.set_data( (x, x), (miny, maxy) )
+ self.lx.set_ydata(y )
+ self.ly.set_xdata(x )
 
 self.txt.set_text( 'x=%1.2f, y=%1.2f'%(x,y) )
 print 'x=%1.2f, y=%1.2f'%(x,y)
@@ -81,3 +75,4 @@
 ax.plot(t, s, 'o')
 axis([0,1,-1,1])
 show()
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <ef...@us...> - 2010年04月22日 03:23:01
Revision: 8264
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8264&view=rev
Author: efiring
Date: 2010年04月22日 03:22:55 +0000 (2010年4月22日)
Log Message:
-----------
Axes: save "tight" state; margin() default is now tight=True
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py	2010年04月21日 21:49:53 UTC (rev 8263)
+++ trunk/matplotlib/lib/matplotlib/axes.py	2010年04月22日 03:22:55 UTC (rev 8264)
@@ -838,6 +838,7 @@
 self._autoscaleYon = True
 self._xmargin = 0
 self._ymargin = 0
+ self._tight = True
 self._update_transScale() # needed?
 
 self._get_lines = _process_plot_var_args(self)
@@ -1231,7 +1232,7 @@
 elif s in ('equal', 'tight', 'scaled', 'normal', 'auto', 'image'):
 self.set_autoscale_on(True)
 self.set_aspect('auto')
- self.autoscale_view()
+ self.autoscale_view(tight=False)
 # self.apply_aspect()
 if s=='equal':
 self.set_aspect('equal', adjustable='datalim')
@@ -1646,17 +1647,22 @@
 
 ::
 
- margins(margin, tight=True)
+ margins(margin)
 
- margins(xmargin, ymargin, tight=True)
+ margins(xmargin, ymargin)
 
- margins(x=xmargin, y=ymargin, tight=True)
+ margins(x=xmargin, y=ymargin)
 
+ margins(..., tight=False)
+
 All three forms above set the xmargin and ymargin parameters.
 All keyword parameters are optional. A single argument
 specifies both xmargin and ymargin. The *tight* parameter
 is passed to :meth:`autoscale_view`, which is executed after
- a margin is changed.
+ a margin is changed; the default here is *True*, on the
+ assumption that when margins are specified, no additional
+ padding to match tick marks is usually desired. Setting
+ *tight* to *None* will preserve the previous setting.
 
 Specifying any margin changes only the autoscaling; for example,
 if *xmargin* is not zero, then *xmargin* times the X data
@@ -1667,7 +1673,7 @@
 if not args and not kw:
 return self._ymargin, self._ymargin
 
- tight = kw.pop('tight', False)
+ tight = kw.pop('tight', True)
 mx = kw.pop('x', None)
 my = kw.pop('y', None)
 if len(args) == 1:
@@ -1697,7 +1703,7 @@
 return self._rasterization_zorder
 
 
- def autoscale_view(self, tight=False, scalex=True, scaley=True):
+ def autoscale_view(self, tight=None, scalex=True, scaley=True):
 """
 autoscale the view limits using the data limits. You can
 selectively autoscale only a single axis, eg, the xaxis by
@@ -1725,7 +1731,9 @@
 y0 -= delta
 y1 += delta
 
- if (tight or (len(self.images)>0 and
+ if tight is not None:
+ self._tight = bool(tight)
+ if (self._tight or (len(self.images)>0 and
 len(self.lines)==0 and
 len(self.patches)==0)):
 if scalex and self._autoscaleXon:
@@ -2027,7 +2035,7 @@
 raise AttributeError(
 "This method only works with the ScalarFormatter.")
 
- def locator_params(self, axis='both', tight=False, **kwargs):
+ def locator_params(self, axis='both', tight=None, **kwargs):
 """
 Convenience method for controlling tick locators.
 
@@ -2038,7 +2046,8 @@
 default is 'both'.
 
 *tight*
- [True | False] Parameter passed to :meth:`autoscale_view`.
+ [True | False | None] Parameter passed to :meth:`autoscale_view`.
+ Default is None, for no change.
 
 Remaining keyword arguments are passed to directly to the
 :meth:`~matplotlib.ticker.MaxNLocator.set_params` method.
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 によって変換されたページ (->オリジナル) /