Closed matrs closed 4 months ago
What version of matplotlib
are you using? Given the signature that you show above which has type annotations, I'm assuming you're using 3.8.0
or later. These recent releases are py.typed
so Pylance should be relying on matplotlib's inline type annotations rather than our bundled matplotlib
stubs. Perhaps you don't have your venv selected within VS Code and that's why Pylance is using the stubs?
I see, i'm not sure, but probably was a problem with which environment was active (I use conda). Good to know that new versions don't rely on stubs. Thanks!
The function
pyplot.imread
complains when a Path object is passed as input:Argument of type "Path" cannot be assigned to parameter "fname" of type "str | FileLike" in function "imread"
pyplot.pyi
plt.imread
does acceptPath
andBinaryIO
objects: