<i id='94983'><tr id='94983'><dt id='94983'><q id='94983'><span id='94983'><b id='94983'><form id='94983'><ins id='94983'></ins><ul id='94983'></ul><sub id='94983'></sub></form><legend id='94983'></legend><bdo id='94983'><pre id='94983'><center id='94983'></center></pre></bdo></b><th id='94983'></th></span></q></dt></tr></i><div id='94983'><tfoot id='94983'></tfoot><dl id='94983'><fieldset id='94983'></fieldset></dl></div>

    <tfoot id='94983'></tfoot>

      <bdo id='94983'></bdo><ul id='94983'></ul>
    1. <small id='94983'></small><noframes id='94983'>

    2. <legend id='94983'><style id='94983'><dir id='94983'><q id='94983'></q></dir></style></legend>
    3. 带有乳胶的轴刻度标签的无衬线字体

      Sans-serif Font for Axes Tick-labels with Latex(带有乳胶的轴刻度标签的无衬线字体)
      <i id='ChWnd'><tr id='ChWnd'><dt id='ChWnd'><q id='ChWnd'><span id='ChWnd'><b id='ChWnd'><form id='ChWnd'><ins id='ChWnd'></ins><ul id='ChWnd'></ul><sub id='ChWnd'></sub></form><legend id='ChWnd'></legend><bdo id='ChWnd'><pre id='ChWnd'><center id='ChWnd'></center></pre></bdo></b><th id='ChWnd'></th></span></q></dt></tr></i><div id='ChWnd'><tfoot id='ChWnd'></tfoot><dl id='ChWnd'><fieldset id='ChWnd'></fieldset></dl></div>
          <bdo id='ChWnd'></bdo><ul id='ChWnd'></ul>
          <legend id='ChWnd'><style id='ChWnd'><dir id='ChWnd'><q id='ChWnd'></q></dir></style></legend>

              <tbody id='ChWnd'></tbody>

              • <tfoot id='ChWnd'></tfoot>
              • <small id='ChWnd'></small><noframes id='ChWnd'>

                本文介绍了带有乳胶的轴刻度标签的无衬线字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我第一次尝试将 Latex 与 matplotlib 一起使用.似乎在使用 Latex matplotlib 时,轴标签使用了衬线字体.我尝试使用

                I'm trying to use Latex with matplotlib for the first time. It seems that when using Latex matplotlib uses a serif font for the axes labels. I tried explicitly setting the font-family to 'sans-serif' using

                rc('font',family='sans-serif')
                

                但这没有效果,我假设这是因为轴标签位于数学环境中.有没有办法设置rc",以便 matplotlib 为轴标签使用无衬线字体?

                but this had no effect, I'm assuming this is because the axes-labels are inside a math-environment. Is there a way to set the 'rc' so that matplotlib will use a sans-serif font for the axes labels?

                谢谢!

                推荐答案

                在 sfmath 包.要在 matplotlib 中使用这个包,您需要更改它用于编译文本的 LaTeX 前导码,这可以通过 'text.latex.preamble' rc 选项来完成.因此,

                Sans-serif math fonts can be used in LaTeX with the help of the sfmath package. To use this package in matplotlib, you need to alter the LaTeX preamble it uses to compile text, which can be done through the 'text.latex.preamble' rc option. Hence,

                rc('text.latex', preamble='usepackage{sfmath}')
                

                应该做你想做的.您还可以选择另一种字体并将其作为选项提供给包,请参阅 sfmath 的文档 以供参考.

                should do what you want. You can also choose another font and supply it as an option to the package, see sfmath's documentation for reference.

                这篇关于带有乳胶的轴刻度标签的无衬线字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Running .jl file from R or Python(从 R 或 Python 运行 .jl 文件)
                Running Julia .jl file in python(在 python 中运行 Julia .jl 文件)
                Using PIP in a Azure WebApp(在 Azure WebApp 中使用 PIP)
                How to run python3.7 based flask web api on azure(如何在 azure 上运行基于 python3.7 的烧瓶 web api)
                Azure Python Web App Internal Server Error(Azure Python Web 应用程序内部服务器错误)
                Run python dlib library on azure app service(在 azure app 服务上运行 python dlib 库)

                  1. <legend id='i2Ori'><style id='i2Ori'><dir id='i2Ori'><q id='i2Ori'></q></dir></style></legend>
                  2. <small id='i2Ori'></small><noframes id='i2Ori'>

                      <tfoot id='i2Ori'></tfoot>
                        <tbody id='i2Ori'></tbody>
                        <bdo id='i2Ori'></bdo><ul id='i2Ori'></ul>
                      • <i id='i2Ori'><tr id='i2Ori'><dt id='i2Ori'><q id='i2Ori'><span id='i2Ori'><b id='i2Ori'><form id='i2Ori'><ins id='i2Ori'></ins><ul id='i2Ori'></ul><sub id='i2Ori'></sub></form><legend id='i2Ori'></legend><bdo id='i2Ori'><pre id='i2Ori'><center id='i2Ori'></center></pre></bdo></b><th id='i2Ori'></th></span></q></dt></tr></i><div id='i2Ori'><tfoot id='i2Ori'></tfoot><dl id='i2Ori'><fieldset id='i2Ori'></fieldset></dl></div>