1 00:00:01,159 --> 00:00:03,044 What is the relationship between attack and type? 2 00:00:03,044 --> 00:00:07,987 In our previous scatter plots and histograms we tried to visualize 3 00:00:07,987 --> 00:00:12,414 the attack data according to a categorical variable type. 4 00:00:12,414 --> 00:00:17,195 Seaborn has a family of categorical plots that will help us make better 5 00:00:17,195 --> 00:00:18,477 visualizations. 6 00:00:18,477 --> 00:00:24,571 Common categorical plots include strip plot, box plot and bar plot. 7 00:00:24,571 --> 00:00:29,417 Let's start with making your categorical 8 00:00:29,417 --> 00:00:33,596 scatterplot called the stripplot. 9 00:00:35,351 --> 00:00:38,626 Sns.stripplot. 10 00:00:38,626 --> 00:00:42,881 Data-pokemon, x=type, and y=attack. 11 00:00:46,464 --> 00:00:51,446 So now we have a stripplot with all of our observations grouped by type. 12 00:00:51,446 --> 00:00:55,320 But notice how the x axis labels are all smushed together. 13 00:00:58,009 --> 00:00:59,813 Seaborn has two families of functions. 14 00:00:59,813 --> 00:01:04,186 Stripplot is an axis level function. 15 00:01:04,186 --> 00:01:09,254 In order to fix the x axis labels, 16 00:01:09,254 --> 00:01:13,779 we'll have to use a different 17 00:01:13,779 --> 00:01:18,847 family of function called figure 18 00:01:18,847 --> 00:01:23,915 level functions sns.catplot, 19 00:01:23,915 --> 00:01:30,774 kind='strip', Data=pokemon. 20 00:01:30,774 --> 00:01:31,881 X=Type. 21 00:01:31,881 --> 00:01:33,410 And y=Attack. 22 00:01:33,410 --> 00:01:38,495 When I run, Shift+Enter and create this plot, 23 00:01:38,495 --> 00:01:46,943 I'll get a similar looking plot where my x axis labels are all smushed together. 24 00:01:46,943 --> 00:01:49,753 However, when I use catplot, 25 00:01:49,753 --> 00:01:54,943 I have access to an additional parameter called aspect, 26 00:01:54,943 --> 00:01:59,086 which will let me adjust the x axis labels. 27 00:01:59,086 --> 00:01:59,745 Aspect=2. 28 00:02:01,934 --> 00:02:07,282 There we go, now I have a categorical plot of the kind strip, the stripplot. 29 00:02:07,282 --> 00:02:12,314 And I can see all of the distributions of my Pokemon's 30 00:02:12,314 --> 00:02:16,651 attack statistics grouped by their types. 31 00:02:16,651 --> 00:02:18,400 In this visualization, 32 00:02:18,400 --> 00:02:23,744 we can observe that the dragon type Pokemon have the highest attack points. 33 00:02:23,744 --> 00:02:27,767 While the normal type Pokemon have the largest spread of data. 34 00:02:27,767 --> 00:02:31,526 So let's record these observations in a new mark down cell. 35 00:02:34,283 --> 00:02:38,559 The Dragon types have the highest attack. 36 00:02:43,587 --> 00:02:51,345 While the normal types, Have the largest spread of data. 37 00:02:53,523 --> 00:02:56,013 These are just some observations that I'm recording. 38 00:02:56,013 --> 00:02:57,643 Feel free to add more of your own. 39 00:02:57,643 --> 00:03:03,340 Now, try practicing making your stripplot using the Pokemon's defense stat.