I am getting the following error while drawing butterfly curve:
Pyplot error "only size-1 arrays can be converted to Python scalars"
And following is the code:
import numpy as np
import matplotlib.pyplot as plt
import math
t = np.arange(0.,10,0.1)
x = math.sin(t)*(math.exp(math.cos(t)) - 2*math.cos(4*t) - math.sin(t/12)**5)
a = np.vectorize(x)
y = math.cos(t)*(math.exp(math.cos(t)) - 2*math.cos(4*t) - math.sin(t/12)**5)
b = np.vectorize(y)
plt.plot(a,b,color='red')
plt.show()