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 )
图片新闻
最新活动更多
-
技术指南立即下载>> 电动汽车功率半导体技术趋势变化带来的挑战及解决方案
-
2月28日火热报名中>> 【免费试用】东集技术年终福利——免费试用活动
-
4日10日立即报名>> OFweek 2025(第十四届)中国机器人产业大会
-
限时免费下载立即下载 >>> 2024“机器人+”行业应用创新发展蓝皮书
-
7.30-8.1火热报名中>> 全数会2025(第六届)机器人及智能工厂展
-
7月30-31日报名参会>>> 全数会2025中国激光产业高质量发展峰会
推荐专题
发表评论
请输入评论内容...
请输入评论/评论长度6~500个字
暂无评论
暂无评论