#!/bin/sh

if [ $# -eq  1 ]; then
	A=0
	B=1
	F="$( echo "$1" | sed -E 's/\"//g' )"
elif [ $# -eq 2 ]; then
	A=0
	B="$1"
	F="$( echo "$2" | sed -E 's/\"//g' )"

elif [ $# -eq 3 ]; then
	A="$1"
	B="$2"
	F="$( echo "$3" | sed -E 's/\"//g' )"
else
	echo "Please use 1,2 or 3 arguments for plotting"
	exit
fi

python -c "from numpy import *
import matplotlib.pyplot as plt

def plot(a, b, f):
    x = linspace(a, b, 1000)
    y = eval(f)
    plt.plot(x, y)
    plt.show()

plot($A,$B,\"$F\")"