Last active
May 3, 2018 07:40
-
-
Save linnil1/25bff8366d62f719479210b3bedf1dfe 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
import matplotlib.pyplot as plt | |
import numpy as np | |
bound = 2 | |
r = np.linspace(-bound, bound, 20) | |
x, y = np.meshgrid(r, r) | |
vx = x | |
vy = x * (x - 1) * (y + 1) | |
plt.figure(figsize=(10, 8)) | |
Q = plt.quiver(x, y, vx, vy) | |
plt.xlim([-bound, bound]) | |
plt.ylim([-bound, bound]) | |
tx = np.linspace(-bound, bound) | |
txx, tc = np.meshgrid(tx, np.linspace(-5, 1, 10)) | |
ty = np.exp(txx ** 2 / 2 - txx + tc) - 1 | |
plt.plot(txx.T, ty.T) | |
plt.plot(txx.T, -ty.T - 2) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment