matplotlibで作成したプロット結果をeps形式でファイルに保存できない
import matplotlib.pylab as plt
x = np.array([8,8**2,8**3,8**4,8**5,8**6])
y = np.array([6.246, 26.0417, 97.0874, 340.909, 1166.67, 3870.97])
plt.plot(x,y)
plt.savefig("test.eps")
上記のコードで、test.pngだと保存してくれるのですが、拡張子をepsに変更すると保存されず、以下のようなエラーが出てしまいます。
<ipython-input-23-eb636dd8cfff> in <module>
4 y = np.array([6.246, 26.0417, 97.0874, 340.909, 1166.67, 3870.97])
5 plt.plot(x,y)
----> 6 plt.savefig("test.eps")
C:\JuliaPkg\conda\3\lib\site-packages\matplotlib\pyplot.py in savefig(*args, **kwargs)
687 def savefig(*args, **kwargs):
688 fig = gcf()
--> 689 res = fig.savefig(*args, **kwargs)
690 fig.canvas.draw_idle() # need this if 'transparent=True' to reset colors
691 return res
C:\JuliaPkg\conda\3\lib\site-packages\matplotlib\figure.py in savefig(self, fname, frameon, transparent, **kwargs)
2092 self.set_frameon(frameon)
2093
-> 2094 self.canvas.print_figure(fname, **kwargs)
2095
2096 if frameon:
C:\JuliaPkg\conda\3\lib\site-packages\matplotlib\backend_bases.py in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, bbox_inches, **kwargs)
2073 orientation=orientation,
2074 bbox_inches_restore=_bbox_inches_restore,
-> 2075 **kwargs)
2076 finally:
2077 if bbox_inches and restore_bbox:
C:\JuliaPkg\conda\3\lib\site-packages\matplotlib\backends\backend_ps.py in print_eps(self, outfile, *args, **kwargs)
919
920 def print_eps(self, outfile, *args, **kwargs):
--> 921 return self._print_ps(outfile, 'eps', *args, **kwargs)
922
923 def _print_ps(self, outfile, format, *args,
C:\JuliaPkg\conda\3\lib\site-packages\matplotlib\backends\backend_ps.py in _print_ps(self, outfile, format, papertype, dpi, facecolor, edgecolor, orientation, *args, **kwargs)
944 self._print_figure_tex(outfile, format, dpi, facecolor, edgecolor,
945 orientation, isLandscape, papertype,
--> 946 **kwargs)
947 else:
948 self._print_figure(outfile, format, dpi, facecolor, edgecolor,
C:\JuliaPkg\conda\3\lib\site-packages\matplotlib\backends\backend_ps.py in _print_figure_tex(self, outfile, format, dpi, facecolor, edgecolor, orientation, isLandscape, papertype, metadata, dryrun, bbox_inches_restore, **kwargs)
1334 or rcParams['text.usetex']):
1335 gs_distill(tmpfile, isEPSF, ptype=papertype, bbox=bbox,
-> 1336 rotated=psfrag_rotated)
1337 elif rcParams['ps.usedistiller'] == 'xpdf':
1338 xpdf_distill(tmpfile, isEPSF, ptype=papertype, bbox=bbox,
C:\JuliaPkg\conda\3\lib\site-packages\matplotlib\backends\backend_ps.py in gs_distill(tmpfile, eps, ptype, bbox, rotated)
1469
1470 gs_exe = ps_backend_helper.gs_exe
-> 1471 if ps_backend_helper.supports_ps2write: # gs version >= 9
1472 device_name = "ps2write"
1473 else:
C:\JuliaPkg\conda\3\lib\site-packages\matplotlib\backends\backend_ps.py in supports_ps2write(self)
92 True if the installed ghostscript supports ps2write device.
93 """
---> 94 return self.gs_version[0] >= 9
95
96 ps_backend_helper = PsBackendHelper()
C:\JuliaPkg\conda\3\lib\site-packages\matplotlib\backends\backend_ps.py in gs_version(self)
76
77 s = subprocess.Popen(
---> 78 [self.gs_exe, "--version"], stdout=subprocess.PIPE)
79 pipe, stderr = s.communicate()
80 ver = pipe.decode('ascii')
C:\JuliaPkg\conda\3\lib\subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors)
707 c2pread, c2pwrite,
708 errread, errwrite,
--> 709 restore_signals, start_new_session)
710 except:
711 # Cleanup if the child failed starting.
C:\JuliaPkg\conda\3\lib\subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_start_new_session)
995 env,
996 os.fspath(cwd) if cwd is not None else None,
--> 997 startupinfo)
998 finally:
999 # Child is launched. Close the parent's copy of those pipe
FileNotFoundError: [WinError 2] 指定されたファイルが見つかりません。
他のサイトで「拡張子を変えればよいだけ」と書いてありましたが、うまくいかず、エラーメッセージの内容がよく解読できないので、お力添え頂きたく質問しました。
よろしくお願いいたします。