Revision: 7279
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7279&view=rev
Author:   ryanmay
Date:     2009-07-21 17:30:20 +0000 (Tue, 21 Jul 2009)

Log Message:
-----------
Add translucent legend example from John Hunter's mailing list example.

Added Paths:
-----------
    trunk/matplotlib/examples/pylab_examples/legend_translucent.py

Added: trunk/matplotlib/examples/pylab_examples/legend_translucent.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/legend_translucent.py              
                (rev 0)
+++ trunk/matplotlib/examples/pylab_examples/legend_translucent.py      
2009-07-21 17:30:20 UTC (rev 7279)
@@ -0,0 +1,18 @@
+#!/usr/bin/python
+#
+# Show how to add a translucent legend
+
+# import pyplot module
+import matplotlib.pyplot as plt
+
+# draw 2 crossing lines
+plt.plot([0,1], label='going up')
+plt.plot([1,0], label='going down')
+
+# add the legend in the middle of the plot
+leg = plt.legend(fancybox=True, loc='center')
+# set the alpha value of the legend: it will be translucent
+leg.get_frame().set_alpha(0.5)
+
+# show the plot
+plt.show()


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
_______________________________________________
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to