Skip to content

Commit 33f274e

Browse files
committed
work
1 parent 3196327 commit 33f274e

8 files changed

Lines changed: 890 additions & 485 deletions

File tree

dblib/mssql.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55

66

77
class Conn(object):
8-
'''connection to database. Loaded into the self.conn
9-
initiate with the with statement.
10-
A path can be passed in and it will call sqlite_connection_string
11-
to correctly format the connection string.
8+
'''Connection to an SQL Server database.
129
13-
Pass the cnstr in when the class is initialised or call open.
10+
Args:
11+
dbname:database name
12+
server:server name, ip etc
13+
security: integrated for NT security, or any other string for SQL Server security
14+
user,pw: Authentication of NOT using NT (integrated) security
1415
15-
e.g.
16-
import mssql
16+
Example:
1717
with mssql.Conn('mydb') as conn:
1818
#do database work
1919
'''

jupyter/Untitled.ipynb

Lines changed: 0 additions & 176 deletions
This file was deleted.

jupyter/Untitled1.ipynb

Lines changed: 0 additions & 172 deletions
This file was deleted.

jupyter/model_rotation_error.ipynb

Lines changed: 18 additions & 58 deletions
Large diffs are not rendered by default.

jupyter/mv_graph_model.ipynb

Lines changed: 455 additions & 0 deletions
Large diffs are not rendered by default.

jupyter/mv_sklearn_forest_outliers.ipynb

Lines changed: 389 additions & 69 deletions
Large diffs are not rendered by default.

plotlib/plotlib.pyproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
<ItemGroup>
2424
<Compile Include="matplotlib-2d.py" />
2525
<Compile Include="matplotlib-3d.py" />
26+
<Compile Include="mplfuncs.py">
27+
<SubType>Code</SubType>
28+
</Compile>
2629
<Compile Include="qplot.py">
2730
<SubType>Code</SubType>
2831
</Compile>

plotlib/qplot.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,25 @@
55
import matplotlib.mlab as _mlab
66
import numpy as _np
77
import funclib.baselib as _baselib
8+
from plotlib.mplfuncs import FigWidthsInch as sizes
89
#import scipy.stats as _stats
910
#import math as _math
1011

12+
SIZE = (sizes.two_col.value, sizes.two_col.value)
1113

12-
def histo(data, bins='auto', normed=True, show=True):
14+
15+
def histo(data, bins='auto', normed=True, show=True, figsize=None):
1316
'''(list|ndarray, str|int, bool
1417
Plot a histogram
1518
'''
1619

1720
D = _np.array(data).flatten()
21+
22+
global SIZE
23+
if figsize:
24+
SIZE = figsize
25+
26+
Plot.figure(figsize=SIZE)
1827
dummy, bins, dummy1 = Plot.hist(D, bins=bins, normed=normed)
1928

2029
if normed:
@@ -27,7 +36,7 @@ def histo(data, bins='auto', normed=True, show=True):
2736
Plot.show()
2837

2938

30-
def scatter(x_data, y_data, data_labels=(), group_labels=(), ptsizes=4, data_label_font_sz=8, xlim=None, ylim=None, show=True):
39+
def scatter(x_data, y_data, data_labels=(), group_labels=(), ptsizes=4, data_label_font_sz=8, xlim=None, ylim=None, show=True, figsize=None):
3140
'''(list|tuple|ndarray, list|tuple|ndarray|None,
3241
list|tuple|ndarray, list|tuple|ndarray,
3342
2-tuple|None, 2-tuple|None, bool) - void
@@ -62,6 +71,8 @@ def scatter(x_data, y_data, data_labels=(), group_labels=(), ptsizes=4, data_lab
6271
2-Tuple, lower and upper limits of y, or None
6372
show:
6473
show the plot
74+
figsize:
75+
2-tuple (w,h) in inches, defaults to qplot.SIZE if None, also set global value
6576
6677
Example:
6778
>>>x_data=[[-1,-2,-3],[3,4,5]]
@@ -121,7 +132,11 @@ def scatter(x_data, y_data, data_labels=(), group_labels=(), ptsizes=4, data_lab
121132
else:
122133
ndY = _np.asarray(y_data[ind]).flatten()
123134

124-
Plot.figure()
135+
global SIZE
136+
if figsize:
137+
SIZE = figsize
138+
139+
Plot.figure(figsize=SIZE)
125140
Plot.scatter(ndX, ndY, s=ptsizes)
126141

127142
axes = Plot.gca()

0 commit comments

Comments
 (0)