欢迎光临
我们一直在努力

ggplot2的theme参数怎么设置

这篇“ggplot2的theme参数怎么设置”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“ggplot2的theme参数怎么设置”文章吧。

ggplot2绘图theme参数设置

theme(line, rect, text, title, aspect.ratio, axis.title, axis.title.x,  axis.title.x.top, axis.title.y, axis.title.y.right, axis.text, axis.text.x,  axis….

ggplot2绘图theme参数设置

theme(line, rect, text, title, aspect.ratio, axis.title, axis.title.x,
  axis.title.x.top, axis.title.y, axis.title.y.right, axis.text, axis.text.x,
  axis.text.x.top, axis.text.y, axis.text.y.right, axis.ticks, axis.ticks.x,
  axis.ticks.y, axis.ticks.length, axis.line, axis.line.x, axis.line.y,
  legend.background, legend.margin, legend.spacing, legend.spacing.x,
  legend.spacing.y, legend.key, legend.key.size, legend.key.height,
  legend.key.width, legend.text, legend.text.align, legend.title,
  legend.title.align, legend.position, legend.direction, legend.justification,
  legend.box, legend.box.just, legend.box.margin, legend.box.background,
  legend.box.spacing, panel.background, panel.border, panel.spacing,
  panel.spacing.x, panel.spacing.y, panel.grid, panel.grid.major,
  panel.grid.minor, panel.grid.major.x, panel.grid.major.y, panel.grid.minor.x,
  panel.grid.minor.y, panel.ontop, plot.background, plot.title, plot.subtitle,
  plot.caption, plot.margin, strip.background, strip.placement, strip.text,
  strip.text.x, strip.text.y, strip.switch.pad.grid, strip.switch.pad.wrap, ...,
  complete = FALSE, validate = TRUE)
设定空白会利用函数element_blank()
参数 设置内容 继承自 设置函数
line 所有线属性   =element_line()
rect 所有矩形区域属性   =element_rect()
text 所有文本相关属性   =element_text()
title 所有标题属性   =element_text()
axis.title 坐标轴标题 text =element_text()
axis.title.x x轴属性 axis.title =element_text()
axis.title.y y轴属性 axis.title =element_text()
axis.text 坐标轴刻度标签属性 text =element_text()
axis.text.x 属性和继承和前面类似,不再重复   =element_text()
axis.text.y     =element_text()
axis.ticks 坐标轴刻度线 line =element_line()
axis.ticks.x     =element_line()
axis.ticks.y     =element_line()
axis.ticks.length 刻度线长度    
axis.ticks.margin 刻度线和刻度标签之间的间距    
axis.line 坐标轴线 line =element_line()
axis.line.x     =element_line()
axis.line.y     =element_line()
legend.background 图例背景 rect =element_rect()
legend.margin 图例边界    
legend.key 图例符号   =element_rect()
legend.key.size 图例符号大小    
legend.key.height 图例符号高度    
legend.key.width 图例符号宽度    
legend.text 图例文字标签   =element_text()
legend.text.align 图例文字标签对齐方式 0为左齐,1为右齐  
legend.title 图例标题 text =element_text()
legend.title.align 图例标题对齐方式    
legend.position 图例位置 left, right, bottom, top, 两数字向量  
legend.direction 图例排列方向 "horizontal" or
 "vertical"
 
legend.justification 居中方式 center或两数字向量  
legend.box 多图例的排列方式 "horizontal" or
 "vertical"
 
legend.box.just 多图例居中方式    
panel.background 绘图区背景 rect =element_rect()
panel.border 绘图区边框 rect =element_rect()
panel.margin 分面绘图区之间的边距    
panel.grid 绘图区网格线 line =element_line()
panel.grid.major 主网格线   =element_line()
panel.grid.minor 次网格线   =element_line()
panel.grid.major.x     =element_line()
panel.grid.major.y     =element_line()
panel.grid.minor.x     =element_line()
panel.grid.minor.y     =element_line()
plot.background 整个图形的背景   =element_rect()
plot.title 图形标题   =element_text()
plot.margin 图形边距 top, right, bottom, left  
strip.background 分面标签背景 rect =element_rect()
strip.text 分面标签文本 text =element_text()
strip.text.x     =element_text()
strip.text.y     =element_text()

以上就是关于“ggplot2的theme参数怎么设置”这篇文章的内容,相信大家都有了一定的了解,希望小编分享的内容对大家有帮助,若想了解更多相关的知识内容,请关注云搜网行业资讯频道。

赞(0)
【声明】:本博客不参与任何交易,也非中介,仅记录个人感兴趣的主机测评结果和优惠活动,内容均不作直接、间接、法定、约定的保证。访问本博客请务必遵守有关互联网的相关法律、规定与规则。一旦您访问本博客,即表示您已经知晓并接受了此声明通告。