Last active
December 14, 2015 02:19
-
-
Save chirag-v/5012851 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/python | |
#Show how to make and save a simple line plot with labels, title and grid | |
#modified from matplotlib official tutorial @ http://www.scipy.org/Plotting_Tutorial | |
#Run directly on iPython shell | |
import numpy | |
import pylab | |
pylab.interactive(True) | |
pylab.show() | |
t = numpy.arange(0.0, 1.0+0.01, 0.01) | |
s = numpy.cos(2*2*numpy.pi*t) | |
pylab.plot(t, s) | |
pylab.xlabel('time (s)') | |
pylab.ylabel('voltage (mV)') | |
pylab.title('About as simple as it gets, folks') | |
pylab.grid(True) | |
pylab.savefig('simple_plot') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment