File: moment_plots.py

package info (click to toggle)
pandas 0.14.1-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 54,924 kB
  • ctags: 53,113
  • sloc: python: 130,524; ansic: 11,510; sh: 329; makefile: 118
file content (30 lines) | stat: -rw-r--r-- 653 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import numpy as np

import matplotlib.pyplot as plt
import pandas.util.testing as t
import pandas.stats.moments as m


def test_series(n=1000):
    t.N = n
    s = t.makeTimeSeries()
    return s


def plot_timeseries(*args, **kwds):
    n = len(args)

    fig, axes = plt.subplots(n, 1, figsize=kwds.get('size', (10, 5)),
                             sharex=True)
    titles = kwds.get('titles', None)

    for k in range(1, n + 1):
        ax = axes[k - 1]
        ts = args[k - 1]
        ax.plot(ts.index, ts.values)

        if titles:
            ax.set_title(titles[k - 1])

    fig.autofmt_xdate()
    fig.subplots_adjust(bottom=0.10, top=0.95)