‫All righty.
‫Now, we've seen a few different ways of changing the style of our plots and figures.
‫What we might do is change the style again, but from within an existing style.
‫Let's see what that means, because that's kind of confusing when you hear it for the first time.
‫What we might do is come back up here and take this code.
‫Now, this is one of the only times we're allowed to copy and paste because I think we've kind of seen
‫enough for now of writing out this type of map, plot, lib style plotting.
‫So we'll come right down because what we're focused on now is just checking out how to change the style
‫from within a style.
‫So if we go here.
‫Now what we want to do is we want to at the top of this cell, we've probably already said it above,
‫but I'm going to reset the style.
‫So plot dot style use and I want seaborne white grid.
‫That's the style we're going to stick with for the time being.
‫Set the style.
‫Wonderful.
‫Now we've created out over 50 data frame up before.
‫That's the heart disease patients that are over 50.
‫And this is going to plot out a scatter graph with this data.
‫It's already got some customization, a legend and a horizontal line.
‫So let's see what this looks like with the white grid style.
‫Just for a quick refresh, we'll go back up.
‫This is what it looks like.
‫This is the original one.
‫We've just copied the code from this cell.
‫And so we're going to come down, take a quick snapshot of that in your mind, and we're going to see
‫what the seaborne version looks like.
‫Let's hit shift into.
‫Okay.
‫So a little bit different.
‫We've got the white grid that makes sense because we're using a seaborne white grid.
‫But these colors, I think the line's a different color.
‫It's red now and these dots are black and white by default.
‫What happens if you say, I like the Seabourn White grid style, but I don't really like these colors
‫that it's putting out?
‫Well, as you might have guessed, the beautiful thing is not pop lip.
‫It's got a whole bunch of different colors and we can change up the colors.
‫So if we go in here, there's a little parameter called C map, which stands for Color Map, and there's
‫a whole bunch of different styles.
‫I've kind of explored them myself.
‫I personally like winter or summer.
‫You're thinking This is seasons.
‫All it's going to mean is that this changes the color scheme and let's see what happens.
‫Beautiful.
‫So now our black and white dots are of a wintry colour scheme.
‫You can tell the difference a lot more than just pure black and white.
‫Now, if we have a look, if we go to I believe it's map plot lib colors tutorial.
‫Now this should show the Mac pot lib documentation where you can see a whole bunch of different colors.
‫If we go here, control f so colors.
‫That's what we're after.
‫Choosing colour maps in map plot lib.
‫So again, there's a lot of information here.
‫We go down.
‫So it's got some different patterns here.
‫If we keep going down, you'll start to see if you type in this as a string plasma.
‫Let's see what happens here.
‫That's going to change the color map.
‫So let's go back to our notebook.
‫We might type in plasma.
‫Okay.
‫So it's changed it back.
‫I personally prefer winter.
‫You can also do summer.
‫Lets see what that looks like.
‫Okay.
‫That's all right.
‫But still, I think winter's my favorite.
‫I've had a practice with these same apps.
‫There we go.
‫That looks great.
‫But this is the map plot documentation.
‫So tutorials slash colors, slash color maps, and you can keep scrolling down.
‫There's a whole bunch here if you just want a green and blue or if you just want a blue and purple,
‫you can use these little color codes.
‫Pu blue for blue and purple or yellow, green, blue.
‫We'll keep going.
‫There's actually quite a few.
‫Right?
‫So it's all about experimenting and trying to figure out which colors you personally prefer or which
‫colors best demonstrate what you're trying to show in your map.
‫Plot, lib plot.
‫But this line over here that's not really offering much.
‫So let's let's check out how we can kind of constrain our plot to certain widths and certain heights
‫on the different axis values using x lim and Y lim.
‫Let's grab our double sided plot from before our subplot.
‫We'll grab that code.
‫Again, this is one of the only times you're allowed to copy and paste code because there's quite a
‫lot of it.
‫So to save time, writing it out will bring down the graph because what we're focused on is customising
‫the Y and X axis limitations.
‫We'll put that down there.
‫So now we've just copied and pasted.
‫The code.
‫From take a snapshot of this one as well.
‫From up here down to here.
‫Now, if we run this.
‫It's going to output that subplot that we saw before, but with the default seaborne colours.
‫So what do we have to do?
‫We have to change the sea map.
‫So let's see it in action.
‫Sea map again.
‫This is just in our scatterplot like we've done up here.
‫We've added a sea map parameter, so we'll do that here.
‫Sea map equals winter.
‫Let's see what happens.
‫Beautiful.
‫That changes axis zero.
‫So the first plot.
‫Now we have to do the same for axis one.
‫We'll add in.
‫See Matt.
‫He calls Winter beautiful.
‫We'll go down and have a look.
‫Beautiful.
‫So now I got two really good looking plots right here.
‫So if we go back to our anatomy of a map plot, lib plot.
‫Starting to get really close to what we've got here.
‫But as you can see with ours, we've got this line here, this line here, and this one up here.
‫Whereas on here, it's kind of clean, the edges nice and cut off at 50.
‫They're at 200 up there.
‫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 the set parameter, we could do it in
‫there, but I'll show you another way of doing it.
‫So we'll customize Axis 0/1 just to show you what's going on.
‫Axis zero dot set y limb.
‫To be.
‫What do we want?
‫Yeah.
‫So we want to cut it off.
‫And about 50.
‫Let's try that.
‫So set X LIM So we're going to do that 50.
‫Remember, we can always change this.
‫So this is going to be change the x axis limits.
‫There we go.
‫So let's see what this does.
‫We go to shift.
‫Enter.
‫Beautiful.
‫So now we've cut off that line that was here before.
‫So let's do this just to see what happens.
‫Ron.
‫So that's what we've done.
‫We've removed this line because we've changed the X limit of access zero to be 50.
‫Remember, both of these are using the same x axis as age, so let's do it.
‫Let's keep that in there.
‫We'll change that limitation there.
‫We're going to add the same thing to Axis one.
‫We'll put it under here.
‫Change x1x axis limits.
‫Well, we're going to go x one dot.
‫Set X Slim and we're going to change that to B.
‫I think it's the same 50 and 80.
‫Nice and simple.
‫58.
‫And we're also going to change the Y limit on here to remove this top line to be a flat 200.
‫Maybe we go from 50 to 200 or 60.
‫60 to 200, I think that'll be a good range.
‫So we'll do that as well.
‫X one point set.
‫Y lim.
‫6200.
‫Now, let's see what happens.
‫So now take a quick look at what we've got here.
‫We've got this graph.
‫We've got this line here.
‫We've got this one.
‫We've got this line here, and we've got this top line here.
‫So let's see, because we've changed the X limb and the Y limb of access one and the X limb of Axis
‫zero, hopefully, if we've done it.
‫All right, beautiful.
‫That's what we're talking about.
‫So now we've fully replicated the plot that we have here.
‫We've got the exact same thing going on here.
‫We've cleaned up the x axis as we've changed the colour, we've changed the style and can't really see
‫it all in one hit.
‫So let's zoom out a little bit.
‫There we go.
‫So that plot is looking pretty darn good.
‫I don't know if you agree or not.
‫Maybe you create your own style, maybe some different colors or something like that.
‫But to me, that looks like something we can share.
‫So that's what we're going to look in.
‫The next video is saving and sharing this plot.
‫So have a practice around, maybe change the limitations with some different data or change the style,
‫change the sea map and see if you can create your own version of this heart disease analysis.