In [1]:
__author__ = '__fbb__'
#github @fedhere
#fedhere@gmail.com
#test for sparkleme module https://github.com/fedhere/sparklpy/
#makes some fake data and plots it as sparkle lines

In [2]:
from __future__ import print_function
import numpy as np
from scipy import stats
import matplotlib.pyplot as pl
import sparkleme 

%pylab inline


Populating the interactive namespace from numpy and matplotlib

spark lines a la Tufte, first with synthetic data


In [3]:
#generating data: noisy random sine waves
data = np.ones((100,10))
data = np.random.randn(10,100) + \
    np.cos( (data / (np.pi*10*np.random.rand(10))).T * np.arange(100))

In [4]:
fig = pl.figure(figsize = (10,20))
#remember to catch the output or the plot will be displayed twice!
fig = sparkleme.sparklme(data, figure=fig)


10
Axes(0.125,0.789286;0.243571x0.110714)
/usr/local/Library/anaconda/lib/python2.7/site-packages/matplotlib/__init__.py:855: UserWarning: svg.embed_char_paths is deprecated and replaced with svg.fonttype; please use the latter.
  warnings.warn(self.msg_depr % (key, alt_key))

In [ ]: