मैं LaTeX के लिए एक PGF फ़ाइल बनाने के लिए matplotlib इस्तेमाल करने की कोशिश:matplotlib PGF: OSError: ऐसी कोई फ़ाइल या subprocess.py में निर्देशिका
from matplotlib.pyplot import subplots
from numpy import linspace
x = linspace(0, 100, 30)
fig, ax = subplots(figsize = (10, 6))
ax.scatter(x, x)
fig.tight_layout()
fig.savefig('/home/mark/dicp/python/figure.pgf')
लेकिन मैं OSError: [Errno 2] No such file or directory
मिलती है:
Traceback (most recent call last):
File "visualize/latex_figs.py", line 32, in <module>
fig.savefig('/home/mark/dicp/python/figure.pgf')
File "/usr/local/lib/python2.7/dist-packages/matplotlib/figure.py", line 1421, in savefig
self.canvas.print_figure(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backend_bases.py", line 2220, in print_figure
**kwargs)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backend_bases.py", line 1957, in print_pgf
return pgf.print_pgf(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_pgf.py", line 818, in print_pgf
self._print_pgf_to_fh(fh, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_pgf.py", line 797, in _print_pgf_to_fh
RendererPgf(self.figure, fh),
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_pgf.py", line 409, in __init__
self.latexManager = LatexManagerFactory.get_latex_manager()
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_pgf.py", line 223, in get_latex_manager
new_inst = LatexManager()
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_pgf.py", line 305, in __init__
cwd=self.tmpdir)
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
यह भी आउटपुट फ़ाइल के इस भाग को उत्पन्न करता है:
%% [whole bunch of comments]
\begingroup%
\makeatletter%
\begin{pgfpicture}%
\pgfpathrectangle{\pgfpointorigin}{\pgfqpoint{10.000000in}{6.000000in}}%
\pgfusepath{use as bounding box}%
मैं क्या समझ में नहीं आता OSError: No such file or directory
subprocesses.py में कुछ भी करना है ... जिस फ़ाइल को मैं सहेजने की कोशिश कर रहा हूं वह लिखने योग्य है। क्या मैं कुछ गलत समझ रहा हूं, या क्या यह एक बग है जिसे मुझे रिपोर्ट करनी चाहिए?
मैं पहले के साथ गया और यह बेकार ढंग से काम किया, धन्यवाद! – Mark
धन्यवाद! बहुत बहुत धन्यवाद। मुझे अभी भी matplotlib ('1.4.3') के नवीनतम संस्करण के साथ यह समस्या थी – coyotte508