From: <lee...@us...> - 2008-12-19 22:03:12
|
Revision: 6686 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6686&view=rev Author: leejjoon Date: 2008-12-19 21:41:11 +0000 (Fri, 19 Dec 2008) Log Message: ----------- Merged revisions 6685 via svnmerge from https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_98_5_maint ........ r6685 | leejjoon | 2008-12-19 16:24:32 -0500 (Fri, 19 Dec 2008) | 1 line update legend-related document ........ Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/doc/api/api_changes.rst trunk/matplotlib/lib/matplotlib/__init__.py trunk/matplotlib/lib/matplotlib/axes.py trunk/matplotlib/lib/matplotlib/legend.py trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf.template trunk/matplotlib/lib/matplotlib/rcsetup.py Property Changed: ---------------- trunk/matplotlib/ Property changes on: trunk/matplotlib ___________________________________________________________________ Modified: svnmerge-integrated - /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6681 + /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6685 Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2008-12-19 21:24:32 UTC (rev 6685) +++ trunk/matplotlib/CHANGELOG 2008-12-19 21:41:11 UTC (rev 6686) @@ -1,3 +1,7 @@ +2008-12-19 Update Axes.legend documnetation. /api/api_changes.rst is also + updated to describe chages in keyword parameters. + Issue a warning if old keyword parameters are used. - JJL + 2008-12-18 add new arrow style, a line + filled triangles. -JJL ================================================================== Modified: trunk/matplotlib/doc/api/api_changes.rst =================================================================== --- trunk/matplotlib/doc/api/api_changes.rst 2008-12-19 21:24:32 UTC (rev 6685) +++ trunk/matplotlib/doc/api/api_changes.rst 2008-12-19 21:41:11 UTC (rev 6686) @@ -15,6 +15,22 @@ Changes for 0.98.x ================== +* Following keyword parameters for :class:`matplotlib.label.Label` are now + deprecated and new set of parameters are introduced. The new parameters + are given as a fraction of the font-size. Also, *scatteryoffsets*, + *fancybox* and *columnspacing* are added as keyword parameters. + + ================ ================ + Deprecated New + ================ ================ + pad borderpad + labelsep labelspacing + handlelen handlelength + handlestextsep handletextpad + axespad borderaxespad + ================ ================ + + * Removed the configobj and experiemtnal traits rc support * Modified :func:`matplotlib.mlab.psd`, :func:`matplotlib.mlab.csd`, Modified: trunk/matplotlib/lib/matplotlib/__init__.py =================================================================== --- trunk/matplotlib/lib/matplotlib/__init__.py 2008-12-19 21:24:32 UTC (rev 6685) +++ trunk/matplotlib/lib/matplotlib/__init__.py 2008-12-19 21:41:11 UTC (rev 6686) @@ -582,7 +582,15 @@ 'tick.size' : 'tick.major.size', } +_deprecated_ignore_map = { + 'legend.pad' : 'legend.borderpad', + 'legend.labelsep' : 'legend.labelspacing', + 'legend.handlelen' : 'legend.handlelength', + 'legend.handletextsep' : 'legend.handletextpad', + 'legend.axespad' : 'legend.borderaxespad', + } + class RcParams(dict): """ @@ -602,6 +610,10 @@ warnings.warn('%s is deprecated in matplotlibrc. Use %s \ instead.'% (key, alt)) key = alt + elif key in _deprecated_ignore_map: + alt = _deprecated_ignore_map[key] + warnings.warn('%s is deprecated. Use %s instead.'% (key, alt)) + return cval = self.validate[key](val) dict.__setitem__(self, key, cval) except KeyError: @@ -665,6 +677,9 @@ except Exception, msg: warnings.warn('Bad val "%s" on line #%d\n\t"%s"\n\tin file \ "%s"\n\t%s' % (val, cnt, line, fname, msg)) + elif key in _deprecated_ignore_map: + warnings.warn('%s is deprecated. Update your matplotlibrc to use %s instead.'% (key, _deprecated_ignore_map[key])) + else: print >> sys.stderr, """ Bad key "%s" on line %d in Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-12-19 21:24:32 UTC (rev 6685) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-12-19 21:41:11 UTC (rev 6686) @@ -3740,10 +3740,6 @@ A :class:`matplotlib.font_manager.FontProperties` instance, or *None* to use rc settings. - *pad*: [ None | scalar ] - The fractional whitespace inside the legend border, between 0 and 1. - If *None*, use rc settings. - *markerscale*: [ None | scalar ] The relative size of legend markers vs. original. If *None*, use rc settings. @@ -3751,21 +3747,21 @@ *shadow*: [ None | False | True ] If *True*, draw a shadow behind legend. If *None*, use rc settings. - *labelsep*: [ None | scalar ] - The vertical space between the legend entries. If *None*, use rc - settings. + Padding and spacing between various elements use following keywords + parameters. The dimensions of these values are given as a fraction + of the fontsize. Values from rcParams will be used if None. - *handlelen*: [ None | scalar ] - The length of the legend lines. If *None*, use rc settings. + ================ ================================================================== + Keyword Description + ================ ================================================================== + borderpad the fractional whitespace inside the legend border + labelspacing the vertical space between the legend entries + handlelength the length of the legend handles + handletextpad the pad between the legend handle and text + borderaxespad the pad between the axes and legend border + columnspacing the spacing between columns + ================ ================================================================== - *handletextsep*: [ None | scalar ] - The space between the legend line and legend text. If *None*, use rc - settings. - - *axespad*: [ None | scalar ] - The border between the axes and legend edge. If *None*, use rc - settings. - **Example:** .. plot:: mpl_examples/api/legend_demo.py Modified: trunk/matplotlib/lib/matplotlib/legend.py =================================================================== --- trunk/matplotlib/lib/matplotlib/legend.py 2008-12-19 21:24:32 UTC (rev 6685) +++ trunk/matplotlib/lib/matplotlib/legend.py 2008-12-19 21:41:11 UTC (rev 6686) @@ -98,7 +98,7 @@ handletextsep = None, # deprecated; use handletextpad axespad = None, # deprecated; use borderaxespad - # spacing & pad defined as a fractionof the font-size + # spacing & pad defined as a fraction of the font-size borderpad = None, # the whitespace inside the legend border labelspacing=None, #the vertical space between the legend entries handlelength=None, # the length of the legend handles Modified: trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf.template =================================================================== --- trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf.template 2008-12-19 21:24:32 UTC (rev 6685) +++ trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf.template 2008-12-19 21:41:11 UTC (rev 6686) @@ -233,19 +233,11 @@ origin = 'upper' [legend] - # a float - axespad = 0.02 # a float or 'xx-small' or 'x-small' or 'small' or 'medium' or 'large' or # 'x-large' or 'xx-large' fontsize = 'medium' - # a float - handlelen = 0.050000000000000003 - # a float - handletextsep = 0.02 # a boolean isaxes = True - # a float - labelsep = 0.01 # 'best' or 'upper right' or 'upper left' or 'lower left' or 'lower right' # or 'right' or 'center left' or 'center right' or 'lower center' or # 'upper center' or 'center' @@ -254,11 +246,22 @@ markerscale = 1.0 # an integer numpoints = 3 - # a float - pad = 0.20000000000000001 # a boolean shadow = False + # float + borderpad = 0.4 + # float + labelspacing = 0.5 + # float + handlelength = 2. + # float + handletextpad = 0.8 + # float + borderaxespad = 0.5 + # float + columnspacing = 2. + [lines] # a boolean antialiased = True Modified: trunk/matplotlib/lib/matplotlib/rcsetup.py =================================================================== --- trunk/matplotlib/lib/matplotlib/rcsetup.py 2008-12-19 21:24:32 UTC (rev 6685) +++ trunk/matplotlib/lib/matplotlib/rcsetup.py 2008-12-19 21:41:11 UTC (rev 6686) @@ -432,18 +432,12 @@ 'legend.isaxes' : [True,validate_bool], # this option is internally ignored - it never served any useful purpose 'legend.numpoints' : [2, validate_int], # the number of points in the legend line 'legend.fontsize' : ['large', validate_fontsize], - 'legend.pad' : [0, validate_float], # was 0.2, deprecated; the fractional whitespace inside the legend border - 'legend.borderpad' : [0.4, validate_float], # units are fontsize 'legend.markerscale' : [1.0, validate_float], # the relative size of legend markers vs. original - - # the following dimensions are in axes coords - 'legend.labelsep' : [0.010, validate_float], # the vertical space between the legend entries - 'legend.handlelen' : [0.05, validate_float], # the length of the legend lines - 'legend.handletextsep' : [0.02, validate_float], # the space between the legend line and legend text - 'legend.axespad' : [0.02, validate_float], # the border between the axes and legend edge 'legend.shadow' : [False, validate_bool], + # the following dimensions are in fraction of the font size + 'legend.borderpad' : [0.4, validate_float], # units are fontsize 'legend.labelspacing' : [0.5, validate_float], # the vertical space between the legend entries 'legend.handlelength' : [2., validate_float], # the length of the legend lines 'legend.handletextpad' : [.8, validate_float], # the space between the legend line and legend text @@ -453,11 +447,6 @@ 'legend.markerscale' : [1.0, validate_float], # the relative size of legend markers vs. original - # the following dimensions are in axes coords - 'legend.labelsep' : [0.010, validate_float], # the vertical space between the legend entries - 'legend.handlelen' : [0.05, validate_float], # the length of the legend lines - 'legend.handletextsep' : [0.02, validate_float], # the space between the legend line and legend text - 'legend.axespad' : [0.5, validate_float], # the border between the axes and legend edge 'legend.shadow' : [False, validate_bool], This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |