I have a an equation that i want to use as an argument in my function, the catch is i want to have it within my function without defining any of its variables. The idea is once have it inside my function i can manipulate the vars...sort of like a blank equation. Is this possible or am i being silly?
y = 79.94 + 0.99*var_1 + 0.52*var_2 -1.38*(var_1**2) -1*(var_2**2) + 0.25*var_1*var_2
def ctr_plt(y, x_min= -1, x_max= 1, x_pnts= 25, y_min= -1, y_max= 1, y_pnts= 25, plt1_lvl= 100, plt2_lvl= 5, fig_= 0):
x1 = np.linspace(x_min, x_max, x_pnts)
y1 = np.linspace(y_min, y_max, y_pnts)
var_1, var_2 = np.meshgrid(x1,y1)
fig = plt.figure(figsize=(10,6))
y = fun(var_1,var_2)
plt.subplot(1,2,1)
cntr_plt =plt.contourf(var_1,var_2, y, plt1_lvl, cmap='rainbow')
if fig_ > 0:
plt.subplot(1,2,2)
cntr_plt = plt.contour(var_1,var_2,y,plt2_lvl)#,colors='black', linestyles='dashed')
cntr_plt =plt.contourf(var_1,var_2,y,plt2_lvl, cmap='rainbow')
#plt.colorbar()
plt.clabel(cntr_plt, inline=1, fontsize=12, colors='black')