I did this plot and it worked. The day after I ran it and I got this error:
TypeError: 'str' object is not callable.
plt.plot(A2, A15, color="black", label="TRC - P1", marker="o")
plt.xlabel("Amostras")
plt.ylabel("TRC (%)")
plt.title("TRC da P1")
plt.yticks([0, 10, 20, 30, 40, 50, 60, 70])
plt.xticks(rotation=60)
Following the error I have got

I would guess that you defined somewhere in your notebook something like plt.xlabel = "something". This could also happened before you run this code shown. Try to close the Notebook and restart your Kernel. After restarting run your code shown and everything should be fine.
If using jupyter notebook then click on Run tab and select restart kernel and run all cells

Guess you may have somewhere in the code used plt.xlabel = "Some Label" this will actually change the import of matplotlib.pyplot.
All we have to do here is simply reload the libraries by typing the following lines of code to fix the error without closing/restarting the notebook:
import matplotlib.pyplot as plt
from importlib import reload
plt=reload(plt)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With