ggplot2中各种主题元素修改对应方法函数速查表

ggplot2中各种主题元素修改对应方法函数速查表


找到图形中对应的主题元素名称,然后找到对应的方法,如element_rect(),element_text()等对其进行修改:

例如图片的title主题元素名称为plot.title,为文字。可以用element_text()方法修改显示样式:

字号调大一下:


p1<-ggplot(mtcars, aes(wt, mpg)) +
  
geom_point() +
labs(title="Fuel economy declines as weight increases") p1
p1 + theme(plot.title=element_text(size=rel(2)))


attachments-2019-07-9uIUO0kA5d401ca20070e.jpg


主题元素与对应的方法总结:


attachments-2019-07-3LOOsgcN5d4018c51883b.jpg更多主题元素修改:https://ggplot2.tidyverse.org/reference/theme.html

  • 发表于 2019-07-30 18:27
  • 阅读 ( 3701 )
  • 分类:R

0 条评论

请先 登录 后评论
omicsgene
omicsgene

生物信息

657 篇文章

作家榜 »

  1. omicsgene 657 文章
  2. 安生水 327 文章
  3. Daitoue 167 文章
  4. 生物女学霸 120 文章
  5. 红橙子 78 文章
  6. CORNERSTONE 72 文章
  7. rzx 67 文章
  8. xun 66 文章