In [16]:
from MathNet.Numerics.Distributions import Normal

Create a Gaussian distribution with $\mu = 0$ and $\sigma^2 = 4$

In [17]:
normal = Normal(0.0, 4.0)
In [5]:
drawNormal()

Gather some data according to the normal distribution

In [ ]:
data = [normal.Sample() for x in range(1000)]
data

Using Google's Scatter Chart

In [19]:
g = calico.GoogleChart("ScatterChart", data)
calico.display(g)
In [20]:
xydata = [(t, data[t]) for t in range(len(data))]
g = calico.GoogleChart("ScatterChart", ("time", "value"), xydata, {'pointSize': 2})
calico.display(g)
In [21]:
posdata = [(i, sum(data[:i])) for i in range(len(data))]
g = calico.GoogleChart("LineChart", ("time", "value"), posdata, {'title': "Position over time", 'hAxis': {'title': "time"}})
calico.display(g)

Or ColumnChart

In [16]:
g = calico.GoogleChart("ColumnChart", ("time", "value"), xydata, {'hAxis': {'title': "time"}})
calico.display(g)
In [17]:
g = calico.GoogleChart("BarChart", ("time", "value"), xydata, 
                      {'vAxis': {'title': "time"}, 'colors': ['red','#004411'], 'width' : 150, 'height' : 350})
calico.display(g)
In [18]:
g = calico.GoogleChart("LineChart", ("time", "value"), xydata)
calico.display(g)

Use the Google Histogram Chart

In [19]:
h = calico.GoogleChart("Histogram",  data)
calico.display(h)
In [20]:
hdata = [(str(t), data[t]) for t in range(len(data))]
h = calico.GoogleChart("Histogram",  ("time", "value"), hdata)
calico.display(h)
In [4]:
def drawNormal():
    pts = [(x, normal.Density(x)) for x in range(-12, 12)]
    g = calico.GoogleChart("AreaChart", pts, {'title': "Probability Distribution Function"})
    calico.display(g)
In [3]:
data = [("Pie I have eaten", .33), ("Pie I have not yet eaten", .67)]
s = calico.GoogleChart("PieChart", data)
calico.display(s)
In [2]:
calico.display(calico.Image("http://evergreen.loyola.edu/dsheinz/www/figure/pie.png"))
In [ ]: