color, size
设置点的颜色和大小
palette
自定义颜色画板
shape
设置点的形状
dot.size
点的大小
sorting
设定升序还是降序排列,默认是升序
add
添加图片元素:
"none", "dotplot", "jitter", "boxplot", "point", "mean", "mean_se", "mean_sd", "mean_ci", "mean_range", "median", "median_iqr", "median_mad", "median_range"
add.params
给add参数中添加的元素添加属性:color, size, linetype。
eg:add.params = list(color = "red")
rotate
设置坐标轴水平还是垂直放置
title
设置标题
xlab
设置x轴标题
ylab
设置y轴标题
x.text.col
逻辑值,设置x轴标签颜色
y.text.col
逻辑值,设置y轴标签颜色
facet.by
设置分组分面
panel.labs
设置分面各组的标题
short.panel.labs
是否缩写分面标题,逻辑值,默认是TRUE。
select
选择需要展示的变量
remove
移除不需要展示的变量
order
选定变量的排列顺序
size
设置点和轮廓的大小
binwidth
bin(区间)的宽度
label
设置列标签
font.label
设置标签字体
repel
逻辑值,是否使用ggrepel避免字体重叠
label.rectangle
是否给标签添加方框
ggtheme
设置画图主题
Cleveland 点图
# Cleveland点图基础样式,用的数据是df5ggdotchart(df5, x = "name", y ="mpg")
# 设置主题(theme)
ggdotchart(df5, x = "name", y ="mpg", ggtheme = theme_bw())
# 添加虚线网格
ggdotchart(df5, x = "name", y ="mpg", ggtheme = theme_pubr())+ theme_cleveland() # 添加虚线网格
# 根据“cyl”分组设定颜色
ggdotchart(df5, x = "name", y = "mpg", group = "cyl", color = "cyl", palette = c('#999999','#E69F00','#56B4E9'), ggtheme = theme_bw())
# 降序排列,给x轴标签设置颜色
ggdotchart(df5, x = "name", y = "mpg", group = "cyl", color = "cyl", palette = c('#999999','#E69F00','#56B4E9'), sorting = "descending", ggtheme = theme_bw(), x.text.col = TRUE)