前提・実現したいこと
pythonにて,matplotlibを使ってepsファイルを出力したいです.
EPSファイルは出力できているのですが,
TEXにて画像表示を行うと真っ白で表示されません.
また,EPS出力時にエラーをはいています.
エラーを出さず,TEXに表示されるようにしたいです.
発生している問題・エラーメッセージ
The PostScript backend does not support transparency; partially transparent artists will be rendered opaque. The PostScript backend does not support transparency; partially transparent artists will be rendered opaque. The PostScript backend does not support transparency; partially transparent artists will be rendered opaque. The PostScript backend does not support transparency; partially transparent artists will be rendered opaque. The PostScript backend does not currently support the selected font.
RuntimeError Traceback (most recent call last) <ipython-input-52-9309a6af578d> in <module> ---> 32 plt.savefig("./AAA.png",dpi=400,bbox_inches="tight") python\python37\lib\site-packages\matplotlib\pyplot.py in savefig(*args, **kwargs) 720 def savefig(*args, **kwargs): 721 fig = gcf() --> 722 res = fig.savefig(*args, **kwargs) 723 fig.canvas.draw_idle() # need this if 'transparent=True' to reset colors 724 return res python\python37\lib\site-packages\matplotlib\figure.py in savefig(self, fname, transparent, **kwargs) 2178 self.patch.set_visible(frameon) 2179 -> 2180 self.canvas.print_figure(fname, **kwargs) 2181 2182 if frameon: python\python37\lib\site-packages\matplotlib\backend_bases.py in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, bbox_inches, **kwargs) 2080 orientation=orientation, 2081 bbox_inches_restore=_bbox_inches_restore, -> 2082 **kwargs) 2083 finally: 2084 if bbox_inches and restore_bbox: python\python37\lib\site-packages\matplotlib\backends\backend_ps.py in print_eps(self, outfile, *args, **kwargs) 840 841 def print_eps(self, outfile, *args, **kwargs): --> 842 return self._print_ps(outfile, 'eps', *args, **kwargs) 843 844 def _print_ps(self, outfile, format, *args, python\python37\lib\site-packages\matplotlib\backends\backend_ps.py in _print_ps(self, outfile, format, papertype, dpi, facecolor, edgecolor, orientation, *args, **kwargs) 869 self._print_figure(outfile, format, dpi, facecolor, edgecolor, 870 orientation, isLandscape, papertype, --> 871 **kwargs) 872 873 def _print_figure( python\python37\lib\site-packages\matplotlib\backends\backend_ps.py in _print_figure(self, outfile, format, dpi, facecolor, edgecolor, orientation, isLandscape, papertype, metadata, dryrun, bbox_inches_restore, **kwargs) 1105 else: 1106 with open(outfile, 'w', encoding='latin-1') as fh: -> 1107 print_figure_impl(fh) 1108 1109 def _print_figure_tex( python\python37\lib\site-packages\matplotlib\backends\backend_ps.py in print_figure_impl(fh) 1044 try: 1045 convert_ttf_to_ps(os.fsencode(font_filename), -> 1046 fh, fonttype, glyph_ids) 1047 except RuntimeError: 1048 _log.warning("The PostScript backend does not " RuntimeError: TrueType font is missing table
該当のソースコード
fig,axes = plt.subplots(1,2, sharex="all", sharey="all") colorlist = ["g","m","g","m"] markers=["o","v","o","v"] labels=["1","2","1","2"] line=["solid","dashed"] tmp=["","","",""] j = 0 for data in zip(mean_datas_N,std_datas_N,min_datas_N,max_datas_N): tmp[j] = axes[1].plot([1,2,3,4],data[0],color=colorlist[j],label=labels[j],marker=markers[j],linestyle = line[j]) j = j+1 tmp[2] = axes[0].plot([1,2,3,4],[0.8,0.8,0.8,0.8],color=colorlist[2],label=labels[2],marker=markers[2],linestyle=line[0]) tmp[3] = axes[0].plot([1,2,3,4],mean_datas_AA2,color=colorlist[3],label=labels[3],marker=markers[3],linestyle=line[1]) axes[0].set_xlabel(u"k", fontname="MS Gothic")##x軸の目盛指定 axes[1].set_xlabel(u"k", fontname="MS Gothic")##x軸の目盛指定 axes[0].set_ylabel(u"a", fontname="MS Gothic")##y軸の目盛指定 axes[0].set_title(u"A", fontname="MS Gothic") axes[1].set_title(u"N", fontname="MS Gothic") ticks = axes[0].set_xticks([1,2,3,4]) plt.ylim(0.7,1.0) l=axes[0].set_xticklabels([1,3,5,10])#x軸の目盛の表記指定,rotation傾 plt.subplots_adjust(wspace=0.05,right=0.85) axes[0].legend(loc="upper left", prop={"family":"MS Gothic","size":"14"})#,title=u"加工") plt.savefig("./AAA.eps",dpi=400,bbox_inches="tight")
試したこと
plt.savefig("./AAA.png",dpi=400,bbox_inches="tight")
見たく,PNG形式にすれば出力できました.
plt.savefig("./AAA.eps")
にしてもエラーがでます.
補足情報(FW/ツールのバージョンなど)
Jupyterを使って実行しています.

回答1件
あなたの回答
tips
プレビュー