Lazy loaded imageggthemes 常用主题

type
status
date
slug
summary
tags
category
icon
password
comment
简介
ggthemesggplot2 官方生态中的扩展包,提供了多达 20 多种经典出版级与报表级主题(例如 Economist、WSJ、Tufte、Solarized 等)和配色方案,一行代码即可让你的图表风格立刻焕然一新。

1. 安装与加载


2. 准备示例数据


3. 绘制基础散点图

notion image

4. 应用多种 ggthemes 主题

下面分别示例几种常用主题,只需在图层末尾加上对应函数:
提示:
  • 大多数主题都自带针对字体、背景、网格线与图例的优化;
  • 配色方案(scale_color_*)可与主题配合使用;
  • 你也可以在主题后继续叠加自定义 theme() 调整。

5. 常见主题速查

主题函数
说明
theme_wsj()
Wall Street Journal 风格
theme_tufte()
Edward Tufte 极简风格
theme_economist()
The Economist 报表风格
theme_excel()
Microsoft Excel 风格
theme_fivethirtyeight()
FiveThirtyEight 报表风格
theme_solarized()
Solarized 颜色方案(浅/深两种)
theme_igray()
简约灰度风格
theme_calc()
LibreOffice Calc 风格
scale_color_tableau()
Tableau 友好配色方案
scale_color_colorblind()
Colorblind 友好配色

6. 小结

  • ggthemes 提供了覆盖报刊、学术与软件界面风格的丰富主题;
  • 只需一行 + theme_*()+ scale_*(),即可快速切换;
  • 建议根据最终发布媒介(论文、报告、演示)选择匹配的主题。
Prev
ggthemr:为 ggplot2 一键换肤
Next
msigdbr 包
Loading...
Article List
Evan の Logbook
✨ Updates
🎨 Style Guide
🧠 Creative Resources
🗒️ Mind Notes
🧭 Knowbase
📘 SOPs
🩺 Medical Research
🛠️ Tech Chronicles
💰 Fortune Blueprint
📈 R Visionary
📊 Statistics
🖼️ BioVis