Strange error with matplotlib axes labels

I had this same issue when working in iPython notebook.

I think it can be re-created as follows:

import matplotlib.pyplot as plt
plt.ylabel="somestring" # oh wait this isn't the right syntax.
... 
plt.ylabel('somestring') # now this breaks because the function has been turned into a string

Re-starting the kernel or re-importing the libraries restores plt.ylabel to a function.

Leave a Comment