Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lectures/matplotlib.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ def draw_graphs(style='default'):

# 设置样式表
plt.style.use(style)
plt.rcParams['font.family'] = ['Source Han Serif SC', 'DejaVu Sans'] # i18n:样式表会重置 font.family,须在 style.use 之后重新应用

fig, axes = plt.subplots(nrows=1, ncols=4, figsize=(10, 3))
x = np.linspace(-13, 13, 150)
Expand Down
2 changes: 1 addition & 1 deletion lectures/pandas_panel.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ FONTPATH = "_fonts/SourceHanSerifSC-SemiBold.otf" # i18n
mpl.font_manager.fontManager.addfont(FONTPATH) # i18n
mpl.rcParams['font.family'] = ['Source Han Serif SC'] # i18n
import seaborn as sns
sns.set_theme()
sns.set_theme(rc={'font.family': ['Source Han Serif SC', 'DejaVu Sans']}) # i18n:set_theme 会重置字体,用 rc 覆盖保留中文字体
```

## 概述
Expand Down
Loading