 Now, one way you may want to visualize your data is through multiple different charts. And yes, you can just produce multiple different charts using our previous method. But you can also generate something called subplots within one giant figure if you're trying to show multiple things at once. So a visualization of this would be, say for example, we take the iris data and we do scatter plots from each one of the different data points to just see some visualizations. As you can see, we're seeing some right here. So the entire idea is this in itself is just one subplot. This is another subplot, et cetera, et cetera. So how do we go about working off of this? To start, when we're first starting out, the first thing we actually need to do is instead of just immediately going in and saying something like plot or scatter like before, instead we first establish that we are going to be working off of something called subplots, a plt.subplot. Then it's expecting some constraints. The two most important ones are the number of rows and the number of columns. Columns, there we are. Now before we get into something like share x and share y and everything else here, two of the things are going to be produced. This is going to produce a tuple where the first value is the overall figure. And this is, in that case, sort of the entire graphic. But then it's also going to produce some separate value. That is the individual subplots, subplots. Now I'm calling them axes because, again, the plural of axes is axes. You may also see this very commonly in tutorials, B, A, X. Again, this is now just sort of naming standards that people have employed over the years. I do both, just really depends on my day. But the entire idea is that now if we want to represent any particular axes, we are going to use this as if it was a list. So in that case, if I want to work off of any particular value, I would specify, say for example axes, and then I'll call this first just some index. Now to start, we're going to actually just work off of a very small subplot. So the entire idea is just, I want to have two graphics right next to each other. And for our sake, start with something like a pie chart. So if we come in, I've already thrown together some data just to kind of have it here. I actually don't even need a pie, so let me get rid of that. So the entire idea is, again, I have sort of some percentages, and then I have labels for each one of those percentages, nitrogen, oxygen, argon, and other. So I need to first produce my subplots. So once again, I need to specify that I'm going to have an overall figure, and then I'm going to have some axes attached to it. And then I'll set that equal to PLT, that subplots. Now when we're dealing with, say for example, this visualization, again, I only want one row with two columns, one row, two columns. I build it, I show it, and there you go. It's just going to give me a very blank thing to start. But this is one of the reasons why I just set an axes to start, and I didn't expand on that. Because this is where I won't lie, you know, that plot lib can get a little funky. So just as that preface. If we're dealing with a single row of subplots, then we only use a single index. So in this case, zero is going to refer to that left value. Now like I said, I want to show a pie chart. Well, just like plotting, scatter, you can maybe take a stab in the dark at what this value will be. Pie. Okay. All right. Fair enough. Now it's going to be expecting what values. That's our C category. So if we take a look just now, you'll see, you know, produces a little text. That's just sort of some output that Jupiter is also showing us. But you can see there's our pie chart. Now again, we have labels that I want to also attach to this. And this is where depending on the specifics of which type of chart you're producing, it may either be labels or label or L. And so L equaling L, no, it's not L. It's label, labels. I'll get it eventually. Labels. There we go. Awesome. Now it's still not perfect as you can sort of see it's, you know, kind of bleeding in a weird spot here. But again, just because we're still working off of the entire idea of these pie charts, the next one I'll show just as sort of the fancy sort of way is this time I can come in and not ax axes. Same kind of thing. I'll do the pie. I'll still do C. I'll still do labels equaling L this time. But let's say, for example, I want to have these slightly separated. That's where we'll use an additional command exploded. And then we just specify how far we want each individual data point, each one of these to be separated out. So maybe we really want to accent the argon value. So nitrogen, I'll keep at zero, doesn't need to move. It's quite large. Oxygen, the next one, I'll say that's going out 0.1. Argon will say it goes out 0.2. And then others, since it's very small, will say only goes out 0.5. So again, we're now just sort of showing a separation. Nitrogen then go out. Oxygen go out. That's a little bit. Argon go out a little bit more. Other go less out. So we take it, not exploded, explode. And there you have it. So you can see now we've got sort of that first subplot, again, being referenced with axes at zero. And then we have our second subplot axes at one. And again, we've got a little exploded action going on there. Now just to expand on that, what happens when I'm dealing with multiple rows and columns? This is where we can get fancy. So in that case, just to kind of clean that up with one row, a single digit, with two plus rows, a list of X and Y, really not so much of a list, but a tuple, if you will. And so just to see this sort of in action, you can see, oh, well, I still am going to give it the square brackets. This is still, yes, you're still technically doing this. This is technically a tuple because axes is not really treating this as a list anymore. It's now treating it like a dictionary. And so in this case, as you can sort of see, if I want to, in this case, change something like the face color or the background, I have another command called set face color. And then this is just where you can pass in different commands, such as, for example, some of the named colors. So I could have said red, orange, yellow or salmon if I want to be super fancy. But this would allow me to go in and then say set face value. If I wanted to do my scatter plot, for example, I would come in axes at let's say, for example, I'll just represent, I'll go with this one right here. That is on the second row. So referencing it by our zero or starting at zero, one, two, three. So representing that that first value would be one. And then we're working off of the zeroth column, so zero. And then we would treat this no different than when we were working off of the just PLT version. I'd just come in and specify my scatter values. Now I do have some extra things going on here, like I have multiple colors. Well, if we were to take a look at something like that scatter plot here, it is sort of in actual code, the same kind of concepts coming in here. It's a lot. I won't lie. So to start, the idea is we're traversing through each one of our values. So for range and then for range again. So for each row, for each column, then as you can see, I'm creating some multiple axes for each one of the species of the iris data set. So Satosa has its xy axis, Varus color has its xy axis, Vrgenika has its xy axis. So we're building out, we're starting out with our skipping over our header. So we're just going to go ahead and get rid of that. And then as you can see, we're treating this with a CSV reader, which is going to read through this as if it was a list. Okay, fair enough. Then as you can see, I'm going in and I'm going ahead and separating each one of those out for me. This is going to take all five of the values that are on each line in the CSV reader and go ahead and establish a value for them. So sepal length, sepal width, petal length, petal width and the species. Then I'm just going to separate out or determine which one of the x axis I want to be working off of. So I'm using a conditional statement to work off of this. Checking the species and saying, oh, well, if I'm in this case, say for example, Satosa, I want my x axis to be the Satosa x axis. If I'm in varice of color, then I want my x axis to be my varice of color axis. Then I'm doing some fanciness. I'm just going ahead and creating a mapping. So I'm creating a dictionary where I only want to work off of sepal length. So in this case, I take this dictionary with all these values and I'm adding them into that particular x, y axis. Okay. Again, anything that was a Satosa data entry is going into this particular list and then I'm just appending those into it, appending a dictionary into it. But then you can see I have some extra information. This is for a scatter, for example, we need to use something like I'm establishing my marker size. So there's a little size difference to there. And then you can see I'm making three entries into that particular element. So again, if we're thinking about this as this one zero entry, I in that case would be one j would be zero. And I'd say scatter the Satosa x, y axis, color them red and make them a size of five. And so that's where that red data points are. And then do the same thing for various colors x, y axis, color them green so you can see some greens going on there. And then virginica once again, this time doing blue and you can see sort of that blue going on there. Now I am adding in a little extra flair to this version just for visualization sake. And one of those is I'm changing the tick marks to not appear the entire reason just to even see why this is happening. I take this, I run it, give it a second. Question, you know, life, skip ahead, there we are. This is sort of why I'm skipping, I'm removing those tick marks is because, you know, it's getting a little ugly and doesn't visually sort of do it for me. So I'm just getting rid of those using this command. So the entire idea here is first I have to get the x, y axis, and then I have to set it to a blank list. That's just again, this is how you need to do it with matplotlib. And then once again, I'm using those, I'm using something called set x label and then set y label to specify specifically what number I'm working off of. So in this case, I want say sepal length to, if I'm dealing it once again with this one, zero, this specific subplot, I want one to be sepal width. So I would be the one and I want our y label to be zero. So sepal length, so sepal length, sepal width. Then just to add in that flare, just to again, just specify these different things we can work off of. Here I'm coming in and then the zero three, zero throw, third column. I'm just changing the background to something like salmon. So again, just to clean it up. There we are. But this can be a number of different things. So it could also be a hexadecimal value. So something like ff00000, which would translate into a very bold red. Very bold red, as you can see, it actually washes out the setosa. But that's where you would get a little fancier, like d4, I don't know, 32, 32, right? So red, but not super red, red, not a good red. I'll go back to my salmon and there you have it, subplots.