Skip to content

Instantly share code, notes, and snippets.

@bhind
Created March 9, 2017 01:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhind/01a82e3cd9a1fe86b9c8ac35f984b9de to your computer and use it in GitHub Desktop.
Save bhind/01a82e3cd9a1fe86b9c8ac35f984b9de to your computer and use it in GitHub Desktop.
for matplot test
# -*- coding:utf-8 -*-
import numpy as np
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
import pylab
np.random.seed(0)
x, y = np.random.randn(2, 100)
fig = plt.figure()
ax1 = fig.add_subplot(211)
ax1.xcorr(x, y, usevlines=True, maxlags=50, normed=True, lw=2)
ax1.grid(True)
ax1.axhline(0, color='black', lw=2)
ax2 = fig.add_subplot(212, sharex=ax1)
ax2.acorr(x, usevlines=True, normed=True, maxlags=50, lw=2)
ax2.grid(True)
ax2.axhline(0, color='black', lw=2)
# plt.show()
# pylab.ion()
pylab.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment