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'
Usage
- Run
algoplot -h
for specific options - Use
x
instead ofn
when plotting functions
Installation
You need
-
Gnuplot installed with the
gnuplot
command available on your$PATH
. Ensure you havegnuplot-x11
installed for Debian/Ubuntu in order to plot non-ASCII graphics. - 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 dev@jmdeldin.com
https://github.com/jmdeldin/algoplot
Feedback and patches are welcome!