Welcome back to another class of the complete introduction to data science with the use of Python.
So this class will be our last class about matplotlib and that basically we are going to learn to create
another type of graph or chart inside of this class.
So up until now, you guys understood what is Muttalib and what is a visualization tool.
All right.
So into this class, we are going to create a scatter plot.
So basically, this is a plot with dots a bit everywhere.
So it's pretty simple to create and pretty simple to understand.
So basically, it's going to make a cloud of dust, which is pretty cool.
You'll see what it looks like.
So, as always, the first part is to create is to import matplotlib that pipework.
Then we'll create our little database with X and Y, so for the X and Y axis, then we'll just give
a title to our graph as well as a title for the X axis and the X and Y axis.
All right.
So let's start.
So first thing, as I said, we will import math lot, Leyb, that pipework as Kielty.
So this is what we always do then.
It's pretty simple.
We need to write down something for the X's and the whys.
So basically we can we will have our X axis right here and let's say we'll have five.
That's in our x axis, which would be three, six, seven, nine and let's say 10.
So here we go.
We have our existence.
Then the next thing will be having something for our y axis.
So let's say it's going to be in this case, five.
Ten, twenty five.
Three and one, all right.
So right now we have five dots, five X's and five white.
Next thing will be giving a title to our database.
Well, not in our database to our graph.
So basically, we will write down the title.
So same thing, that title.
And let's call it once again test.
Then we need the x axis and the Y axis, so t x labels will give a name to X. So.
This takes.
And BLT wisely, so we need a name for Weiss.
That's why, all right, so right now we have everything that we need.
Now it's time to write down the function that will allow us to create the chart and in this case is
going to be that scattered.
So we have our function right here.
And what will be the arguments inside of this function?
It's pretty simple.
It's going to be X and Y that we have right there.
So we'll write it down X and Y.
So we have our two arguments.
So next thing that we need to do is simply run or we'll write down fields that showed to be able to
run everything that we have.
So here we go.
And as you can see, we have all our ducks right here, so it's pretty simple.
We have our first dart, which is three and five, works perfectly, then 10 and six.
So basically we have the six and the 10 right here, then seven and twenty five works well, nine as
well as three.
So it's right here.
And finally 10 and one right there.
So everything works perfectly as you guys can see.
Another thing that we can do right now is, as always, changing the style.
So what we'll do, we'll import the package.
So from matplotlib import style.
All right, and we can watch the news and here we can choose the type of style that once, once again
will use the classic stuff and we can run everything and see what it looks like.
So as you can see, everything behind is great.
So this is the main well, the main difference that we can see here is this is pretty simple to work
with.
In my opinion.
This graph is pretty simple to create.
And well, once again, you can do a lot of really interesting things with this visualization tool in
general.
So it's really an interesting visualization to sort that we saw in the best two classes, different
graphs that you guys can create with matplotlib.
You can do many more things so you can create two graphs.
At the same time.
You can do pretty much what a lot of things to visualize your data.
But right now it's really up to you to practice all this and you can do really amazing things with matplotlib
alone.
So this is really an amazing visualization, too, and it can be a really good thing to instead of having
matlab using matplotlib since it does pretty much the same thing.
So you guys like this part of the course because this was the last class of matplotlib and see out in
the next part of this course.