字体中的【family】【serif】【sans-serif】

字体中的【family】【serif】【sans-serif】

Matplotlib 中, font.familyfont.seriffont.sans-serif 是控制字体显示的三个核心参数

在matplotlib库中, 通常有关于familyserifsans-serif的字体设置, 以下是它们的一些区别与联系

font-family

决定我们用那种风格的字体, 为指定绘图时默认使用的字体类别, 例如宋体, 楷体, Times New Roman

该值可设置为特定的名称(Times New RomanArialSimSun), 也可设置为通用字体族名(sans-serifserif)

常用值有:

  1. 'serif':衬线体. 笔画末端有装饰(如 Times New Roman, 宋体), 适合正式文档、论文;
  2. 'sans-serif':无衬线体. 笔画末端平整(如 Arial, Helvetica, 黑体), 适合屏幕显示、PPT;
  3. 'monospace':等宽字体. 每个字符宽度相同(如 Courier New), 适合代码展示;
  4. 'cursive' / 'fantasy':手写体或艺术体(较少用).

📜 font.serif (衬线体候选列表)

衬线字体的特点是字母末端有一些额外的细节, 在字符的主要笔画的末尾,有称为衬线的小粗笔
  1. 作用:定义当 font.family 设为 'serif' 时, 具体尝试哪些字体;
  2. 格式:一个列表 '字体A', '字体B', '字体C', ....

🚫 font.sans-serif (无衬线体候选列表)

同上

列表对比

参考链接

CSS Fonts(字体) | 菜鸟教程

HTML 字体 -- CSS 字体系列示例(Serif 和 Sans Serif 字符) | w3cschool笔记

font.sans-serif 和 font.family-CSDN博客

(17 封私信 / 80 条消息) Serif Font 与 Sans-serif Font 的差异详解及实际应用 - 知乎

相关推荐
你想知道什么?7 天前
Matplotlib学习笔记
笔记·学习·matplotlib
风流 少年11 天前
数据可视化:matplotlib、pyecharts、panda、seaborn
数据挖掘·数据分析·matplotlib
fai厅的秃头姐!11 天前
Matplotlib
matplotlib
许彰午14 天前
78_Python数据可视化matplotlib
python·信息可视化·matplotlib
尘中远16 天前
【Qwt 7.0 系列】总体架构解析 —— 从单体到三库模块化的演进
qt·matplotlib·绘图·qwt·科学绘图
2501_9423895517 天前
AI才女”罗福莉加盟小米
matplotlib·sublime text·广度优先·gunicorn
留白_1 个月前
Matplotlib绘图
信息可视化·数据分析·matplotlib
MATLAB代码顾问1 个月前
Python Matplotlib数据可视化实战指南
python·信息可视化·matplotlib
星辰徐哥1 个月前
Python AI基础:Matplotlib与Seaborn数据可视化
人工智能·python·matplotlib
斐夷所非1 个月前
Python Matplotlib | 基础绘图、复杂函数图与三维图
matplotlib