在B站看到有人提问说安东尼戴维斯的数据比邓肯好,画个图来比较下

作为R语言数据可视化爱好者,当然得找到邓肯和安东尼戴维斯的数据来可视化比较一番了

数据来源 https://www.basketball-reference.com/

今年是安东尼戴维斯的第10个赛季,赛季刚刚开始,因此这个赛季的数据不纳入比较,选择前9个赛季的数据,邓肯也用前9个赛季的数据

数据下载好了存储到csv文件里

读取数据

AD<-read.csv("basketball/AD.txt")
head(AD)
TD<-read.csv("basketball/TD.txt")
head(TD)

加载用到的R包

library(ggplot2)
library(see)
library(tidyverse)

首先比较赛季出场场次

data.frame(y=c(AD$G,TD$G),
                group=c(rep("Anthony Davis",9),
                        rep("Tim Duncan",9)),
                x=as.character(c(1:9,1:9))) %>% 
  ggplot(aes(x=x,y=y))+
  geom_col(aes(fill=group),position = "dodge")+
  theme_minimal()+
  labs(x=NULL,y=NULL)+
  theme(legend.position = "top",
        legend.title = element_blank(),
        legend.text = element_text(size=20),
        plot.title = element_text(size=30,hjust=0.5))+
  scale_fill_material_d()+
  ggtitle("赛季出场场次")
image.png

从图上可以看出,邓肯的出场次数是全面领先安东尼戴维斯的

记下来比较场均出场时间

data.frame(y=c(AD$MP/AD$G,TD$MP/TD$G),
                group=c(rep("Anthony Davis",9),
                        rep("Tim Duncan",9)),
                x=as.character(c(1:9,1:9))) %>% 
  ggplot(aes(x=x,y=y))+
  geom_col(aes(fill=group),position = "dodge")+
  theme_minimal()+
  labs(x=NULL,y=NULL)+
  theme(legend.position = "top",
        legend.title = element_blank(),
        legend.text = element_text(size=20),
        plot.title = element_text(size=30,hjust=0.5))+
  scale_fill_material_d()+
  ggtitle("场均出场时间")
image.png

场均出场时间邓肯也是遥遥领先安东尼戴维斯的

从出场次数和出场时间上看,安东尼戴维斯的身体耐操程度是远远不如邓肯的

记下来是场均得分

data.frame(y=c(AD$PTS/AD$G,TD$PTS/TD$G),
           group=c(rep("Anthony Davis",9),
                   rep("Tim Duncan",9)),
           x=as.character(c(1:9,1:9))) %>% 
  ggplot(aes(x=x,y=y))+
  geom_col(aes(fill=group),position = "dodge")+
  theme_minimal()+
  labs(x=NULL,y=NULL)+
  theme(legend.position = "top",
        legend.title = element_blank(),
        legend.text = element_text(size=20),
        plot.title = element_text(size=30,hjust=0.5))+
  scale_fill_material_d()+
  ggtitle("场均得分")
image.png

场均得分安东尼戴维斯有7个赛季都领先蒂姆邓肯,这个和当今NBA进攻节奏快也有一定的关系

场均出手次数

data.frame(y=c(AD$FGA/AD$G,TD$FGA/TD$G),
           group=c(rep("Anthony Davis",9),
                   rep("Tim Duncan",9)),
           x=as.character(c(1:9,1:9))) %>% 
  ggplot(aes(x=x,y=y))+
  geom_col(aes(fill=group),position = "dodge")+
  theme_minimal()+
  labs(x=NULL,y=NULL)+
  theme(legend.position = "top",
        legend.title = element_blank(),
        legend.text = element_text(size=20),
        plot.title = element_text(size=30,hjust=0.5))+
  scale_fill_material_d()+
  ggtitle("场均出手次数")
image.png

场均出手次数安东尼戴维斯也比邓肯高不少

命中率

data.frame(y=c(AD$FG.,TD$FG.),
           group=c(rep("Anthony Davis",9),
                   rep("Tim Duncan",9)),
           x=as.character(c(1:9,1:9))) %>% 
  ggplot(aes(x=x,y=y))+
  geom_col(aes(fill=group),position = "dodge")+
  theme_minimal()+
  labs(x=NULL,y=NULL)+
  theme(legend.position = "top",
        legend.title = element_blank(),
        legend.text = element_text(size=20),
        plot.title = element_text(size=30,hjust=0.5))+
  scale_fill_material_d()+
  ggtitle("命中率")
image.png

命中率安东尼戴维斯稍高于邓肯

接下来是 篮板 助攻 抢断 盖帽

data.frame(y=c(AD$TRB/AD$G,TD$TRB/TD$G),
           group=c(rep("Anthony Davis",9),
                   rep("Tim Duncan",9)),
           x=as.character(c(1:9,1:9))) %>% 
  ggplot(aes(x=x,y=y))+
  geom_col(aes(fill=group),position = "dodge")+
  theme_minimal()+
  labs(x=NULL,y=NULL)+
  theme(legend.position = "top",
        legend.title = element_blank(),
        legend.text = element_text(size=20),
        plot.title = element_text(size=30,hjust=0.5))+
  scale_fill_material_d()+
  ggtitle("篮板") -> p1


data.frame(y=c(AD$AST/AD$G,TD$AST/TD$G),
           group=c(rep("Anthony Davis",9),
                   rep("Tim Duncan",9)),
           x=as.character(c(1:9,1:9))) %>% 
  ggplot(aes(x=x,y=y))+
  geom_col(aes(fill=group),position = "dodge")+
  theme_minimal()+
  labs(x=NULL,y=NULL)+
  theme(legend.position = "top",
        legend.title = element_blank(),
        legend.text = element_text(size=20),
        plot.title = element_text(size=30,hjust=0.5))+
  scale_fill_material_d()+
  ggtitle("助攻") -> p2

data.frame(y=c(AD$STL/AD$G,TD$STL/TD$G),
           group=c(rep("Anthony Davis",9),
                   rep("Tim Duncan",9)),
           x=as.character(c(1:9,1:9))) %>% 
  ggplot(aes(x=x,y=y))+
  geom_col(aes(fill=group),position = "dodge")+
  theme_minimal()+
  labs(x=NULL,y=NULL)+
  theme(legend.position = "top",
        legend.title = element_blank(),
        legend.text = element_text(size=20),
        plot.title = element_text(size=30,hjust=0.5))+
  scale_fill_material_d()+
  ggtitle("抢断") -> p3

data.frame(y=c(AD$BLK/AD$G,TD$BLK/TD$G),
           group=c(rep("Anthony Davis",9),
                   rep("Tim Duncan",9)),
           x=as.character(c(1:9,1:9))) %>% 
  ggplot(aes(x=x,y=y))+
  geom_col(aes(fill=group),position = "dodge")+
  theme_minimal()+
  labs(x=NULL,y=NULL)+
  theme(legend.position = "top",
        legend.title = element_blank(),
        legend.text = element_text(size=20),
        plot.title = element_text(size=30,hjust=0.5))+
  scale_fill_material_d()+
  ggtitle("盖帽") -> p4

library(patchwork)

p1+p2+p3+p4+
  plot_layout(ncol=1)
image.png

邓肯在篮板和盖帽数据占优,而安东尼戴维斯在助攻抢断占优

综上所述,题主的问题有不合理的地方,安东尼戴维斯并没有在各项数据上超越邓肯

你可能感兴趣的:(在B站看到有人提问说安东尼戴维斯的数据比邓肯好,画个图来比较下)