[Aplicación de visualización de datos] Dibuje un gráfico estadístico de intervalo adecuado (con códigos de lenguaje Python y R)

Función R-ggplot2::geom_smooth() para dibujar

El editor agregará los elementos gráficos necesarios en combinación con el paquete R-ggpubr.Primero, usamos ggplot2 para el dibujo básico, de la siguiente manera:

"Ejemplo 1": una sola categoría

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:

Supongo que te gusta

Origin blog.csdn.net/wenyusuran/article/details/122538754
Recomendado
Clasificación