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



Showing 6 results of 6

From: <ef...@us...> - 2010年06月21日 21:41:25
Revision: 8453
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8453&view=rev
Author: efiring
Date: 2010年06月21日 21:41:19 +0000 (2010年6月21日)
Log Message:
-----------
tick_params: fixed errors in handling top, bottom, etc. kwargs.
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py	2010年06月21日 20:53:22 UTC (rev 8452)
+++ trunk/matplotlib/lib/matplotlib/axes.py	2010年06月21日 21:41:19 UTC (rev 8453)
@@ -2168,13 +2168,17 @@
 """
 if axis in ['x', 'both']:
 xkw = dict(kwargs)
- xkw.pop('top', None)
- xkw.pop('bottom', None)
+ xkw.pop('left', None)
+ xkw.pop('right', None)
+ xkw.pop('labelleft', None)
+ xkw.pop('labelright', None)
 self.xaxis.set_tick_params(**xkw)
 if axis in ['y', 'both']:
 ykw = dict(kwargs)
- ykw.pop('left', None)
- ykw.pop('right', None)
+ ykw.pop('top', None)
+ ykw.pop('bottom', None)
+ ykw.pop('labeltop', None)
+ ykw.pop('labelbottom', None)
 self.yaxis.set_tick_params(**ykw)
 
 def set_axis_off(self):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <ef...@us...> - 2010年06月21日 20:53:29
Revision: 8452
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8452&view=rev
Author: efiring
Date: 2010年06月21日 20:53:22 +0000 (2010年6月21日)
Log Message:
-----------
Let pcolor antialiasing default be controlled by patch.antialiasing.
See ticket 3017725. In most cases antialiasing is better than, or
nearly as good as, non-antialiasing. A note about artifacts is now
in the docstring.
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py	2010年06月21日 20:37:27 UTC (rev 8451)
+++ trunk/matplotlib/lib/matplotlib/axes.py	2010年06月21日 20:53:22 UTC (rev 8452)
@@ -6740,16 +6740,16 @@
 *shading*: [ 'flat' | 'faceted' ]
 If 'faceted', a black grid is drawn around each rectangle; if
 'flat', edges are not drawn. Default is 'flat', contrary to
- Matlab(TM).
+ Matlab.
 
 This kwarg is deprecated; please use 'edgecolors' instead:
- * shading='flat' -- edgecolors='None'
+ * shading='flat' -- edgecolors='none'
 * shading='faceted -- edgecolors='k'
 
- *edgecolors*: [ None | 'None' | color | color sequence]
+ *edgecolors*: [ None | 'none' | color | color sequence]
 If *None*, the rc setting is used by default.
 
- If 'None', edges will not be visible.
+ If 'none', edges will not be visible.
 
 An mpl color or sequence of colors will set the edge color
 
@@ -6805,6 +6805,16 @@
 :class:`~matplotlib.collection.PolyCollection` properties:
 
 %(PolyCollection)s
+
+ Note: the default *antialiaseds* is taken from
+ rcParams['patch.antialiased'], which defaults to *True*.
+ In some cases, particularly if *alpha* is 1,
+ you may be able to reduce rendering artifacts (light or
+ dark patch boundaries) by setting it to *False*. An
+ alternative it to set *edgecolors* to 'face'. Unfortunately,
+ there seems to be no single combination of parameters that
+ eliminates artifacts under all conditions.
+
 """
 
 if not self._hold: self.cla()
@@ -6850,19 +6860,22 @@
 axis=1)
 verts = xy.reshape((npoly, 5, 2))
 
- #verts = zip(zip(X1,Y1),zip(X2,Y2),zip(X3,Y3),zip(X4,Y4))
-
 C = compress(ravelmask, ma.filled(C[0:Ny-1,0:Nx-1]).ravel())
 
-
 if shading == 'faceted':
- edgecolors = (0,0,0,1),
- linewidths = (0.25,)
+ edgecolors = 'k',
 else:
