algoplot: A script for comparing the growth of functions

Examples

Merge sort (O(n log n)) vs. bubble sort (O(n^2))

algoplot -o merge-vs-bubble.png 'x * log(x)' 'x^2'

merge sort vs. bubble sort plot

Usage

  • Run algoplot -h for specific options
  • Use x instead of n when plotting functions

Installation

You need

  • Gnuplot installed with the gnuplot command available on your $PATH
  • Ruby (only tested with 1.9.3)

Once you have the prerequisites installed, simply run the following command from your terminal:

gem install algoplot

You may need to prefix it with sudo depending on your setup.

Author

Jon-Michael Deldin [email protected]

https://github.com/jmdeldin/algoplot

Feedback and patches are welcome!