PageRenderTime 46ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/doc/plots/stats/moment_plots.py

http://github.com/wesm/pandas
Python | 30 lines | 21 code | 9 blank | 0 comment | 2 complexity | 33df5ad42948403b79f0d2ca77282778 MD5 | raw file
Possible License(s): BSD-3-Clause, Apache-2.0
  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3. import pandas.util.testing as t
  4. import pandas.stats.moments as m
  5. def test_series(n=1000):
  6. t.N = n
  7. s = t.makeTimeSeries()
  8. return s
  9. def plot_timeseries(*args, **kwds):
  10. n = len(args)
  11. fig, axes = plt.subplots(n, 1, figsize=kwds.get('size', (10, 5)),
  12. sharex=True)
  13. titles = kwds.get('titles', None)
  14. for k in range(1, n + 1):
  15. ax = axes[k - 1]
  16. ts = args[k - 1]
  17. ax.plot(ts.index, ts.values)
  18. if titles:
  19. ax.set_title(titles[k - 1])
  20. fig.autofmt_xdate()
  21. fig.subplots_adjust(bottom=0.10, top=0.95)