https://github.com/shenxiangzhuang/zhplot
一行代码搞定 Python 图表中文展示
https://github.com/shenxiangzhuang/zhplot
chinese data-visualization matplotlib plot python python3 wordcloud
Last synced: 6 months ago
JSON representation
一行代码搞定 Python 图表中文展示
- Host: GitHub
- URL: https://github.com/shenxiangzhuang/zhplot
- Owner: shenxiangzhuang
- License: mit
- Created: 2024-11-29T04:50:09.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2025-04-08T03:33:31.000Z (6 months ago)
- Last Synced: 2025-04-08T04:23:52.296Z (6 months ago)
- Topics: chinese, data-visualization, matplotlib, plot, python, python3, wordcloud
- Language: Python
- Homepage: https://datahonor.com/zhplot/
- Size: 12.1 MB
- Stars: 29
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Zh-Plot: 一行代码搞定 Python 图表中文展示
[](https://pypi.org/project/zhplot/)
[](https://pypi.org/project/zhplot/)
[](https://pepy.tech/projects/zhplot)[](https://github.com/psf/black)
[](https://github.com/astral-sh/ruff)
[](https://pycqa.github.io/isort/)
[](https://mypy-lang.org/)
[](https://github.com/pre-commit/pre-commit)[](https://github.com/shenxiangzhuang/zhplot/actions/workflows/build_docs.yaml)
[](https://github.com/shenxiangzhuang/zhplot/actions/workflows/test.yaml)
[](https://codecov.io/gh/shenxiangzhuang/zhplot)
[](https://github.com/shenxiangzhuang/zhplot/blob/master/LICENSE)## 支持的框架
- [x] [matplotlib](https://github.com/matplotlib/matplotlib)
- [x] [wordcloud](https://github.com/amueller/word_cloud)## 快速开始
### 安装
使用 [pip](https://pip.pypa.io/) 安装`zhplot`:
```bash
pip install zhplot
```使用 [uv](https://docs.astral.sh/uv/) 安装`zhplot`:
```bash
uv add zhplot
```### 使用方法
使用`zhplot`非常简单,只需在脚本开头导入即可:
```diff
+ import zhplot
import matplotlib.pyplot as plt
```在汉化 wordcloud 的时候`import zhplot`需要在前面:
```diff
+ import zhplot
import wordcloud
```### 一个简单的例子
![]()
```python
import zhplot
import matplotlib.pyplot as pltplt.plot([1, 2, 3, 4])
plt.title('这是一个标题')
plt.xlabel('横坐标')
plt.ylabel('纵坐标')
plt.show()
```## 相似项目
- [japanize-matplotlib](https://github.com/uehara1414/japanize-matplotlib)
- [chineseize-matplotlib](https://github.com/cndeng/chineseize-matplotlib)