Skip to content

Instantly share code, notes, and snippets.

@Softwave
Created October 5, 2016 04:06
Show Gist options
  • Save Softwave/ac456f2eed77024fe48705b1a26bae12 to your computer and use it in GitHub Desktop.
Save Softwave/ac456f2eed77024fe48705b1a26bae12 to your computer and use it in GitHub Desktop.
plotting.py
# program that graphs tribble population growth
from pylab import *
import math
def p(t):
return math.e ** (0.2 * t)
xthing = arange(1.0, 72.0, 0.1)
ything = p(xthing)
print(p(72))
plot(xthing, ything)
xlabel('time (hours)')
ylabel('number of tribbles')
title('Tribble population growth')
grid(True)
show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment