1 00:00:00,360 --> 00:00:01,490 All righty. 2 00:00:01,520 --> 00:00:06,810 Now we've seen a few different ways of changing the style of our spots and figures what we might do 3 00:00:06,810 --> 00:00:11,190 is change the style again but from within an existing style. 4 00:00:11,270 --> 00:00:15,690 Let's see what that means because that's kind of confusing when you hear it for the first time. 5 00:00:16,050 --> 00:00:19,400 What we might do is come back up here and take this code. 6 00:00:19,410 --> 00:00:23,730 Now this is one of the only times we're allowed to copy and paste because I think we've kind of seen 7 00:00:23,940 --> 00:00:30,750 enough for now of writing out this type of map pop lib style plotting so we'll come right down because 8 00:00:30,750 --> 00:00:36,270 what we're focused on now is just checking out how to change the style from within a style. 9 00:00:36,270 --> 00:00:42,610 So if we go here now what we want to do is we want to at the top of this cell. 10 00:00:42,700 --> 00:00:44,430 We've probably already set it above. 11 00:00:44,440 --> 00:00:54,130 But I'm going to reset this style so plant dot style I use and I want to see on white great that's a 12 00:00:54,130 --> 00:00:54,480 star. 13 00:00:54,480 --> 00:00:59,620 We're going to stick with for the time being set this style. 14 00:00:59,620 --> 00:01:00,700 Wonderful. 15 00:01:00,700 --> 00:01:06,370 Now we've created out over 50 data frame up before that's the heart disease patients that are over 50 16 00:01:06,940 --> 00:01:10,310 and this is going to plot out a scatter graph with this data. 17 00:01:10,360 --> 00:01:14,470 It's already got some customization a legend and a horizontal line. 18 00:01:14,590 --> 00:01:18,040 So let's see what this looks like with the White grid style. 19 00:01:18,040 --> 00:01:21,100 Just for a quick refresh we'll go back up. 20 00:01:21,130 --> 00:01:22,210 This is what it looks like. 21 00:01:22,210 --> 00:01:26,950 This is the original one we've just copied the code from this cell. 22 00:01:27,220 --> 00:01:32,470 And so we're going to come down take a quick snapshot of that in your mind and we're gonna see what 23 00:01:32,470 --> 00:01:35,030 the Seabourn version looks like. 24 00:01:35,080 --> 00:01:37,800 Let's it shift into OK. 25 00:01:38,010 --> 00:01:39,640 So a little bit different. 26 00:01:39,660 --> 00:01:44,880 We've got the white grid that makes sense because we're using seaborne white grid but these colors I 27 00:01:44,880 --> 00:01:50,850 think the lines are different color it's red now and these dots are black and white by default. 28 00:01:50,850 --> 00:01:57,810 What happens if you say I like the seaborne white grid style but I don't really like these colors that 29 00:01:57,810 --> 00:01:59,010 it's putting out. 30 00:01:59,010 --> 00:02:02,900 Well as you might have guessed the beautiful thing is now pop live. 31 00:02:03,270 --> 00:02:07,560 It's got a whole bunch of different colors and we can change up the colors. 32 00:02:07,560 --> 00:02:16,110 So if we go in here as a little parameter called see map which stands for color map and there's a whole 33 00:02:16,110 --> 00:02:19,390 bunch of different styles I've kind of explored them myself. 34 00:02:19,470 --> 00:02:21,480 I personally like winter or summer. 35 00:02:21,660 --> 00:02:23,820 I think in know this is seasons. 36 00:02:23,940 --> 00:02:35,760 All it's going to mean is that this changes the color scheme and let's see what happens beautiful. 37 00:02:35,880 --> 00:02:41,020 So now our black and white dots are of a wintery color scheme. 38 00:02:41,070 --> 00:02:44,880 You can tell the difference a lot more than just pure black and white. 39 00:02:44,880 --> 00:02:51,980 Now if we have a look for go to I believe it's matte plot live colors tutorial. 40 00:02:52,050 --> 00:02:58,760 Now this should show the map properly documentation where you can see a whole bunch of different colors. 41 00:02:58,830 --> 00:02:59,830 If we go here. 42 00:02:59,850 --> 00:03:02,150 Control f so colors. 43 00:03:02,370 --> 00:03:03,470 That's what we're after. 44 00:03:04,880 --> 00:03:07,400 Choosing color maps in that plot lib. 45 00:03:07,640 --> 00:03:12,810 So again there's a lot of information here we go down. 46 00:03:13,400 --> 00:03:15,990 So it's got some different patterns here. 47 00:03:17,910 --> 00:03:19,050 We keep going down. 48 00:03:19,050 --> 00:03:22,350 You'll start to see if you type in this is a string plasma. 49 00:03:22,470 --> 00:03:23,940 Let's see what happens here. 50 00:03:24,030 --> 00:03:25,720 That's going to change the color map. 51 00:03:26,190 --> 00:03:28,230 So let's go back to our notebook. 52 00:03:28,230 --> 00:03:29,760 We might type in plasma 53 00:03:32,540 --> 00:03:32,830 OK. 54 00:03:33,020 --> 00:03:34,000 So it's changed back. 55 00:03:34,010 --> 00:03:35,580 I personally prefer winter. 56 00:03:35,600 --> 00:03:36,520 You can also do summer. 57 00:03:36,530 --> 00:03:37,490 Let's see what that looks like. 58 00:03:40,160 --> 00:03:40,590 OK. 59 00:03:40,600 --> 00:03:41,350 That's all right. 60 00:03:41,350 --> 00:03:45,550 But still I think winter's my favorite I've had a practice with these same apps. 61 00:03:45,550 --> 00:03:46,060 There we go. 62 00:03:46,060 --> 00:03:46,760 That looks great. 63 00:03:46,810 --> 00:03:49,850 But this is the map slightly documentation. 64 00:03:49,850 --> 00:03:55,420 So tutorials slash colors slash color maps and you can keep scrolling down there's a whole bunch here 65 00:03:55,430 --> 00:04:00,010 if you just wanted green and blue or if you just want a blue and purple you can use these little color 66 00:04:00,010 --> 00:04:04,390 codes P. You be you for blue and purple or yellow green blue. 67 00:04:04,720 --> 00:04:07,240 Well keep going there's actually quite a few right. 68 00:04:07,240 --> 00:04:13,420 So it's all about experimenting and trying to figure out which colors you personally prefer or which 69 00:04:13,420 --> 00:04:17,940 colors best demonstrate what you're trying to show in your map plot led plot. 70 00:04:17,950 --> 00:04:20,800 But this line over here that's not really offering much. 71 00:04:20,800 --> 00:04:27,430 So let's let's check out how we can kind of constrain our plot to certain widths and certain heights 72 00:04:27,730 --> 00:04:32,110 on the different axis values using x limb and Y limb. 73 00:04:32,140 --> 00:04:36,630 Let's grab our double sided plot from before our subplot. 74 00:04:36,700 --> 00:04:39,470 We'll grab that code again. 75 00:04:39,480 --> 00:04:43,410 This is one of the only times you're allowed to copy and paste code because there's quite a lot of it. 76 00:04:43,440 --> 00:04:49,440 So to save time writing it out will bring down the graph because what we're focused on is customizing 77 00:04:49,590 --> 00:04:57,570 the y and x axis limitations we'll put that down there. 78 00:04:58,470 --> 00:05:07,960 So now we've just copied and pasted the code from take a snapshot of this one as well from up here down 79 00:05:07,960 --> 00:05:08,620 to here. 80 00:05:08,620 --> 00:05:09,640 Now if we run this 81 00:05:14,730 --> 00:05:20,070 it's going to output that subplot that we saw before but with the default Seabourn colors. 82 00:05:20,070 --> 00:05:21,310 So what do we have to do. 83 00:05:21,480 --> 00:05:23,550 We have to change the C map. 84 00:05:23,550 --> 00:05:24,830 So let's see it in action. 85 00:05:24,870 --> 00:05:26,250 See map again. 86 00:05:26,340 --> 00:05:29,380 This is just in our scatter plot like we've done up here. 87 00:05:29,640 --> 00:05:33,250 We've added a C map parameter so we'll do that here. 88 00:05:33,390 --> 00:05:36,340 C math equals Winter. 89 00:05:36,510 --> 00:05:38,070 Let's see what happens. 90 00:05:38,070 --> 00:05:38,610 Beautiful. 91 00:05:38,610 --> 00:05:40,510 That changes axis zero. 92 00:05:40,620 --> 00:05:42,090 So the first plot. 93 00:05:42,090 --> 00:05:44,780 Now we have to do the same for Axis 1. 94 00:05:44,920 --> 00:05:53,810 We'll add in C math equals winter b beautiful. 95 00:05:53,950 --> 00:05:55,230 We'll go down have a look. 96 00:05:55,360 --> 00:05:55,950 Beautiful. 97 00:05:55,960 --> 00:05:58,840 So now I got two really good looking plants right here. 98 00:05:59,170 --> 00:06:06,360 So if we go back to our anatomy of a map plot Lee plot starting to get really close to what we've got 99 00:06:06,360 --> 00:06:06,880 here. 100 00:06:06,930 --> 00:06:10,570 But as you can see with ours we've got this line here. 101 00:06:10,650 --> 00:06:16,410 This line here and this one up here whereas on here it's kind of clean the edges nice and cut off at 102 00:06:16,410 --> 00:06:18,780 50 they're at 200 up there. 103 00:06:18,780 --> 00:06:27,500 So let's see how we would do that what we're going to do is come back up to our code and now in this 104 00:06:27,500 --> 00:06:32,620 set parameter we could do it in there but I'll show you another way of doing it. 105 00:06:32,630 --> 00:06:36,830 So we'll customize access 0 first just to show you what's going on. 106 00:06:36,830 --> 00:06:42,310 Axis zero dot set y Lim to be. 107 00:06:42,400 --> 00:06:44,360 What do we want yeah. 108 00:06:44,430 --> 00:06:49,200 So we want to cut it off at about 50. 109 00:06:49,740 --> 00:06:50,350 Let's try that. 110 00:06:50,820 --> 00:06:53,520 So set X Lim. 111 00:06:53,640 --> 00:06:58,010 So we're going to do that 50 member we can always change this. 112 00:06:58,020 --> 00:07:06,150 So this is going to be change the x axis limits. 113 00:07:06,200 --> 00:07:07,190 There we go. 114 00:07:07,190 --> 00:07:08,370 So let's see what this does. 115 00:07:08,390 --> 00:07:11,270 We're going to shift into beautiful. 116 00:07:11,270 --> 00:07:15,840 So now we've cut off that line that was here before. 117 00:07:15,860 --> 00:07:18,680 So let's do this just to see what happens 118 00:07:21,890 --> 00:07:22,760 so that's what we've done. 119 00:07:22,780 --> 00:07:28,770 We've removed this line because we've changed the X limit of access zero to be 50. 120 00:07:28,790 --> 00:07:32,970 Remember both of these are using the same x axis as age. 121 00:07:33,050 --> 00:07:38,160 So let's do it let's keep that in there we'll change that limitation there. 122 00:07:38,170 --> 00:07:42,560 We're gonna add the same thing to Axis 1. 123 00:07:42,610 --> 00:07:44,730 We'll put it under here. 124 00:07:45,040 --> 00:07:50,630 Change x 1 x axis limits. 125 00:07:50,730 --> 00:08:00,000 We're gonna x one dot sets X Lim and we're gonna change that to be. 126 00:08:00,320 --> 00:08:03,290 I think it's the same 50 and 80. 127 00:08:03,290 --> 00:08:07,670 Nice and simple 50 80. 128 00:08:07,980 --> 00:08:13,790 And we're also going to change the Y limit on here to remove this top line to be a flat 200. 129 00:08:13,920 --> 00:08:21,250 Maybe we go from 50 to 200 or 60 60 to 200 I think that'll be a good range. 130 00:08:21,390 --> 00:08:22,450 So we'll do that as well. 131 00:08:22,540 --> 00:08:28,860 X 1 set y Lim 60 200. 132 00:08:28,880 --> 00:08:29,900 And let's see what happens. 133 00:08:29,900 --> 00:08:32,480 Now take a quick look at what we've got here. 134 00:08:32,630 --> 00:08:34,880 You've got this graph we've got this line here. 135 00:08:34,940 --> 00:08:35,930 We've got this one. 136 00:08:36,110 --> 00:08:37,030 We've got this line here. 137 00:08:37,040 --> 00:08:38,350 We've got this top line here. 138 00:08:38,360 --> 00:08:47,020 So let's see because we've changed the X limb and the Y limb of access 1 and the X limb of Axis 0. 139 00:08:47,180 --> 00:08:53,830 Hopefully if we've done it all right due to fall that's what we're talking about. 140 00:08:53,840 --> 00:09:00,410 So now we've fully replicated the plot that we have here. 141 00:09:00,480 --> 00:09:04,700 We've got the exact same thing going on here we've we've cleaned out the x axis is we've changed the 142 00:09:04,700 --> 00:09:08,600 color we've changed the style and can't really see it all in one here. 143 00:09:08,600 --> 00:09:10,550 So let's zoom out a little bit. 144 00:09:13,390 --> 00:09:14,910 There we go. 145 00:09:14,920 --> 00:09:17,570 So that plot is looking pretty darn good. 146 00:09:17,590 --> 00:09:21,790 I don't know if you agree or not maybe you create your own style maybe some different colors or something 147 00:09:21,790 --> 00:09:25,090 like that but to me that looks like something we can share. 148 00:09:25,090 --> 00:09:29,200 So that's what we're going to look at the next video is saving and sharing this plot. 149 00:09:29,290 --> 00:09:35,450 So have a practice around maybe change the limitations with some different data or change his style. 150 00:09:35,470 --> 00:09:40,270 Change the C map and see if you can create your own version of this heart disease analysis.