- edgecolors = 'face'
- linewidths = (1.0,)
+ edgecolors = 'none'
+ linewidths = (0.25,)
+ # Not sure if we want to have the following, or just trap
+ # invalid kwargs and raise an exception.
+ if 'edgecolor' in kwargs:
+ kwargs['edgecolors'] = kwargs.pop('edgecolor')
+ if 'linewidth' in kwargs:
+ kwargs['linewidths'] = kwargs.pop('linewidth')
+ if 'antialiased' in kwargs:
+ kwargs['antialiaseds'] = kwargs.pop('antialiased')
 kwargs.setdefault('edgecolors', edgecolors)
- kwargs.setdefault('antialiaseds', (0,))
 kwargs.setdefault('linewidths', linewidths)
 
 collection = mcoll.PolyCollection(verts, **kwargs)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8451
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8451&view=rev
Author: jswhit
Date: 2010年06月21日 20:37:27 +0000 (2010年6月21日)
Log Message:
-----------
add antialiased=True to pcolor call (SF bugs item #3019150)
Modified Paths:
--------------
 trunk/toolkits/basemap/examples/ccsm_popgrid.py
Modified: trunk/toolkits/basemap/examples/ccsm_popgrid.py
===================================================================
--- trunk/toolkits/basemap/examples/ccsm_popgrid.py	2010年06月21日 14:33:58 UTC (rev 8450)
+++ trunk/toolkits/basemap/examples/ccsm_popgrid.py	2010年06月21日 20:37:27 UTC (rev 8451)
@@ -55,8 +55,9 @@
 map.fillcontinents(color='white')
 
 x, y = map(tlon,tlat)
-im = map.pcolor(x,y,ma.masked_array(np.zeros(temp.shape,'f'), temp.mask),\
- shading='faceted',cmap=plt.cm.cool,vmin=0,vmax=0)
+im = map.pcolor(x,y,ma.masked_array(np.zeros(temp.shape,'f'), temp.mask),
+ shading='faceted', antialiased=True, cmap=plt.cm.cool, 
+ vmin=0, vmax=0)
 # disclaimer: these are not really the grid cells because of the
 # way pcolor interprets the x and y args.
 plt.title('(A) CCSM POP Grid Cells')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <md...@us...> - 2010年06月21日 14:34:04
Revision: 8450
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8450&view=rev
Author: mdboom
Date: 2010年06月21日 14:33:58 +0000 (2010年6月21日)
Log Message:
-----------
[3018374] Link to examples is hardcoded
Modified Paths:
--------------
 trunk/matplotlib/doc/_templates/layout.html
Modified: trunk/matplotlib/doc/_templates/layout.html
===================================================================
--- trunk/matplotlib/doc/_templates/layout.html	2010年06月21日 13:19:11 UTC (rev 8449)
+++ trunk/matplotlib/doc/_templates/layout.html	2010年06月21日 14:33:58 UTC (rev 8450)
@@ -4,7 +4,7 @@
 {% block rootrellink %}
 <li><a href="{{ pathto('index') }}">home</a>|&nbsp;</li>
 <li><a href="{{ pathto('search') }}">search</a>|&nbsp;</li>
- <li><a href="http://matplotlib.sf.net/examples/index.html">examples</a>|&nbsp;</li>
+ <li><a href="{{ pathto('examples/index') }}">examples</a>|&nbsp;</li>
 <li><a href="{{ pathto('gallery') }}">gallery</a>|&nbsp;</li>
 <li><a href="{{ pathto('contents') }}">docs</a> &raquo;</li>
 {% endblock %}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <md...@us...> - 2010年06月21日 13:19:18
Revision: 8449
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8449&view=rev
Author: mdboom
Date: 2010年06月21日 13:19:11 +0000 (2010年6月21日)
Log Message:
-----------
[3015217] Don't add piwik code to html docs by default
This prevents the web browser from making remote http requests when browsing the docs locally.
Modified Paths:
--------------
 trunk/matplotlib/doc/_templates/layout.html
Modified: trunk/matplotlib/doc/_templates/layout.html
===================================================================
--- trunk/matplotlib/doc/_templates/layout.html	2010年06月21日 08:51:30 UTC (rev 8448)
+++ trunk/matplotlib/doc/_templates/layout.html	2010年06月21日 13:19:11 UTC (rev 8449)
@@ -13,17 +13,24 @@
 {% block relbar1 %}
 <!-- Piwik -->
 <script type="text/javascript">
-var pkBaseURL = (("https:" == document.location.protocol) ? "https://apps.sourceforge.net/piwik/matplotlib/" : "http://apps.sourceforge.net/piwik/matplotlib/");
-document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
-</script><script type="text/javascript">
-piwik_action_name = '';
-piwik_idsite = 1;
-piwik_url = pkBaseURL + "piwik.php";
-piwik_log(piwik_action_name, piwik_idsite, piwik_url);
+if ("matplotlib.sourceforge.net" == document.location.hostname ||
+ "matplotlib.sf.net" == document.location.hostname) {
+ var pkBaseURL = (("https:" == document.location.protocol) ? "https://apps.sourceforge.net/piwik/matplotlib/" : "http://apps.sourceforge.net/piwik/matplotlib/");
+ document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
+}
 </script>
-<object><noscript><p><img src="http://apps.sourceforge.net/piwik/matplotlib/piwik.php?idsite=1" alt="piwik"/></p></noscript></object>
+<script type="text/javascript">
+if ("matplotlib.sourceforge.net" == document.location.hostname ||
+ "matplotlib.sf.net" == document.location.hostname) {
+ piwik_action_name = '';
+ piwik_idsite = 1;
+ piwik_url = pkBaseURL + "piwik.php";
+ piwik_log(piwik_action_name, piwik_idsite, piwik_url);
+ document.write(unescape('%3Cobject%3E%3Cnoscript%3E%3Cp%3E%3Cimg src="http://apps.sourceforge.net/piwik/matplotlib/piwik.php?idsite=1" alt="piwik"/%3E%3C/p%3E%3C/noscript%3E%3C/object%3E'));
+}
+</script>
 <!-- End Piwik Tag -->
-<link rel="shortcut icon" href="_static/favicon.ico"> 
+<link rel="shortcut icon" href="_static/favicon.ico">
 
 <div style="background-color: white; text-align: left; padding: 10px 10px 15px 15px">
 <a href="{{ pathto('index') }}"><img src="{{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <ef...@us...> - 2010年06月21日 08:51:37
Revision: 8448
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8448&view=rev
Author: efiring
Date: 2010年06月21日 08:51:30 +0000 (2010年6月21日)
Log Message:
-----------
Add Axes.tick_params and pyplot.tick_params to control tick and tick label appearance.
This allows interactive modification of tick and tick label color, size, etc.
Modified Paths:
--------------
 trunk/matplotlib/CHANGELOG
 trunk/matplotlib/boilerplate.py
 trunk/matplotlib/lib/matplotlib/axes.py
 trunk/matplotlib/lib/matplotlib/axis.py
 trunk/matplotlib/lib/matplotlib/pyplot.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG	2010年06月20日 23:31:49 UTC (rev 8447)
+++ trunk/matplotlib/CHANGELOG	2010年06月21日 08:51:30 UTC (rev 8448)
@@ -1,3 +1,7 @@
+2010年06月20日 Added Axes.tick_params and corresponding pyplot function
+ to control tick and tick label appearance after an Axes
+ has been created. - EF
+
 2010年06月09日 Allow Axes.grid to control minor gridlines; allow
 Axes.grid and Axis.grid to control major and minor
 gridlines in the same method call. - EF
Modified: trunk/matplotlib/boilerplate.py
===================================================================
--- trunk/matplotlib/boilerplate.py	2010年06月20日 23:31:49 UTC (rev 8447)
+++ trunk/matplotlib/boilerplate.py	2010年06月21日 08:51:30 UTC (rev 8448)
@@ -107,6 +107,7 @@
 'annotate',
 'ticklabel_format',
 'locator_params',
+ 'tick_params',
 'margins',
 )
 
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py	2010年06月20日 23:31:49 UTC (rev 8447)
+++ trunk/matplotlib/lib/matplotlib/axes.py	2010年06月21日 08:51:30 UTC (rev 8448)
@@ -2101,7 +2101,82 @@
 self.yaxis.get_major_locator().set_params(**kwargs)
 self.autoscale_view(tight=tight, scalex=_x, scaley=_y)
 
+ def tick_params(self, axis='both', **kwargs):
+ """
+ Convenience method for changing the appearance of ticks and
+ tick labels.
 
+ Keyword arguments:
+
+ *axis*
+ ['x' | 'y' | 'both'] Axis on which to operate;
+ default is 'both'.
+
+ *reset*
+ [True | False] If *True*, set all parameters to defaults
+ before processing other keyword arguments. Default is
+ *False*.
+
+ *which*
+ ['major' | 'minor' | 'both'] Default is 'major': apply
+ arguments to major ticks only.
+
+ *direction*
+ ['in' | 'out'] Puts ticks inside or outside the axes.
+
+ *length*
+ Tick length in points.
+
+ *width*
+ Tick width in points.
+
+ *color*
+ Tick color; accepts any mpl color spec.
+
+ *pad*
+ Distance in points between tick and label.
+
+ *labelsize*
+ Tick label font size in points or as a string (e.g. 'large').
+
+ *labelcolor*
+ Tick label color; mpl color spec.
+
+ *colors*
+ Changes the tick color and the label color to the same value:
+ mpl color spec.
+
+ *zorder*
+ Tick and label zorder.
+
+ *bottom*, *top*, *left*, *right*
+ Boolean or ['on' | 'off'], controls whether to draw the
+ respective ticks.
+
+ *labelbottom*, *labeltop*, *labelleft*, *labelright*
+ Boolean or ['on' | 'off'], controls whether to draw the
+ respective tick labels.
+
+ Example::
+
+ ax.tick_params(direction='out', length=6, width=2, colors='r')
+
+ This will make all major ticks be red, pointing out of the box,
+ and with dimensions 6 points by 2 points. Tick labels will
+ also be red.
+
+ """
+ if axis in ['x', 'both']:
+ xkw = dict(kwargs)
+ xkw.pop('top', None)
+ xkw.pop('bottom', None)
+ self.xaxis.set_tick_params(**xkw)
+ if axis in ['y', 'both']:
+ ykw = dict(kwargs)
+ ykw.pop('left', None)
+ ykw.pop('right', None)
+ self.yaxis.set_tick_params(**ykw)
+
 def set_axis_off(self):
 """turn off the axis"""
 self.axison = False
