Skip to content

Instantly share code, notes, and snippets.

@aaronpolhamus
Created June 8, 2016 20:55
Show Gist options
  • Save aaronpolhamus/088ed9cba77a9b71d16da44f3c95a9f6 to your computer and use it in GitHub Desktop.
Save aaronpolhamus/088ed9cba77a9b71d16da44f3c95a9f6 to your computer and use it in GitHub Desktop.
run this script interactively to test whether python is connecting to X11 as expected
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
t = np.arange(0.0, 2.0, 0.01)
s = np.sin(2*np.pi*t)
plt.plot(t, s)
plt.xlabel('time (s)')
plt.ylabel('voltage (mV)')
plt.title('About as simple as it gets, folks')
plt.grid(True)
plt.savefig("test.png")
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment