Created
December 20, 2018 15:22
-
-
Save shihyu/548f23694c634f7df5319e1112387582 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#!encoding=utf-8 | |
import matplotlib.pyplot as plt | |
import numpy as np | |
def f(t): | |
return np.exp(-t) * np.cos(2 * np.pi * t) | |
if __name__ == '__main__' : | |
t1 = np.arange(0, 5, 0.1) | |
t2 = np.arange(0, 5, 0.02) | |
plt.figure(12) | |
plt.subplot(221) | |
plt.plot(t1, f(t1), 'bo', t2, f(t2), 'r--') | |
plt.subplot(222) | |
plt.plot(t2, np.cos(2 * np.pi * t2), 'r--') | |
plt.subplot(212) | |
plt.plot([1, 2, 3, 4], [1, 4, 9, 16]) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment