Python 如何在纸张空间渐变中使用LaTeX字体?

Python 如何在纸张空间渐变中使用LaTeX字体?,python,matplotlib,latex,Python,Matplotlib,Latex,我想在Gradient上的jupyter笔记本中使用LaTeX字体和matplotlib绘图,但我无法像在本地系统上那样创建LaTeX mplstyle文件。我认为问题在于这个云系统上没有安装LaTeX。有没有办法在基于云的平台上安装LaTeX?这是我在尝试将matplotlib的mlpstyle参数更改为使用tex并使用latex字体打印图表时遇到的错误 FileNotFoundError回溯(最近一次调用上次)/opt/conda/envs/fastai/lib/python3.8/sit

我想在Gradient上的jupyter笔记本中使用LaTeX字体和matplotlib绘图,但我无法像在本地系统上那样创建LaTeX mplstyle文件。我认为问题在于这个云系统上没有安装LaTeX。有没有办法在基于云的平台上安装LaTeX?这是我在尝试将matplotlib的mlpstyle参数更改为使用tex并使用latex字体打印图表时遇到的错误


FileNotFoundError回溯(最近一次调用上次)/opt/conda/envs/fastai/lib/python3.8/site-packages/matplotlib/texmanager.py在子流程(self、command、tex)中
274试试:
-->275报告=子流程。检查输出(命令,
276 cwd=self.texcache,
/检查输出中的opt/conda/envs/fastai/lib/python3.8/subprocess.py(超时,*popenargs,**kwargs)
410
-->411返回运行(*popenargs,stdout=PIPE,timeout=timeout,check=True,
412**kwargs)标准件
/运行中的opt/conda/envs/fastai/lib/python3.8/subprocess.py(输入、捕获、输出、超时、检查、*popenargs、**kwargs)
488
-->489带有Popen(*popenargs,**kwargs)作为流程:
490试试:
/opt/conda/envs/fastai/lib/python3.8/subprocess.py in_uuuuinit_uuu(self、args、bufsize、executable、stdin、stdout、stderr、preexec_fn、close_fds、shell、cwd、env、universal_新行、startupinfo、creationflags、restore_u信号、start_unew_u会话、pass_fds、编码、错误、文本)
853
-->854 self.\u execute\u child(args、execute、preexec\u fn、close\u fds、,
环境保护署西湾道855号,
/中的opt/conda/envs/fastai/lib/python3.8/subprocess.py
_execute_child(self、args、execute、preexec_fn、close_fds、pass_fds、cwd、env、startupinfo、creationflags、shell、p2cread、p2cwrite、c2pread、c2pwrite、errread、errwrite、restore_信号、start_new_session)1701 err_msg=os.strerror(errno_num)
->1702引发子项异常类型(errno\u num、err\u msg、err\u filename)1703引发子项异常类型(err\u msg)
FileNotFoundError:[Errno 2]没有这样的文件或目录:“latex”
上述异常是以下异常的直接原因:
中的运行时错误回溯(最近一次调用)
4 plt.ylabel('损失',fontsize=20)
5 plt.图例(fontsize=10)
---->6图256.savefig('what.pdf',dpi=400,bbox_inches='tight')
/savefig(self、fname、transparent、**kwargs)2309补丁中的opt/conda/envs/fastai/lib/python3.8/site-packages/matplotlib/figure.py。设置颜色(“无”)2310
->2311自我。画布。打印图形(fname,**kwargs)2312 2313如果透明:
/打印图形中的opt/conda/envs/fastai/lib/python3.8/site-packages/matplotlib/backend_base.py(self、filename、dpi、facecolor、edgecolor、orientation、format、bbox_英寸、pad_英寸、bbox_额外艺术家、backend、**kwargs)2191 else suppress())2192带ctx:
->2193 self.figure.draw(渲染器)2194 2195 bbox\u inches=self.figure.get\u tightbox(
/绘图包装中的opt/conda/envs/fastai/lib/python3.8/site-packages/matplotlib/artist.py(艺术家、渲染器、*args、**kwargs)
39.start_filter()
40
--->41返回绘制(艺术家、渲染器、*args、**kwargs)
42.最后:
43如果artist.get_agg_filter()不是None:
/绘制中的opt/conda/envs/fastai/lib/python3.8/site-packages/matplotlib/figure.py(self,渲染器)1861 1862 self.patch.draw(渲染器)
->1863 mimage._draw_list_compositing_images(1864渲染器,self,美工,self.suppressComposite)1865
/opt/conda/envs/fastai/lib/python3.8/site-packages/matplotlib/image.py in\u draw\u list\u compositing\u images(渲染器、父级、艺术家、抑制合成)
129如果没有\u复合或没有\u图像:
130对于一个艺术家:
-->131 a.draw(渲染器)
132其他:
133#将任何相邻图像合成在一起
/绘图包装中的opt/conda/envs/fastai/lib/python3.8/site-packages/matplotlib/artist.py(艺术家、渲染器、*args、**kwargs)
39.start_filter()
40
--->41返回绘制(艺术家、渲染器、*args、**kwargs)
42.最后:
43如果artist.get_agg_filter()不是None:
/包装中的opt/conda/envs/fastai/lib/python3.8/site-packages/matplotlib/cbook/deprecation.py(*内部参数,**内部参数)
409其他弃用附录,
410**夸尔格)
-->411返回函数(*内部参数,**内部参数)
412
413返回包装器
/opt/conda/envs/fastai/lib/python3.8/site-packages/matplotlib/axes//u base.py in draw(self、renderer、inframe)2746 renderer.stop_光栅化()2747
->2748模拟图像。\绘制\列表\合成\图像(渲染器、自身、艺术家)2749 2750渲染器。关闭\组(“轴”)
/opt/conda/envs/fastai/lib/python3.8/site-packages/matplotlib/image.py in\u draw\u list\u compositing\u images(渲染器、父级、艺术家、抑制合成)
129如果没有\u复合或没有\u图像:
130美元