Revision: 6685
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6685&view=rev
Author: leejjoon
Date: 2008-12-19 21:24:32 +0000 (Fri, 19 Dec 2008)
Log Message:
-----------
update legend-related document
Modified Paths:
--------------
branches/v0_98_5_maint/CHANGELOG
branches/v0_98_5_maint/doc/api/api_changes.rst
branches/v0_98_5_maint/lib/matplotlib/__init__.py
branches/v0_98_5_maint/lib/matplotlib/axes.py
branches/v0_98_5_maint/lib/matplotlib/legend.py
branches/v0_98_5_maint/lib/matplotlib/mpl-data/matplotlib.conf.template
branches/v0_98_5_maint/lib/matplotlib/rcsetup.py
Modified: branches/v0_98_5_maint/CHANGELOG
===================================================================
--- branches/v0_98_5_maint/CHANGELOG 2008-12-19 20:27:18 UTC (rev 6684)
+++ branches/v0_98_5_maint/CHANGELOG 2008-12-19 21:24:32 UTC (rev 6685)
@@ -1,3 +1,6 @@
+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
=======================================================================
Re-Released 0.98.5.2 at r6679
Modified: branches/v0_98_5_maint/doc/api/api_changes.rst
===================================================================
--- branches/v0_98_5_maint/doc/api/api_changes.rst 2008-12-19 20:27:18 UTC
(rev 6684)
+++ branches/v0_98_5_maint/doc/api/api_changes.rst 2008-12-19 21:24:32 UTC
(rev 6685)
@@ -8,6 +8,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: branches/v0_98_5_maint/lib/matplotlib/__init__.py
===================================================================
--- branches/v0_98_5_maint/lib/matplotlib/__init__.py 2008-12-19 20:27:18 UTC
(rev 6684)
+++ branches/v0_98_5_maint/lib/matplotlib/__init__.py 2008-12-19 21:24:32 UTC
(rev 6685)
@@ -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: branches/v0_98_5_maint/lib/matplotlib/axes.py
===================================================================
--- branches/v0_98_5_maint/lib/matplotlib/axes.py 2008-12-19 20:27:18 UTC
(rev 6684)
+++ branches/v0_98_5_maint/lib/matplotlib/axes.py 2008-12-19 21:24:32 UTC
(rev 6685)
@@ -3728,10 +3728,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.
@@ -3739,21 +3735,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: branches/v0_98_5_maint/lib/matplotlib/legend.py
===================================================================
--- branches/v0_98_5_maint/lib/matplotlib/legend.py 2008-12-19 20:27:18 UTC
(rev 6684)
+++ branches/v0_98_5_maint/lib/matplotlib/legend.py 2008-12-19 21:24:32 UTC
(rev 6685)
@@ -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:
branches/v0_98_5_maint/lib/matplotlib/mpl-data/matplotlib.conf.template
===================================================================
--- branches/v0_98_5_maint/lib/matplotlib/mpl-data/matplotlib.conf.template
2008-12-19 20:27:18 UTC (rev 6684)
+++ branches/v0_98_5_maint/lib/matplotlib/mpl-data/matplotlib.conf.template
2008-12-19 21:24:32 UTC (rev 6685)
@@ -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: branches/v0_98_5_maint/lib/matplotlib/rcsetup.py
===================================================================
--- branches/v0_98_5_maint/lib/matplotlib/rcsetup.py 2008-12-19 20:27:18 UTC
(rev 6684)
+++ branches/v0_98_5_maint/lib/matplotlib/rcsetup.py 2008-12-19 21:24:32 UTC
(rev 6685)
@@ -422,18 +422,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
@@ -443,11 +437,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.
------------------------------------------------------------------------------
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins