当前位置: 首页 > wzjs >正文

网站用图怎么做文件小质量高ios网页游戏

网站用图怎么做文件小质量高,ios网页游戏,望京做网站,万网网站备案一、查看本机matplotlib中支持的字体 运行下列代码即可查看支持的字体 # 查询当前系统所有字体 from matplotlib.font_manager import FontManager# 获取字体名称集合 mpl_fonts sorted(set(f.name for f in FontManager().ttflist))# 设置每行列数 cols 5 font_rows [mpl…

一、查看本机matplotlib中支持的字体

运行下列代码即可查看支持的字体

# 查询当前系统所有字体
from matplotlib.font_manager import FontManager# 获取字体名称集合
mpl_fonts = sorted(set(f.name for f in FontManager().ttflist))# 设置每行列数
cols = 5
font_rows = [mpl_fonts[i:i + cols] for i in range(0, len(mpl_fonts), cols)]print("all font list from matplotlib.font_manager:\n")
for row in font_rows:print("".join(f"{name:<25}" for name in row))  # 每列宽度 25

运行结果参考

all font list from matplotlib.font_manager:AR PL UKai CN            AR PL UMing CN           Abyssinica SIL           Andale Mono              Ani                      
AnjaliOldLipi            Arial                    Arial Black              C059                     Chandas                  
Chilanka                 Comic Sans MS            Courier New              D050000L                 DejaVu Math TeX Gyre     
DejaVu Sans              DejaVu Sans Display      DejaVu Sans Mono         DejaVu Serif             DejaVu Serif Display     
Dhurjati                 Droid Sans Fallback      Dyuthi                   FreeMono                 FreeSans                 
FreeSerif                Gargi                    Garuda                   Gayathri                 Georgia                  
Gidugu                   Gubbi                    Gurajada                 Impact                   Jamrul                   
KacstArt                 KacstBook                KacstDecorative          KacstDigital             KacstFarsi               
KacstLetter              KacstNaskh               KacstOffice              KacstOne                 KacstPen                 
KacstPoster              KacstQurn                KacstScreen              KacstTitle               KacstTitleL              
Kalapi                   Kalimati                 Karumbi                  Keraleeyam               Khmer OS                 
Khmer OS System          Kinnari                  LKLUG                    LakkiReddy               Laksaman                 
Liberation Mono          Liberation Sans          Liberation Sans Narrow   Liberation Serif         Likhan                   
Lohit Assamese           Lohit Bengali            Lohit Devanagari         Lohit Gujarati           Lohit Gurmukhi           
Lohit Kannada            Lohit Malayalam          Lohit Odia               Lohit Tamil              Lohit Tamil Classical    
Lohit Telugu             Loma                     Mallanna                 Mandali                  Manjari                  
Meera                    Mitra                    Mukti                    NATS                     NTR                      
Nakula                   Navilu                   Nimbus Mono PS           Nimbus Roman             Nimbus Sans              
Nimbus Sans Narrow       Norasi                   Noto Mono                Noto Sans CJK JP         Noto Sans Mono           
Noto Serif CJK JP        OpenSymbol               P052                     Padauk                   Padauk Book              
Pagul                    Peddana                  Phetsarath OT            Ponnala                  Pothana2000              
Potti Sreeramulu         Purisa                   Rachana                  RaghuMalayalamSans       Ramabhadra               
Ramaraja                 Rasa                     RaviPrakash              Rekha                    STIXGeneral              
STIXNonUnicode           STIXSizeFiveSym          STIXSizeFourSym          STIXSizeOneSym           STIXSizeThreeSym         
STIXSizeTwoSym           Saab                     Sahadeva                 Samanata                 Samyak Devanagari        
Samyak Gujarati          Samyak Malayalam         Samyak Tamil             Sarai                    Sawasdee                 
SimHei                   SimSun-ExtB              Sree Krushnadevaraya     Standard Symbols PS      Suranna                  
Suravaram                Suruma                   Syamala Ramana           TenaliRamakrishna        Tibetan Machine Uni      
Times New Roman          Timmana                  Tlwg Mono                Tlwg Typewriter          Tlwg Typist              
Tlwg Typo                Trebuchet MS             URW Bookman              URW Gothic               Ubuntu                   
Ubuntu Condensed         Ubuntu Mono              Umpush                   Uroob                    Vemana2000               
Verdana                  Waree                    Webdings                 WenQuanYi Micro Hei      Yrsa                     
Z003                     aakar                    cmb10                    cmex10                   cmmi10                   
cmr10                    cmss10                   cmsy10                   cmtt10                   dsrom10                  
esint10                  eufm10                   mry_KacstQurn            msam10                   msbm10                   
ori1Uni                  padmaa                   padmaa-Bold.1.1          rsfs10                   stmary10                 
wasy10

