# 绘制文字-中文

matplotlib绘制中文有乱码，需要手动设置文字，font.sans-serif='SimHei'设置为黑体。（需要电脑上有此类且支持中文的字体库，一般Windows系统没事，Linux需要手动下载并添加进系统字体库文件夹内）

```python
p=[10,20]
plt.text(p[0], p[1], text, fontsize=10)
plt.rcParams['font.sans-serif'] = ['SimHei']  # 用来正常显示中文标签
plt.rcParams['axes.unicode_minus'] = False  # 用来正常显示负号
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://im-qianuxn.gitbook.io/pytorch/ji-suan-ji/numpy-pandas-matplotlib/matplotlib/draw-zh.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
