Hi,
I have a pandas dataframe “df” with a few columns, one of which is “a”. That is, we have a column in the dataframe:
df['a']
With some transformations on the variable, we define two new variables
b = f(df['a'])
d = g(df['a'])
Presenting the two variables in the graph
import matplotlib.pyplot as plt
plt.plot(b)
plt.plot(d)
plt.legend()
plt.show()
The legends for both variables are ‘a’, but I expect ‘b’ and ‘d’.
How can I make the legend ‘b’ and ‘d’ instead of ‘a’?