ps: SimHei 即是中文黑体,我这里面已经安装了,如果没有安装见步骤(二)

二、将SimHei字体拷贝到matplotlib字体路径下

simhei.tff文件可以在Windows中获取,路径如下

C:\Windows\Fonts

在这里插入图片描述

查看matplotlib配置文件路径

import matplotlib as mpl
print(mpl.matplotlib_fname())

输出如下

/home/ryan/.local/lib/python3.10/site-packages/matplotlib/mpl-data/matplotlibrc

将上面拷贝的simhei.tff文件放到下面文件夹中

/home/ryan/.local/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf

在这里插入图片描述
然后再执行一下上面查看支持字体的代码,看看字体是否添加成功。

三、重建字体缓存

删除matplotlib配置文件,将下面路径下的.json文件删除。

~/.cache/matplotlib

然后执行

import matplotlib#重建历史缓存  更新完字体执行一次就可以
matplotlib.font_manager._load_fontmanager(try_read_cache=False)

测试以下中文能否显示

import matplotlib.pyplot as plt
import matplotlib as mplplt.rcParams['font.sans-serif'] = ['SimHei'] #添加“SimHei”(宋体)到字库族列表中
mpl.rcParams['axes.unicode_minus'] = False #解决负号'-'显示为方块的问题# 第一个 Figure
fig1, ax1 = plt.subplots()
ax1.plot([1, 2, 3], [4, 5, 6])
ax1.set_title("第一张图")plt.show()  # 显示所有图

在这里插入图片描述


文章转载自:

http://H4vA3uO8.Lnprp.cn
http://WpJ5m1rc.Lnprp.cn
http://xPfYEcGp.Lnprp.cn
http://0uCN1WWP.Lnprp.cn
http://Ho3R2UI3.Lnprp.cn
http://l3Xf7hAa.Lnprp.cn
http://vJXzEQCg.Lnprp.cn
http://TAJAmMtk.Lnprp.cn
http://tyX1zIcU.Lnprp.cn
http://BLb5Mtaj.Lnprp.cn
http://LbnpzXKL.Lnprp.cn
http://grl74BAA.Lnprp.cn
http://cnna9Q0n.Lnprp.cn
http://ELFKybVJ.Lnprp.cn
http://VsSpRRAP.Lnprp.cn
http://i78uvSnB.Lnprp.cn
http://CrC2WlNx.Lnprp.cn
http://Njc8Jd5C.Lnprp.cn
http://QDl6jhV6.Lnprp.cn
http://9MIZXtsi.Lnprp.cn
http://jSjbGiNp.Lnprp.cn
http://txxEe0ng.Lnprp.cn
http://oBVrNGca.Lnprp.cn
http://6gXancCs.Lnprp.cn
http://x6V3oWEn.Lnprp.cn
http://ZYnO2SoL.Lnprp.cn
http://hNEhYuIk.Lnprp.cn
http://Aen9ArGe.Lnprp.cn
http://TuebsfNp.Lnprp.cn
http://jLJfvDUz.Lnprp.cn
http://www.dtcms.com/wzjs/729572.html

相关文章:

  • 还有河北城乡和住房建设厅网站吗群晖打开wordpress4.9.8
  • 做儿童业态招商要去哪些网站互联网广告行业前景
  • 黄埔做网站长春网络推广公司哪个好
  • 网站建设推广服务合同开做网站的公司 条件
  • 西安网站注册网络公司网络推广服务
  • 网站建设标新立异seo的搜索排名影响因素有哪些
  • 外包网站建设公司手机 网站 源码
  • 做景区网站建设的公司长三角旅游推广联盟
  • 创建众筹网站伴奏网站防盗是怎么做的
  • 工业部网站备案河南网站制作
  • 创新的微商城网站建设浙江省建设厅网站高工
  • 杭州建设网站公司wordpress怎么加404
  • 扬州市住房和建设局网站中山专业做网站
  • 域名怎么创建网站吗本地岑溪网站开发
  • 网站 功能呢design工业设计
  • 雄安智能网站建设网站规划与设计课程设计
  • 大连制作网站omv wordpress
  • html网站源码wordpress更改登录地址
  • 4500急招一位接送小孩阿姨附近网站建设优化加盟代理
  • 摄影网站源码 国外做网站设计的有些什么职位
  • 肇庆网站关键词优化wordpress自定义表格
  • 网站的作用网站开发网站排名优化
  • 建设部施工安全管理网站自己做的网站搜索引擎搜不到
  • 音乐网站建设策划书wordpress获取最新发布列表
  • 网站质作wordpress登入页面
  • 企业商务网站设计与开发站长是什么级别
  • 成品网站是什么意思个人网站的版权怎么写
  • 网站使用支付接口如何收费网站开发属于购销合同
  • 网站开发的层次黄骅网站建设公司
  • 化妆品企业网站源码视觉做的比较好的国外网站