Menu

Commit [r7978]  Maximize  Restore  History

Make invariant density histogram clearer.

fer_perez 2009-11-21

changed /trunk/py4science/examples/logistic/exercise02.py
/trunk/py4science/examples/logistic/exercise02.py Diff Switch to side-by-side view
--- a/trunk/py4science/examples/logistic/exercise02.py
+++ b/trunk/py4science/examples/logistic/exercise02.py
@@ -66,9 +66,8 @@
     return f
 
 
-def invariant_density(mu, x0,cycles=1000000,ret_all=False):
+def invariant_density(mu, x0,cycles=1000000,ret_all=False, bins=500):
     transients = 1000
-    bins = 500
     f = plt.figure()
     ax = f.add_subplot(111)
     logmap = Logistic(mu)
@@ -94,7 +93,7 @@
         return 1./(np.pi * np.sqrt( x*(1.-x)))
 
     # Don't start from 0.5, which is a fixed point!
-    f = invariant_density(1.0,0.567)
+    f = invariant_density(1.0, 0.567, bins=100)
     ax = f.gca()
     # avoid the edges: rho(x) is singular at 0 and 1!
     x0 = np.linspace(0.001, 0.999, 1000)
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.