Revision: 7841
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7841&view=rev
Author: leejjoon
Date: 2009-10-02 18:58:20 +0000 (Fri, 02 Oct 2009)
Log Message:
-----------
add framon option for legend
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
trunk/matplotlib/lib/matplotlib/legend.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2009-10-01 16:12:04 UTC (rev
7840)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2009-10-02 18:58:20 UTC (rev
7841)
@@ -3925,6 +3925,9 @@
The relative size of legend markers vs. original. If *None*, use rc
settings.
+ *frameon*: [ True | False ]
+ if True, draw a frame. Default is True
+
*fancybox*: [ None | False | True ]
if True, draw a frame with a round fancybox. If None, use rc
Modified: trunk/matplotlib/lib/matplotlib/legend.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/legend.py 2009-10-01 16:12:04 UTC (rev
7840)
+++ trunk/matplotlib/lib/matplotlib/legend.py 2009-10-02 18:58:20 UTC (rev
7841)
@@ -115,6 +115,7 @@
title = None, # set a title for the legend
bbox_to_anchor = None, # bbox that the legend will be
anchored.
bbox_transform = None, # transform for the bbox
+ frameon = True, # draw frame
):
"""
- *parent* : the artist that contains the legend
@@ -132,6 +133,7 @@
numpoints the number of points in the legend for line
scatterpoints the number of points in the legend for scatter plot
scatteryoffsets a list of yoffsets for scatter symbols in legend
+ frameon if True, draw a frame (default is True)
fancybox if True, draw a frame with a round fancybox. If
None, use rc
shadow if True, draw a shadow behind legend
ncol number of columns
@@ -303,7 +305,7 @@
self._set_artist_props(self.legendPatch)
- self._drawFrame = True
+ self._drawFrame = frameon
# init with null renderer
self._init_legend_box(handles, labels)
@@ -687,7 +689,7 @@
def draw_frame(self, b):
'b is a boolean. Set draw frame to b'
- self._drawFrame = b
+ self.set_frame_on(b)
def get_children(self):
'return a list of child artists'
@@ -737,6 +739,20 @@
return self.legendPatch.get_window_extent()
+ def get_frame_on(self):
+ """
+ Get whether the legend box patch is drawn
+ """
+ return self._drawFrame
+
+ def set_frame_on(self, b):
+ """
+ Set whether the legend box patch is drawn
+
+ ACCEPTS: [ *True* | *False* ]
+ """
+ self._drawFrame = b
+
def get_bbox_to_anchor(self):
"""
return the bbox that the legend will be anchored
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins