Skip to content

Instantly share code, notes, and snippets.

@StuartGordonReid
Created June 15, 2015 14:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save StuartGordonReid/0c634b20a68e3a0bf138 to your computer and use it in GitHub Desktop.
Save StuartGordonReid/0c634b20a68e3a0bf138 to your computer and use it in GitHub Desktop.
Stochastic Processes Grapher -
def plot_stochastic_processes(processes, title):
"""
This method plots a list of stochastic processes with a specified title
:return: plots the graph of the two
"""
plt.style.use(['bmh'])
fig, ax = plt.subplots(1)
fig.suptitle(title, fontsize=16)
ax.set_xlabel('Time, t')
ax.set_ylabel('Simulated Asset Price')
x_axis = numpy.arange(0, len(processes[0]), 1)
for i in range(len(processes)):
plt.plot(x_axis, processes[i])
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment