#!/usr/bin/env python print "Hello World!" """ This is a multi-line python comment. With import you can make available the things from certain libraries. http://www.numpy.org/ http://matplotlib.org/ To plot a function, you can do the following: """ import matplotlib.pyplot as plt import numpy as np import matplotlib.mlab as mlab #create an array with 100 points between -5 and 5 x = np.linspace(-5,5,100) #create a function with linear interpolation between the points. plt.plot(x,mlab.normpdf(x,0,1)) #The following command displays the figure, but stops the script from continuation. print "For continuation, please close the plot." plt.show() """ To get a random number from a Gaussian pdf you can use the following, with the first argument being the mean, and the second argument being the sigma of a Gaussian: """ for i in range(10): print i print np.random.normal(0, 1) """ Instead of filling a histogram, create an array of values first. Keep in mind, that in python, instead of brackets, indention is used. """ from pylab import * X = np.arange(10) Y = [5, 7, 3, 3, 6, 1,2,3,4,5] #you can prepare more than one function for the same plot. plt.plot(x,10*mlab.normpdf(x,0,1)) plt.bar(X, Y) #and set some stuff for the plot: ylim(0,+10) xlim(-10, 10) xlabel('XLabel') ylabel('YLabel') #save the plot savefig('simple_plot') #and/or show it show() """ If you aren't familiar with python, but would like to get, here is a general language tutorial: http://docs.python.org/2/tutorial/ """