View on GitHub


Generate svg slopefield

Download this project as a .zip file Download this project as a tar.gz file


This is a python module to draw a slope field for a first-order differential equation in the form y'=f(t,y).

The input is checked against a whitelist and then converted to a python function using eval.

View the app in action.

Installation using heroku

If you would like to host your own version of the slopefield app, you can use the following steps. Heroku allows anybody to host one free app.

Create and set up a Heroku account.

  1. Sign up for a Heroku account.
  2. Install the Heroku Toolbelt.
  3. Using your command shell, run heroku login to login to heroku

For more information, see

Clone the slopefield app

You will need git installed. Run

$ git clone
$ cd slopefield

Create the Heroku app

Choose a name for your app. Mine is called slopefield, but you will have to use a different name. This will be part of the url of the app (e.g.

Now run

$ heroku create slopefield

Finally, push the app to heroku using

$ git push heroku master


Written by Nathan Grigg, with contributions by Clinton Curry.

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.