Skip to content

mattjj/py-manipulate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

A simple attempt at making a function like Mathematica's manipulate in Python to allow easy instantiation of GUI widgets for tweaking parameters and updating plots.

Tested with Python 2.7.2, Matplotlib 1.0.1

Demo

Say we define a function like sinc:

def sinc(x,A,f,z):
    return A*np.sin(2*np.pi*f*x)/(x**z)

We can then plot the function using the mplot function in manipulate:

from manipulate import mplot
mplot(sinc,np.arange(0.01,1,0.01),A=(1,2),f=(1,5),z=(0,1))
plt.xlabel('x')
plt.title(u'A sin(2πf x)/x^z')

python manipulate

We can use the GUI sliders to see how parameter adjustments affect the function:

python manipulate

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages