1212import scipy
1313from scipy .stats import norm , pearsonr
1414
15- DATA_DIR = os .path .join (".." , "data" )
16- CHART_DIR = os .path .join (".." , "charts" )
15+ from utils import CHART_DIR
1716
1817
1918def _plot_correlation_func (x , y ):
@@ -39,19 +38,19 @@ def plot_correlation_demo():
3938 x = np .arange (0 , 10 , 0.2 )
4039
4140 pylab .subplot (221 )
42- y = 0.5 * x + norm .rvs (1 , loc = 0 , scale = .01 , size = len (x ))
41+ y = 0.5 * x + norm .rvs (1 , scale = .01 , size = len (x ))
4342 _plot_correlation_func (x , y )
4443
4544 pylab .subplot (222 )
46- y = 0.5 * x + norm .rvs (1 , loc = 0 , scale = .1 , size = len (x ))
45+ y = 0.5 * x + norm .rvs (1 , scale = .1 , size = len (x ))
4746 _plot_correlation_func (x , y )
4847
4948 pylab .subplot (223 )
50- y = 0.5 * x + norm .rvs (1 , loc = 0 , scale = 1 , size = len (x ))
49+ y = 0.5 * x + norm .rvs (1 , scale = 1 , size = len (x ))
5150 _plot_correlation_func (x , y )
5251
5352 pylab .subplot (224 )
54- y = norm .rvs (1 , loc = 0 , scale = 10 , size = len (x ))
53+ y = norm .rvs (1 , scale = 10 , size = len (x ))
5554 _plot_correlation_func (x , y )
5655
5756 pylab .autoscale (tight = True )
@@ -66,19 +65,19 @@ def plot_correlation_demo():
6665 x = np .arange (- 5 , 5 , 0.2 )
6766
6867 pylab .subplot (221 )
69- y = 0.5 * x ** 2 + norm .rvs (1 , loc = 0 , scale = .01 , size = len (x ))
68+ y = 0.5 * x ** 2 + norm .rvs (1 , scale = .01 , size = len (x ))
7069 _plot_correlation_func (x , y )
7170
7271 pylab .subplot (222 )
73- y = 0.5 * x ** 2 + norm .rvs (1 , loc = 0 , scale = .1 , size = len (x ))
72+ y = 0.5 * x ** 2 + norm .rvs (1 , scale = .1 , size = len (x ))
7473 _plot_correlation_func (x , y )
7574
7675 pylab .subplot (223 )
77- y = 0.5 * x ** 2 + norm .rvs (1 , loc = 0 , scale = 1 , size = len (x ))
76+ y = 0.5 * x ** 2 + norm .rvs (1 , scale = 1 , size = len (x ))
7877 _plot_correlation_func (x , y )
7978
8079 pylab .subplot (224 )
81- y = 0.5 * x ** 2 + norm .rvs (1 , loc = 0 , scale = 10 , size = len (x ))
80+ y = 0.5 * x ** 2 + norm .rvs (1 , scale = 10 , size = len (x ))
8281 _plot_correlation_func (x , y )
8382
8483 pylab .autoscale (tight = True )
0 commit comments