def function(param):
x = np.linspace(0,param,10)
plt.plot(x,x,label = "some label that includes the parameter like" + r"$A_{param}$"
plt.legend()
plt.show()
def function(param):
x = np.linspace(0, param, 10)
plt.plot(x, x, label="some label that includes the parameter like " + r"$A_{%d}$"%param)
plt.legend()
plt.show()