ggpubr包绘图技巧分享:饼图、棒棒糖图、Cleveland 点图
# 坐标轴旋转
ggdotchart(df5, x = "name", y = "mpg", group = "cyl", color = "cyl", palette = c('#999999','#E69F00','#56B4E9'), rotate = TRUE, sorting = "descending", ggtheme = theme_bw(), y.text.col = TRUE )
#设置点的大小:
ggdotchart(df5, x = "name", y = "mpg", group = "cyl", color = "cyl", size = "cyl", palette = c('#999999','#E69F00','#56B4E9'), rotate = TRUE, sorting = "descending", ggtheme = theme_bw(), y.text.col = TRUE )
# 统一设定点大小,添加虚线网格
ggdotchart(df5, x = "name", y = "mpg", group = "cyl", color = "cyl", palette = c("#00AFBB", "#E7B800", "#FC4E07"), sorting = "descending", rotate = TRUE, dot.size = 2, y.text.col = TRUE, # Color y text by groups ggtheme = theme_pubr() # ggplot2 theme )+ theme_cleveland() # 添加虚线网格
# 添加标签
ggdotchart(df5, x = "name", y = "mpg", size="cyl", group = "cyl", color = "cyl", label = "name", font.label = list(size=10,color="red",face="bold"), # bold表示粗体字 palette = c('#999999','#E69F00','#56B4E9'), rotate = TRUE, sorting = "descending", ggtheme = theme_bw(), y.text.col = TRUE )
# 添加标签边框,避免重叠
ggdotchart(df5, x = "name", y = "mpg", size="cyl", repel = T, group = "cyl", color = "cyl", label = "name", label.rectangle = T, font.label = list(size=10,color="red",face="bold"), palette = c('#999999','#E69F00','#56B4E9'), rotate = TRUE, sorting = "descending", ggtheme = theme_bw(), y.text.col = TRUE )
图片新闻
最新活动更多
-
5月22日火热报名中 >> 瓦楞行业张力控制解决方案在线研讨会
-
5月30日立即预约>>> 宾采尔激光焊接领域一站式应用方案在线研讨会
-
5月31日立即报名>> 【线下论坛】新唐科技2024未来创新峰会
-
6月12日火热报名>>> OFweek锂电/半导体行业数字化转型在线研讨会
-
即日-6.30免费预约申请>> 艾睿光电-开阳及瑶光系列专家级红外热像仪-产品试用
-
7月30日立即报名>>> 2024激光行业应用创新发展蓝皮书火热招编中!
推荐专题
发表评论
请输入评论内容...
请输入评论/评论长度6~500个字
暂无评论
暂无评论