beautiful-data-viz

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Beautiful Data Viz

精美数据可视化

Create polished, publication-ready visualizations in Python/Jupyter with strong typography, clean layout, and accessible color choices.
在Python/Jupyter环境中创建具有优质排版、简洁布局和易访问配色的精致、可用于出版的可视化图表。

Instructions

操作步骤

  1. Clarify the message, audience, and medium (notebook/paper/slides).
  2. Choose the simplest chart type that answers the question.
  3. Select an appropriate palette type (categorical/sequential/diverging).
  4. Apply the shared style helpers, then build the plot.
  5. Validate readability at target size and export with tight bounds.
  1. 明确要传达的信息、受众和使用媒介(笔记本/论文/幻灯片)。
  2. 选择能回答问题的最简图表类型。
  3. 选择合适的配色方案类型(分类型/连续型/发散型)。
  4. 应用共享样式辅助工具,然后构建图表。
  5. 在目标尺寸下验证可读性,并以紧凑边界导出。

Quick Reference

快速参考

TaskAction
Apply styleUse
assets/beautiful_style.py
helpers
Pick paletteSee
references/palettes.md
QA checklistSee
references/checklist.md
Plot recipesSee
examples/recipes.md
任务操作
应用样式使用
assets/beautiful_style.py
辅助工具
选择配色方案查看
references/palettes.md
质量检查清单查看
references/checklist.md
图表示例查看
examples/recipes.md

Input Requirements

输入要求

  • Data in a tabular form (pandas DataFrame or similar)
  • Clear statement of the primary message
  • Target medium and background preference
  • 表格形式的数据(pandas DataFrame或类似格式)
  • 明确的核心信息说明
  • 目标媒介和背景偏好

Output

输出

  • Publication-ready figure(s) (PNG/SVG/PDF)
  • Consistent styling and labeling
  • 可用于出版的图表(PNG/SVG/PDF格式)
  • 一致的样式和标签

Quality Gates

质量标准

  • Message is clear in 3 seconds at target size
  • Labels and units are readable and accurate
  • Color choice is colorblind-safe and grayscale-tolerant
  • Layout is tight with minimal whitespace
  • 在目标尺寸下3秒内可清晰传达信息
  • 标签和单位清晰可读且准确
  • 配色方案对色弱人群友好且支持灰度显示
  • 布局紧凑,空白区域最小化

Examples

示例

Example 1: Apply the shared style helper

示例1:应用共享样式辅助工具

python
from assets.beautiful_style import set_beautiful_style, finalize_axes
set_beautiful_style(medium="notebook", background="light")
python
from assets.beautiful_style import set_beautiful_style, finalize_axes
set_beautiful_style(medium="notebook", background="light")

build plot here

在此处构建图表

finalize_axes(ax, title="Example", subtitle="", tight=True)
undefined
finalize_axes(ax, title="Example", subtitle="", tight=True)
undefined

Troubleshooting

故障排除

Issue: Labels overlap or are unreadable Solution: Reduce tick count, rotate labels, or increase figure width.
Issue: Colors are hard to distinguish Solution: Use a colorblind-safe categorical palette and limit categories.
问题:标签重叠或难以辨认 解决方案:减少刻度数量、旋转标签或增加图表宽度。
问题:颜色难以区分 解决方案:使用对色弱人群友好的分类配色方案,并限制类别数量。