Revision: 7180
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7180&view=rev
Author:   jdh2358
Date:     2009-06-05 16:51:21 +0000 (Fri, 05 Jun 2009)

Log Message:
-----------
added example to fill_between to show how to create multiple axes spans where a 
condition is true

Modified Paths:
--------------
    trunk/matplotlib/examples/pylab_examples/fill_between.py

Modified: trunk/matplotlib/examples/pylab_examples/fill_between.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/fill_between.py    2009-06-05 
16:49:29 UTC (rev 7179)
+++ trunk/matplotlib/examples/pylab_examples/fill_between.py    2009-06-05 
16:51:21 UTC (rev 7180)
@@ -55,10 +55,11 @@
 # use the data coordinates for the x-axis and the axes coordinates for the 
y-axis
 import matplotlib.transforms as mtransforms
 trans = mtransforms.blended_transform_factory(ax.transData, ax.transAxes)
-ax.axhline(0.5, color='green', lw=2, alpha=0.5)
-ax.axhline(-0.5, color='red', lw=2, alpha=0.5)
-ax.fill_between(x, 0, 1, where=y2>0.5, facecolor='green', alpha=0.5, 
transform=trans)
-ax.fill_between(x, 0, 1, where=y2<-0.5, facecolor='red', alpha=0.5, 
transform=trans)
+theta = 0.9
+ax.axhline(theta, color='green', lw=2, alpha=0.5)
+ax.axhline(-theta, color='red', lw=2, alpha=0.5)
+ax.fill_between(x, 0, 1, where=y>theta, facecolor='green', alpha=0.5, 
transform=trans)
+ax.fill_between(x, 0, 1, where=y<-theta, facecolor='red', alpha=0.5, 
transform=trans)
 
 
 


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

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to