I'm using VSCode with the python extension. The 'problems' tab as well as the indicators on the 'explorer' tab and the red underline in the code view itself all show there to be an error, even though the error isn't real.
After importing matplotlib.pyplot as plt, the code uses plt.cm.RdBu. VSCode is presenting the error that matplotlib.cm has no member RdBu.
There are two issues here:
- Unless I'm just mistaken,
plt.cm.RdBuought to be equivalent tomatplotlib.pyplot.cm.RdBu, notmatplotlib.cm.RdBu. It seems to be interpreting that incorrectly. - But regardless of that, both
cmandpyplot.cmactually do have an attribute calledRdBu, both of which I was able to pull up information for usinghelp(). The code runs perfectly and python throws no errors.
Why is VSCode telling me this is an error when it isn't? Is this just a bug or could it be a misconfiguration?