R-ggplot2::geom_smooth() function to draw
The editor will add the necessary chart elements in combination with the R-ggpubr package. First, we use ggplot2 for basic drawing, as follows:
"Example 1": a single category
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: