2020-08-17 16:16:38 +02:00
|
|
|
#!/bin/sh
|
2020-07-04 14:23:27 +02:00
|
|
|
|
2020-08-17 16:16:38 +02:00
|
|
|
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' )"
|
2020-07-04 14:23:27 +02:00
|
|
|
|
2020-08-17 16:16:38 +02:00
|
|
|
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
|
2020-07-04 14:23:27 +02:00
|
|
|
fi
|
|
|
|
|
2020-08-17 16:16:38 +02:00
|
|
|
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()
|
2020-07-04 14:23:27 +02:00
|
|
|
|
2020-08-17 16:16:38 +02:00
|
|
|
plot($A,$B,\"$F\")"
|