matplotlib / matplotlib/mplfinance

missing from current font. FigureCanvasAgg.draw(self)

Open
#677 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Python
Stars
4.4k
Forks
678
PR merge metrics
No merged PRs in 30d

Description

Ask anything you want about mplfinance usage, project philosophy and/or priorities, or anything else related to mplfinance.

```
import mplfinance as mpf
import pandas as pd
import matplotlib.pyplot as plt

# 设置 matplotlib 的默认字体为 SimHei
plt.rcParams['font.family'] = 'SimHei'

# 假设您有以下 DataFrame 形式的数据
df = pd.DataFrame({
'Date': ['2023-01-01', '2023-01-02', '2023-01-03', '2023-01-04', '2023-01-05', '2023-01-06', '2023-01-07'],
'Open': [100, 102, 98, 101, 99, 103, 104],
'High': [101, 104, 100, 102, 101, 105, 106],
'Low': [99, 100, 97, 99, 97, 101, 102],
'Close': [100, 101, 99, 100, 100, 103, 104]
})

# 将日期列转换为 datetime 格式并设置为索引
df['Date'] = pd.to_datetime(df['Date'])
df.set_index('Date', inplace=True)

# 绘制 K 线图
mpf.plot(df, type='candle', figsize=(12, 6), title='K 线图')
```

error:

/Users/roger/Applications/PyCharm Professional Edition.app/Contents/plugins/python/helpers/pycharm_matplotlib_backend/backend_interagg.py:80: UserWarning: Glyph 32447 (\N{CJK UNIFIED IDEOGRAPH-7EBF}) missing from current font.
FigureCanvasAgg.draw(self)
/Users/roger/Applications/PyCharm Professional Edition.app/Contents/plugins/python/helpers/pycharm_matplotlib_backend/backend_interagg.py:80: UserWarning: Glyph 22270 (\N{CJK UNIFIED IDEOGRAPH-56FE}) missing from current font.
FigureCanvasAgg.draw(self)


question:

how can I generate pics with chinese characters with local font settings? (ignore environments)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided Python snippet and inspecting how mplfinance and Matplotlib handle the configured SimHei font. Confirm whether the Chinese title renders without the reported missing-glyph warnings, while treating the PyCharm backend path as environmental context to ignore.

Written by the indexing model from the issue text.

Assessment

Tech stack
matplotlib, python
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.