Is there any way to set the labels of a plot's axis automatically according to the name that the variables have in the code. For example:
import matplotlib.pyplot as plt
import numpy as np
x_variable=np.linspace(1,5)
y_variable=x_variable**2
plt.plot(x_variable,y_variable)
some_function()
is there any way to add some_function() to this code such that the result for this example will be equivalent to:
plt.xlabel('x_variable')
plt.ylabel('y_variable')