Modified: trunk/matplotlib/lib/matplotlib/axis.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axis.py	2010年06月20日 23:31:49 UTC (rev 8447)
+++ trunk/matplotlib/lib/matplotlib/axis.py	2010年06月21日 08:51:30 UTC (rev 8448)
@@ -60,7 +60,16 @@
 
 """
 def __init__(self, axes, loc, label,
- size = None, # points
+
+ size = None, # points
+ width = None,
+ color = None,
+ tickdir = None,
+ pad = None,
+ labelsize = None,
+ labelcolor = None,
+ zorder = None,
+
 gridOn = None, # defaults to axes.grid
 tick1On = True,
 tick2On = True,
@@ -71,7 +80,7 @@
 """
 bbox is the Bound2D bounding box in display coords of the Axes
 loc is the tick location in data coords
- size is the tick size in relative, axes coords
+ size is the tick size in points
 """
 artist.Artist.__init__(self)
 
@@ -81,27 +90,47 @@
 self.axes = axes
 
 name = self.__name__.lower()
+ self._name = name
+
+ self._loc = loc
+
 if size is None:
 if major:
 size = rcParams['%s.major.size'%name]
+ else:
+ size = rcParams['%s.minor.size'%name]
+ self._size = size
+
+ self._width = width # can be None for marker default
+
+ if color is None:
+ color = rcParams['%s.color' % name]
+ self._color = color
+
+ if pad is None:
+ if major:
 pad = rcParams['%s.major.pad'%name]
 else:
- size = rcParams['%s.minor.size'%name]
 pad = rcParams['%s.minor.pad'%name]
+ self._base_pad = pad
 
- self._tickdir = rcParams['%s.direction'%name]
- if self._tickdir == 'in':
- self._xtickmarkers = (mlines.TICKUP, mlines.TICKDOWN)
- self._ytickmarkers = (mlines.TICKRIGHT, mlines.TICKLEFT)
- self._pad = pad
- else:
- self._xtickmarkers = (mlines.TICKDOWN, mlines.TICKUP)
- self._ytickmarkers = (mlines.TICKLEFT, mlines.TICKRIGHT)
- self._pad = pad + size
+ if labelcolor is None:
+ labelcolor = rcParams['%s.color' % name]
+ self._labelcolor = labelcolor
 
- self._loc = loc
- self._size = size
+ if labelsize is None:
+ labelsize = rcParams['%s.labelsize' % name]
+ self._labelsize = labelsize
 
+ if zorder is None:
+ if major:
+ zorder = mlines.Line2D.zorder + 0.01
+ else:
+ zorder = mlines.Line2D.zorder
+ self._zorder = zorder
+
+ self.apply_tickdir(tickdir)
+
 self.tick1line = self._get_tick1line()
 self.tick2line = self._get_tick2line()
 self.gridline = self._get_gridline()
@@ -118,6 +147,20 @@
 
 self.update_position(loc)
 
+ def apply_tickdir(self, tickdir):
+ if tickdir is None:
+ tickdir = rcParams['%s.direction' % self._name]
+ self._tickdir = tickdir
+
+ if self._tickdir == 'in':
+ self._xtickmarkers = (mlines.TICKUP, mlines.TICKDOWN)
+ self._ytickmarkers = (mlines.TICKRIGHT, mlines.TICKLEFT)
+ self._pad = self._base_pad
+ else:
+ self._xtickmarkers = (mlines.TICKDOWN, mlines.TICKUP)
+ self._ytickmarkers = (mlines.TICKLEFT, mlines.TICKRIGHT)
+ self._pad = self._base_pad + self._size
+
 def get_children(self):
 children = [self.tick1line, self.tick2line, self.gridline, self.label1, self.label2]
 return children
@@ -242,15 +285,13 @@
 # x in data coords, y in axes coords
 #t = mtext.Text(
 trans, vert, horiz = self.axes.get_xaxis_text1_transform(self._pad)
- size = rcParams['xtick.labelsize']
 t = mtext.Text(
 x=0, y=0,
- fontproperties=font_manager.FontProperties(size=size),
- color=rcParams['xtick.color'],
+ fontproperties=font_manager.FontProperties(size=self._labelsize),
+ color=self._labelcolor,
 verticalalignment=vert,
 horizontalalignment=horiz,
 )
-
 t.set_transform(trans)
 self._set_artist_props(t)
 return t
@@ -262,11 +303,10 @@
 # x in data coords, y in axes coords
 #t = mtext.Text(
 trans, vert, horiz = self.axes.get_xaxis_text2_transform(self._pad)
-
 t = mtext.Text(
 x=0, y=1,
- fontproperties=font_manager.FontProperties(size=rcParams['xtick.labelsize']),
- color=rcParams['xtick.color'],
+ fontproperties=font_manager.FontProperties(size=self._labelsize),
+ color=self._labelcolor,
 verticalalignment=vert,
 horizontalalignment=horiz,
 )
@@ -278,10 +318,12 @@
 'Get the default line2D instance'
 # x in data coords, y in axes coords
 l = mlines.Line2D(xdata=(0,), ydata=(0,),
- color='k',
+ color=self._color,
 linestyle = 'None',
 marker = self._xtickmarkers[0],
 markersize=self._size,
+ markeredgewidth=self._width,
+ zorder=self._zorder,
 )
 l.set_transform(self.axes.get_xaxis_transform(which='tick1'))
 self._set_artist_props(l)
@@ -291,10 +333,12 @@
 'Get the default line2D instance'
 # x in data coords, y in axes coords
 l = mlines.Line2D( xdata=(0,), ydata=(1,),
- color='k',
+ color=self._color,
 linestyle = 'None',
 marker = self._xtickmarkers[1],
 markersize=self._size,
+ markeredgewidth=self._width,
+ zorder=self._zorder,
 )
 
 l.set_transform(self.axes.get_xaxis_transform(which='tick2'))
@@ -372,13 +416,11 @@
 def _get_text1(self):
 'Get the default Text instance'
 # x in axes coords, y in data coords
- #t = mtext.Text(
 trans, vert, horiz = self.axes.get_yaxis_text1_transform(self._pad)
-
 t = mtext.Text(
 x=0, y=0,
- fontproperties=font_manager.FontProperties(size=rcParams['ytick.labelsize']),
- color=rcParams['ytick.color'],
+ fontproperties=font_manager.FontProperties(size=self._labelsize),
+ color=self._labelcolor,
 verticalalignment=vert,
 horizontalalignment=horiz,
 )
@@ -390,13 +432,11 @@
 def _get_text2(self):
 'Get the default Text instance'
 # x in axes coords, y in data coords
- #t = mtext.Text(
 trans, vert, horiz = self.axes.get_yaxis_text2_transform(self._pad)
-
 t = mtext.Text(
 x=1, y=0,
- fontproperties=font_manager.FontProperties(size=rcParams['ytick.labelsize']),
- color=rcParams['ytick.color'],
+ fontproperties=font_manager.FontProperties(size=self._labelsize),
+ color=self._labelcolor,
 verticalalignment=vert,
 horizontalalignment=horiz,
 )
@@ -408,11 +448,14 @@
 'Get the default line2D instance'
 # x in axes coords, y in data coords
 
- l = mlines.Line2D( (0,), (0,), color='k',
+ l = mlines.Line2D( (0,), (0,),
+ color=self._color,
 marker = self._ytickmarkers[0],
 linestyle = 'None',
 markersize=self._size,
- )
+ markeredgewidth=self._width,
+ zorder=self._zorder,
+ )
 l.set_transform(self.axes.get_yaxis_transform(which='tick1'))
 self._set_artist_props(l)
 return l
@@ -420,12 +463,14 @@
 def _get_tick2line(self):
 'Get the default line2D instance'
 # x in axes coords, y in data coords
- l = mlines.Line2D( (1,), (0,), color='k',
+ l = mlines.Line2D( (1,), (0,),
+ color=self._color,
 marker = self._ytickmarkers[1],
 linestyle = 'None',
 markersize=self._size,
+ markeredgewidth=self._width,
+ zorder=self._zorder,
 )
-
 l.set_transform(self.axes.get_yaxis_transform(which='tick2'))
 self._set_artist_props(l)
 return l
@@ -549,6 +594,10 @@
 self.minorTicks = []
 self.pickradius = pickradius
 
+ # Initialize here for testing; later add API
+ self._major_tick_kw = dict()
+ self._minor_tick_kw = dict()
+
 self.cla()
 self.set_scale('linear')
 
@@ -631,10 +680,16 @@
 self.label.set_text('')
 self._set_artist_props(self.label)
 
+ self.reset_ticks()
+
+ self.converter = None
+ self.units = None
+ self.set_units(None)
+
+ def reset_ticks(self):
 # build a few default ticks; grow as necessary later; only
 # define 1 so properties set on ticks will be copied as they
 # grow
-
 cbook.popall(self.majorTicks)
 cbook.popall(self.minorTicks)
 
@@ -643,10 +698,84 @@
 self._lastNumMajorTicks = 1
 self._lastNumMinorTicks = 1
 
- self.converter = None
- self.units = None
- self.set_units(None)
+ def set_tick_params(self, which='major', reset=False, **kw):
+ """
+ Set appearance parameters for ticks and ticklabels.
 
