Created
March 7, 2017 08:13
-
-
Save louiskirsch/457784bb9a3bd9013274a08006f50be4 to your computer and use it in GitHub Desktop.
Matplotlib live plot
This file contains hidden or 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 | |
import time | |
plt.rcParams['toolbar'] = 'None' | |
fig = plt.figure() | |
ax = fig.add_subplot(1, 1, 1) | |
def draw(): | |
ax.clear() | |
x, y = np.random.rand(2, 50) | |
ax.scatter(x, y) | |
plt.pause(0.001) | |
while True: | |
draw() | |
time.sleep(0.5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment