{{{#!python from scipy import empty,mgrid,exp,arange from pylab import figure,clf,subplot,imshow,title,gray,plot,show,savefig from string import * def gaussian(center, width): """Returns a gaussian function""" center_y,center_x=float(center[0]),float(center[1]) width_y,width_x=float(width[0]),float(width[1]) return lambda y,x: exp(-(((center_y-y)/width_y)**2+((center_x-x)/width_x)**2)/2) Y,X=200,200 RGB=empty((Y,X,3),float) D,J,K={ 'R':(0,0,0), 'G':(200,100,1), 'B':(0,200,2) },{},{} x1,y1=arange(X),100 x2,y2=100,arange(Y) figure(1) for color in D.keys(): J[color] = gaussian(D[color][0:2], (100,100)) (y1,x1) RGB[:,:,D[color][2]]=J[color] plotcol=lower(color) plot(x1,J[color],plotcol) title('Schnitte durch y=100') figure(2) for color in D.keys(): K[color] = gaussian(D[color][0:2], (100,100)) (y2,x2) RGB[:,:,D[color][2]]=K[color] plotcol=lower(color) plot(y2,K[color],plotcol) title('Schnitte durch x=100') show() }}} [[attachment:x_Schnitt.png]] [[attachment:y_Schnitt.png]]