+ For documentation of keyword arguments, see
+ :meth:`matplotlib.axes.Axes.tick_params`.
+ """
+ dicts = []
+ if which == 'major' or which == 'both':
+ dicts.append(self._major_tick_kw)
+ if which == 'minor' or which == 'both':
+ dicts.append(self._minor_tick_kw)
+ kwtrans = self._translate_tick_kw(kw, to_init_kw=True)
+ for d in dicts:
+ if reset:
+ d.clear()
+ d.update(kwtrans)
+ self.reset_ticks()
+
+ @staticmethod
+ def _translate_tick_kw(kw, to_init_kw=True):
+ # We may want to move the following function to
+ # a more visible location; or maybe there already
+ # is something like this.
+ def _bool(arg):
+ if cbook.is_string_like(arg):
+ if arg.lower() == 'on':
+ return True
+ if arg.lower() == 'off':
+ return False
+ raise ValueError('String "%s" should be "on" or "off"' % arg)
+ return bool(arg)
+ # The following lists may be moved to a more
+ # accessible location.
+ kwkeys0 = ['size', 'width', 'color', 'tickdir', 'pad',
+ 'labelsize', 'labelcolor', 'zorder',
+ 'tick1On', 'tick2On', 'label1On', 'label2On']
+ kwkeys1 = ['length', 'direction', 'left', 'bottom', 'right', 'top',
+ 'labelleft', 'labelbottom', 'labelright', 'labeltop']
+ kwkeys = kwkeys0 + kwkeys1
+ kwtrans = dict()
+ if to_init_kw:
+ if 'length' in kw:
+ kwtrans['size'] = kw.pop('length')
+ if 'direction' in kw:
+ kwtrans['tickdir'] = kw.pop('direction')
+ if 'left' in kw:
+ kwtrans['tick1On'] = _bool(kw.pop('left'))
+ if 'bottom' in kw:
+ kwtrans['tick1On'] = _bool(kw.pop('bottom'))
+ if 'right' in kw:
+ kwtrans['tick2On'] = _bool(kw.pop('right'))
+ if 'top' in kw:
+ kwtrans['tick2On'] = _bool(kw.pop('top'))
+
+ if 'labelleft' in kw:
+ kwtrans['label1On'] = _bool(kw.pop('labelleft'))
+ if 'labelbottom' in kw:
+ kwtrans['label1On'] = _bool(kw.pop('labelbottom'))
+ if 'labelright' in kw:
+ kwtrans['label2On'] = _bool(kw.pop('labelright'))
+ if 'labeltop' in kw:
+ kwtrans['label2On'] = _bool(kw.pop('labeltop'))
+ if 'colors' in kw:
+ c = kw.pop('colors')
+ kwtrans['color'] = c
+ kwtrans['labelcolor'] = c
+ # Maybe move the checking up to the caller of this method.
+ for key in kw:
+ if key not in kwkeys:
+ raise ValueError(
+ "keyword %s is not recognized; valid keywords are %s"
+ % (key, kwkeys))
+ kwtrans.update(kw)
+ else:
+ raise NotImplementedError("Inverse translation is deferred")
+ return kwtrans
+
 def set_clip_path(self, clippath, transform=None):
 artist.Artist.set_clip_path(self, clippath, transform)
 majorticks = self.get_major_ticks()
@@ -1303,13 +1432,18 @@
 return inaxis, {}
 
 def _get_tick(self, major):
- return XTick(self.axes, 0, '', major=major)
+ if major:
+ tick_kw = self._major_tick_kw
+ else:
+ tick_kw = self._minor_tick_kw
+ return XTick(self.axes, 0, '', major=major, **tick_kw)
 
 def _get_label(self):
 # x in axes coords, y in display coords (to be updated at draw
 # time by _update_label_positions)
 label = mtext.Text(x=0.5, y=0,
- fontproperties = font_manager.FontProperties(size=rcParams['axes.labelsize']),
+ fontproperties = font_manager.FontProperties(
+ size=rcParams['axes.labelsize']),
 color = rcParams['axes.labelcolor'],
 verticalalignment='top',
 horizontalalignment='center',
@@ -1325,7 +1459,8 @@
 def _get_offset_text(self):
 # x in axes coords, y in display coords (to be updated at draw time)
 offsetText = mtext.Text(x=1, y=0,
- fontproperties = font_manager.FontProperties(size=rcParams['xtick.labelsize']),
+ fontproperties = font_manager.FontProperties(
+ size=rcParams['xtick.labelsize']),
 color = rcParams['xtick.color'],
 verticalalignment='top',
 horizontalalignment='right',
@@ -1562,7 +1697,11 @@
 return inaxis, {}
 
 def _get_tick(self, major):
- return YTick(self.axes, 0, '', major=major)
+ if major:
+ tick_kw = self._major_tick_kw
+ else:
+ tick_kw = self._minor_tick_kw
+ return YTick(self.axes, 0, '', major=major, **tick_kw)
 
 
 def _get_label(self):
@@ -1570,7 +1709,8 @@
 # y in axes coords
 label = mtext.Text(x=0, y=0.5,
 # todo: get the label position
- fontproperties=font_manager.FontProperties(size=rcParams['axes.labelsize']),
+ fontproperties=font_manager.FontProperties(
+ size=rcParams['axes.labelsize']),
 color = rcParams['axes.labelcolor'],
 verticalalignment='center',
 horizontalalignment='right',
@@ -1586,7 +1726,8 @@
 def _get_offset_text(self):
 # x in display coords, y in axes coords (to be updated at draw time)
 offsetText = mtext.Text(x=0, y=0.5,
- fontproperties = font_manager.FontProperties(size=rcParams['ytick.labelsize']),
+ fontproperties = font_manager.FontProperties(
+ size=rcParams['ytick.labelsize']),
 color = rcParams['ytick.color'],
 verticalalignment = 'baseline',
 horizontalalignment = 'left',
Modified: trunk/matplotlib/lib/matplotlib/pyplot.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/pyplot.py	2010年06月20日 23:31:49 UTC (rev 8447)
+++ trunk/matplotlib/lib/matplotlib/pyplot.py	2010年06月21日 08:51:30 UTC (rev 8448)
@@ -1936,8 +1936,7 @@
 # This function was autogenerated by boilerplate.py. Do not edit as
 # changes will be lost
 @autogen_docstring(Axes.boxplot)
-def boxplot(x, notch=0, sym='b+', vert=1, whis=1.5, positions=None, widths=None,
- hold=None, patch_artist=False):
+def boxplot(x, notch=0, sym='b+', vert=1, whis=1.5, positions=None, widths=None, patch_artist=False, bootstrap=None, hold=None):
 ax = gca()
 # allow callers to override the hold state by passing hold=True|False
 washold = ax.ishold()
@@ -1945,8 +1944,7 @@
 if hold is not None:
 ax.hold(hold)
 try:
- ret = ax.boxplot(x, notch, sym, vert, whis, positions, widths,
- patch_artist=patch_artist)
+ ret = ax.boxplot(x, notch, sym, vert, whis, positions, widths, patch_artist, bootstrap)
 draw_if_interactive()
 finally:
 ax.hold(washold)
@@ -2136,7 +2134,7 @@
 # This function was autogenerated by boilerplate.py. Do not edit as
 # changes will be lost
 @autogen_docstring(Axes.hist)
-def hist(x, bins=10, range=None, normed=False, weights=None, cumulative=False, bottom=None, histtype='bar', align='mid', orientation='vertical', rwidth=None, log=False, hold=None, **kwargs):
+def hist(x, bins=10, range=None, normed=False, weights=None, cumulative=False, bottom=None, histtype='bar', align='mid', orientation='vertical', rwidth=None, log=False, color=None, label=None, hold=None, **kwargs):
 ax = gca()
 # allow callers to override the hold state by passing hold=True|False
 washold = ax.ishold()
@@ -2144,7 +2142,7 @@
 if hold is not None:
 ax.hold(hold)
 try:
- ret = ax.hist(x, bins, range, normed, weights, cumulative, bottom, histtype, align, orientation, rwidth, log, **kwargs)
+ ret = ax.hist(x, bins, range, normed, weights, cumulative, bottom, histtype, align, orientation, rwidth, log, color, label, **kwargs)
 draw_if_interactive()
 finally:
 ax.hold(washold)
@@ -2421,7 +2419,6 @@
 sci(ret[-1])
 return ret
 
-
 # This function was autogenerated by boilerplate.py. Do not edit as
 # changes will be lost
 @autogen_docstring(Axes.stem)
@@ -2643,13 +2640,21 @@
 # This function was autogenerated by boilerplate.py. Do not edit as
 # changes will be lost
 @docstring.copy_dedent(Axes.locator_params)
-def locator_params(axis='both', tight=False, **kwargs):
+def locator_params(axis='both', tight=None, **kwargs):
 ret = gca().locator_params(axis, tight, **kwargs)
 draw_if_interactive()
 return ret
 
 # This function was autogenerated by boilerplate.py. Do not edit as
 # changes will be lost
+...@do...py_dedent(Axes.tick_params)
+def tick_params(axis='both', **kwargs):
+ ret = gca().tick_params(axis, **kwargs)
+ draw_if_interactive()
+ return ret
+
+# This function was autogenerated by boilerplate.py. Do not edit as
+# changes will be lost
 @docstring.copy_dedent(Axes.margins)
 def margins(*args, **kw):
 ret = gca().margins(*args, **kw)
@@ -2879,3 +2884,6 @@
 if im is not None:
 im.set_cmap(cm.spectral)
 draw_if_interactive()
+
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

Showing 6 results of 6

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