While running the following code:
import matplotlib.pyplot as plt
plt.rcParams['text.usetex'] = True
plt.plot(range(10))
plt.savefig("plot.pdf")
I get the very long error, finally saying FileNotFoundError: [Errno 2] No such file or directory: ''
. The code was working fine some time ago. However, when using the backend="pgf"
backend, the figure is saved as desired. What is the reason for this?
I cleared matplotlib
config and cache before.
>>>!python -V
Python 3.9.10
>>>print(matplotlib.__version__)
3.5.1