R-ggplot2::geom_smooth()函数绘制
小编这里将结合R-ggpubr包进行必要图表元素的的添加,首先,我们使用ggplot2进行基本的绘制,如下:
「样例一」:单一类别
library(tidyverse)
library(ggtext)
library(hrbrthemes)
library(wesanderson)
library(LaCroixColoR)
library(RColorBrewer)
library(ggsci)
# 读取数据
library(readxl)
test_df<-read_excel("test_data.xlsx")
# 可视化绘制
ggplot(data = test_df,aes(x = total_bill,y = tip)) +
geom_point(shape=21,fill="#0073C2",colour="black",size=3,stroke=.5) +
geom_smooth(fill="#868686",colour="#CD534C") +
labs(
title = "Example of <span style='color:#D20F26'>ggplot2::geom_smooth function</span>",
subtitle = "processed charts with <span style='color:#1A73E8'>geom_smooth(method = 'loess')</span>",
caption = "Visualization by <span style='color: