侵权投诉
搜索
更多>> 热门搜索:
订阅
纠错
加入自媒体

ggpubr包绘图技巧分享:饼图、棒棒糖图、Cleveland 点图

2020-12-29 10:11
科研菌
关注

# 坐标轴旋转

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 )

<上一页  1  2  3  4  
声明: 本文由入驻维科号的作者撰写,观点仅代表作者本人,不代表OFweek立场。如有侵权或其他问题,请联系举报。

发表评论

0条评论,0人参与

请输入评论内容...

请输入评论/评论长度6~500个字

您提交的评论过于频繁,请输入验证码继续

暂无评论

暂无评论

    文章纠错
    x
    *文字标题:
    *纠错内容:
    联系邮箱:
    *验 证 码:

    粤公网安备 44030502002758号