Skip to content

Instantly share code, notes, and snippets.

@ibanezmatt13
Created September 27, 2014 20:37
Show Gist options
  • Save ibanezmatt13/80732e22a22d48ca5818 to your computer and use it in GitHub Desktop.
Save ibanezmatt13/80732e22a22d48ca5818 to your computer and use it in GitHub Desktop.
# simple plotter for particles speed distribution example
import matplotlib.pyplot as plt
import numpy as np
fob = open("Boltzmann.txt", "r")
v_freq_string = fob.read()
fob.close()
v_freq = []
v_freq_split = v_freq_string.split(",")
counter = 0
for counter in range(0, len(v_freq_split)-1):
v_freq.append(v_freq_split[counter])
counter += 1
x = np.array(v_freq, dtype='|S4')
y = x.astype(np.float)
print len(y)
plt.plot(np.arange(0,105), v_freq)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment