In [1]:
from lightning import Lightning
host='http://localhost:3000'
lgn = Lightning(ipython=True, host=host)
In [2]:
from numpy import random, ceil, vstack
from scipy.ndimage.filters import gaussian_filter
In [3]:
x = random.randn(50)
y = random.randn(50)
l = ceil(random.rand(50)*5)
lgn.scatter(x,y, label=l)
Out[3]:
In [4]:
ts = gaussian_filter(random.randn(5,50), [0, 2])
lgn.line(ts)
Out[4]:
In [5]:
x = random.randn(50)
y = random.randn(50)
ts = random.randn(5,50)
l = ceil(random.rand(50)*5)
lgn.scatterline(x,y,ts,label=l)
Out[5]:
In [107]:
mat = random.rand(50,50)
mat[mat<0.975] = 0
l = ceil(random.rand(50) * 5)
lgn.force(mat, label=l)
Out[107]:
In [32]:
x = random.randn(50)
y = random.randn(50)
mat = random.rand(50,50)
mat[mat<0.9] = 0
l = ceil(random.rand(50) * 5)
lgn.graph(x, y, mat, label=l)
Out[32]:
In [31]:
x = random.randn(50)
y = random.randn(50)
mat = random.rand(50,50)
mat[mat<0.9] = 0
l = ceil(random.rand(50) * 5)
lgn.graphbundled(x, y, mat, label=l)
Out[31]:
In [125]:
mat = random.rand(20,20)
lgn.matrix(mat, colormap="Purples")
Out[125]:
In [47]:
mat = random.rand(20,20)
mat[mat<0.75] = 0
l = ceil(random.rand(20) * 5)
lgn.adjacency(mat, label=l)
Out[47]:
In [101]:
im = gaussian_filter(random.rand(256,512, 3)*3, [5, 5, 0])
lgn.image(im)
Out[101]:
In [127]:
im1 = gaussian_filter(random.rand(256,512, 3)*3, [5, 5, 0])
im2 = gaussian_filter(random.rand(256,512, 3)*3, [5, 5, 0])
im3 = gaussian_filter(random.rand(256,512, 3)*3, [5, 5, 0])
lgn.gallery([im1, im2, im3])
Out[127]:
In [7]:
regions = ["NA", "AK", "AL", "AR", "AZ", "CA", "CO","CT","DC","DE","FL","GA","HI","IA","ID"]
weights = random.randn(len(regions))
lgn.map(regions, weights, colormap="Purples")
Out[7]: